[Pkg-iscsi-maintainers] [SCM] Debian Open-iSCSI Packaging branch, upstream-mnc, updated. 2.0-872-193-gde2c0e7

Mike Christie michaelc at cs.wisc.edu
Sat Apr 7 15:43:57 UTC 2012


The following commit has been merged in the upstream-mnc branch:
commit 2af71a9f597dbe5e04edce6af64b0634d9abe049
Author: Mike Christie <michaelc at cs.wisc.edu>
Date:   Tue Nov 1 19:47:37 2011 -0500

    iscsid: don't sync qla4xxx flash sessions
    
    We do not want to sync iscsid with qla4xxx's flash/fw sessions,
    because the kernel/fw controls recovery.
    
    This uses the creator sysfs file to figure out if the session
    is ours or not.

diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
index 72b68a3..beca42f 100644
--- a/usr/iscsi_sysfs.c
+++ b/usr/iscsi_sysfs.c
@@ -231,6 +231,29 @@ void iscsi_sysfs_get_negotiated_session_conf(int sid,
 		      &conf->MaxOutstandingR2T);
 }
 
+/*
+ * iscsi_sysfs_session_user_created - return if session was setup by userspace
+ * @sid: id of session to test
+ *
+ * Returns -1 if we could not tell due to kernel not supporting the
+ * feature. 0 is returned if kernel created it. And 1 is returned
+ * if userspace created it.
+ */
+int iscsi_sysfs_session_user_created(int sid)
+{
+	char id[NAME_SIZE];
+	pid_t pid;
+
+	snprintf(id, sizeof(id), ISCSI_SESSION_ID, sid);
+	if (sysfs_get_int(id, ISCSI_SESSION_SUBSYS, "creator", &pid))
+		return -1;
+
+	if (pid == -1)
+		return 0;
+	else
+		return 1;
+}
+
 uint32_t iscsi_sysfs_get_host_no_from_sid(uint32_t sid, int *err)
 {
 	struct sysfs_device *session_dev, *host_dev;
diff --git a/usr/iscsi_sysfs.h b/usr/iscsi_sysfs.h
index 80c1b8b..d1ce6cb 100644
--- a/usr/iscsi_sysfs.h
+++ b/usr/iscsi_sysfs.h
@@ -90,6 +90,7 @@ extern struct iscsi_transport *iscsi_sysfs_get_transport_by_session(char *sys_se
 extern struct iscsi_transport *iscsi_sysfs_get_transport_by_sid(uint32_t sid);
 extern struct iscsi_transport *iscsi_sysfs_get_transport_by_name(char *transport_name);
 extern int iscsi_sysfs_session_supports_nop(int sid);
+extern int iscsi_sysfs_session_user_created(int sid);
 
 extern struct list_head transports;
 
diff --git a/usr/iscsid.c b/usr/iscsid.c
index d292f9b..215652a 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -221,6 +221,9 @@ static int sync_session(void *data, struct session_info *info)
 		return 0;
 	}
 
+	if (!iscsi_sysfs_session_user_created(info->sid))
+		return 0;
+
 	memset(&rec, 0, sizeof(node_rec_t));
 	/*
 	 * We might get the local ip address for software. We do not

-- 
Debian Open-iSCSI Packaging



More information about the Pkg-iscsi-maintainers mailing list