Page MenuHomeFreeBSD

D51782.id176764.diff
No OneTemporary

D51782.id176764.diff

diff --git a/usr.sbin/ctld/ctld.hh b/usr.sbin/ctld/ctld.hh
--- a/usr.sbin/ctld/ctld.hh
+++ b/usr.sbin/ctld/ctld.hh
@@ -220,6 +220,7 @@
bool set_dscp(u_int dscp);
virtual bool set_filter(const char *str) = 0;
void set_foreign();
+ void set_kernel();
bool set_offload(const char *offload);
bool set_pcp(u_int pcp);
bool set_redirection(const char *addr);
@@ -248,6 +249,7 @@
enum discovery_filter pg_discovery_filter =
discovery_filter::UNKNOWN;
bool pg_foreign = false;
+ bool pg_kernel = false;
bool pg_assigned = false;
std::list<portal_up> pg_portals;
std::unordered_map<std::string, port *> pg_ports;
diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc
--- a/usr.sbin/ctld/ctld.cc
+++ b/usr.sbin/ctld/ctld.cc
@@ -578,9 +578,18 @@
return (it->second.get());
}
+/*
+ * Foreign portal groups (which only redirect to other targets), and portal
+ * groups without any active portals are considered dummies and ports belonging
+ * to such groups are ignored. However, portal groups that exist in the kernel
+ * prior to ctld starting will contain real ports but no portals, so these are
+ * never considered dummies.
+ */
bool
portal_group::is_dummy() const
{
+ if (pg_kernel)
+ return (false);
if (pg_foreign)
return (true);
if (pg_portals.empty())
@@ -697,6 +706,12 @@
pg_foreign = true;
}
+void
+portal_group::set_kernel()
+{
+ pg_kernel = true;
+}
+
bool
portal_group::set_offload(const char *offload)
{
diff --git a/usr.sbin/ctld/kernel.cc b/usr.sbin/ctld/kernel.cc
--- a/usr.sbin/ctld/kernel.cc
+++ b/usr.sbin/ctld/kernel.cc
@@ -483,6 +483,8 @@
log_warnx("Failed to add portal-group \"%s\"", pg_name);
return;
}
+
+ pg->set_kernel();
}
pg->set_tag(port.cfiscsi_portal_group_tag);
if (!conf->add_port(targ, pg, port.port_id)) {
@@ -520,6 +522,8 @@
tg_name);
return;
}
+
+ pg->set_kernel();
}
pg->set_tag(port.portid);
if (!conf->add_port(targ, pg, port.port_id)) {

File Metadata

Mime Type
text/plain
Expires
Wed, May 27, 11:24 AM (4 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33554950
Default Alt Text
D51782.id176764.diff (1 KB)

Event Timeline