Erez Zilber wrote:
> The following series of patches fixes a bug in iscsid: if a transport is 
> unloaded and then reloaded, the transport entry in iscsid is still the old 
> one.
> 

I think I am going to revert this. I think we can do this in userspace 
without any help from the kernel. To setup the userspace transport we 
basically poll userspace, so we can just update the transport in that 
same code path. You should revert the original patch 
b67cfc18c70b4cfd903d1f6e0dea6caaa0a74a2b then apply this one.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To post to this group, send email to open-iscsi@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/open-iscsi
-~----------~----~----~----~------~----~------~--~---

diff -aurp open-iscsi/usr/iscsi_sysfs.c open-iscsi.work/usr/iscsi_sysfs.c
--- open-iscsi/usr/iscsi_sysfs.c	2008-05-05 23:43:59.000000000 -0500
+++ open-iscsi.work/usr/iscsi_sysfs.c	2008-05-05 23:43:45.000000000 -0500
@@ -118,7 +118,7 @@ static int read_transports(void)
 {
 	struct dirent **namelist;
 	char filename[64];
-	int i, n, found, err = 0;
+	int i, n, err = 0;
 	struct iscsi_transport *t;
 
 	log_debug(7, "in %s", __FUNCTION__);
@@ -131,22 +131,16 @@ static int read_transports(void)
 	}
 
 	for (i = 0; i < n; i++) {
-		found = 0;
-
 		list_for_each_entry(t, &transports, list) {
-			if (!strcmp(t->name, namelist[i]->d_name)) {
-				found = 1;
-				break;
-			}
+			if (!strcmp(t->name, namelist[i]->d_name))
+				goto update_transport;
 		}
 
-		if (found)
-			continue;
-
 		/* copy new transport */
 		t = malloc(sizeof(*t));
 		if (!t)
 			continue;
+
 		log_debug(7, "Adding new transport %s", namelist[i]->d_name);
 
 		INIT_LIST_HEAD(&t->sessions);
@@ -154,6 +148,7 @@ static int read_transports(void)
 		strncpy(t->name, namelist[i]->d_name,
 			ISCSI_TRANSPORT_NAME_MAXLEN);
 
+update_transport:
 		sprintf(filename, ISCSI_TRANSPORT_DIR"/%s/handle", t->name);
 		err = read_sysfs_file(filename, &t->handle, "%llu\n");
 		if (err)

Reply via email to