Mike Christie | 23 Feb 04:25 2015
Picon

Re: [Lsf] It's time to put together the schedule

Dropping lsf for iscsi list.

On 2/22/15, 12:12 PM, Sagi Grimberg wrote:
> On 2/22/2015 7:51 PM, James Bottomley wrote:
>> On Sun, 2015-02-22 at 18:57 +0200, Sagi Grimberg wrote:
>>> On 2/22/2015 6:32 PM, James Bottomley wrote:
>>>
>>>>> Hey All,
>>>>>
>>>>> I'm also interested in talking about block/scsi-mq. Moreover, I was
>>>>> hoping we can talk about iSCSI in the context of scsi-mq. We
>>>>> started the
>>>>> discussion on the list
>>>>> (http://marc.info/?l=linux-scsi&w=2&r=2&s=iSCSI+MQ+adoption+via+MCS+discussion&q=b)
>>>>>
>>>>> and I'd like us to come
>>>>> to an agreement on this.
>>>>>
>>>>> What I would like to talk about is:
>>>>> - How will we implement multiple submission queues?
>>>>>      MCS or multiple sessions - pros/cons.
>>>>>
>>>>> - Fitting iSCSI sockets to HW contexts is trivial, but getting
>>>>>      the completions to steer to the correct CPU is something we
>>>>> may want
>>>>>      to discuss. Do we want to control that? or do we want to let the
>>>>>      networking stack to do handle it like any other socket (RFS,
>>>>> XPS ...)
>>>>>
>>>>> I think it might be worth do dedicate a session for this if we have an
(Continue reading)

Andy Grover | 7 Feb 01:36 2015
Picon

[PATCHv2 0/3] Fix issues resulting from actor rewrite

I think I got a handle on the original issue you were seeing Mike,
please take a look at #2 patch.

The added debug logging had some bugs, so v2 also respins that patch,
now #3.

Thanks -- Andy

Andy Grover (3):
  Fix incorrect list operation leading to out-of-order items on
    pend_list
  Prevent spinning over poll() when reconnecting to an inaccessible
    target
  Add some more debug logging to actor.c

 usr/actor.c     | 27 +++++++++++++++++++++------
 usr/initiator.c | 11 +++++------
 2 files changed, 26 insertions(+), 12 deletions(-)

-- 
2.1.0

--

-- 
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe@...
To post to this group, send email to open-iscsi@...
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

(Continue reading)

Nicolas Ecarnot | 6 Feb 15:49 2015
Picon

2 NICs, 2 targets : discover OK but no login. Same subnet impossible?

Hello list,

My setup is described here in details :
https://groups.google.com/d/msg/open-iscsi/ivprFF9hklY/mkVPHo5q1p0J
but now I have another issue.

I'm trying to connect 2 NICs to a SAN that presents 2 ip, and all that is on the same subnet and on the same switch.
I read some old comments on old threads (< 2006) that discouraged that, and one answer of Mike also said the same :
I think you might hit some issues or at least not get what you expect with both network interfaces on the same subnet, but using the default iscsi default iface.
(though I don't understand the very last part after the comma)

But I hoped the situation had improved since, and that some limitations had gone.
Indeed, when re-re-re-reading the doc page of open-iscsi, I see nowhere advicing against having two NICs on the same subnet.

So I tried and got that :
- both NICs (em3 and em4) can ping the 2 SAN's ip
- With iscsiadm, I'm adding iface0 and iface1, and I specify the MAC hardware address of the corresponding em3 and em4
- When discovering, all seems to work well
- When login in, it is failing in a way it seems I'm not allowed to connect using both ifaces at the same time.

When trying to log in, I specify the iface0, and the login to the 2 SAN ip is working well.
But then, doing the same with iface1 is failing, with a kernel errror message :
iscsid: conn 0 login rejected: target error (03/02)
And after having logout, trying the same way around with iface1 first results in the same behaviour.

Is it by design that iscsi does not permit the login from 2 ifaces concurrently?
I tried to find somewhere in my EMC SAN (Cx3-10) where there would be some sort of such limitations, but found nothing.

--
Nicolas Ecarnot

--
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to open-iscsi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.
Andy Grover | 6 Feb 02:14 2015
Picon

[PATCH 0/2] Fix a bug in actor.c and add more debug stuff

Hi Mike,

Patch 1 fixes the timers to expire properly. Patch 2 adds some more debug
prints if you think that would be useful beyond the present issues.

I haven't tried digging into the original issue, but will be geting into it
tomorrow.

Andy Grover (2):
  Fix incorrect list operation leading to out-of-order items on
    pend_list
  Add some more debug logging to actor.c

 usr/actor.c | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

-- 
2.1.0

--

-- 
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe@...
To post to this group, send email to open-iscsi@...
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

nicolas.ecarnot | 4 Feb 14:28 2015
Picon

Logging hanging, invalid session

Hi list,

I'm facing a similar problem as what has been discussed here in 2011 :
https://groups.google.com/d/msg/open-iscsi/pQQ8_ernzgQ/7ZVkoDmY2qYJ
but versions have since raised, so I don't know what to look at.

TL;DR :
iscsiadm -m node -T iqn.1992-04.com.emc:cx.ckm00094900174.a2 -l
...
...
-> sleeping there until I ctrl-c interrupt it.
The only error msg I get is on the console :
iscsi: invalid session 0
Specifying the SAN ip does not improve anything.

Long version :

We have a Dell PE R610 in 64bits with 4 NICs :
- em1 + em2 are bonded and dedicated to the management on a specific VLAN
- em3 and em4 are not bonded, and dedicated to the iSCSI specific VLAN

ping -I from em3 and em4 towards our Cx4-120 SAN is working, towards its two different IPs.
And the ping from the SAN is also working.

In /etc/sysctl.conf, I have :
net.ipv4.conf.em3.arp_ignore = 1
net.ipv4.conf.em4.arp_ignore = 1
net.ipv4.conf.em3.arp_announce = 2
net.ipv4.conf.em4.arp_announce = 2
net.ipv4.conf.em3.rp_filter = 0
net.ipv4.conf.em4.rp_filter = 0


iptables and selinux are off.

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID:    OracleServer
Description:    Oracle Linux Server release 6.6


The discovery sounds good :
root <at> serv3:/var/lib/iscsi# iscsiadm -m discovery -p 192.168.29.1 -t st -I default
192.168.29.1:3260,1 iqn.1992-04.com.emc:cx.ckm00094900174.a2
192.168.29.2:3260,2 iqn.1992-04.com.emc:cx.ckm00094900174.b2


The 2 NICs are NetXtreme II BCM5709 Gigabit Ethernet. They support offloading, but I'm not comfortable enough with that yet to play with it. So at present, I'd prefer just use a classical tcp transport.

Iface scanning sounds good too :
root <at> serv3:/var/lib/iscsi# iscsiadm -m iface
default tcp,<empty>,<empty>,<empty>,<empty>
iser iser,<empty>,<empty>,<empty>,<empty>
bnx2i.f0:4d:a2:07:59:91 bnx2i,f0:4d:a2:07:59:91,<empty>,<empty>,<empty>
bnx2i.00:00:00:00:00:00 bnx2i,00:00:00:00:00:00,<empty>,<empty>,<empty>
bnx2i.f0:4d:a2:07:59:95 bnx2i,f0:4d:a2:07:59:95,<empty>,<empty>,<empty>
bnx2i.f0:4d:a2:07:59:93 bnx2i,f0:4d:a2:07:59:93,<empty>,<empty>,<empty>


Other informations :
root <at> serv3:/var/lib/iscsi# rpm -qa|grep -i iscsi
iscsi-initiator-utils-6.2.0.873-2.0.2.el6.i686
root <at> serv3:/var/lib/iscsi# iscsiuio -v
iscsiuio: Version '0.7.6.1', Build Date: 'Wed May 29 14:08:11 PDT 2013'
root <at> serv3:/var/lib/iscsi# uname -a
Linux serv3 3.8.13-55.1.5.el6uek.x86_64 #2 SMP Wed Jan 28 17:03:28 PST 2015 x86_64 x86_64 x86_64 GNU/Linux


I tried to disable em4, reboot, and try a connection from a single NIC (em3), but that did nothing better.

I don't know if the fact that these NICs support offloading may disturb the simplest tcp transport way of connecting?
I must admit I'm a little blocked here, as this is not the first server I'm connecting using iscsi, but as the pings are OK, what else could I check?

Thank you.

--
Nicolas Ecarnot

--
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to open-iscsi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.
Nicolas Ecarnot | 4 Feb 14:44 2015
Picon

Logging hanging. Invalid session

Hi list,

I'm facing a similar problem as what has been discussed here in 2011 :
https://groups.google.com/d/msg/open-iscsi/pQQ8_ernzgQ/7ZVkoDmY2qYJ
but versions have since raised, so I don't know what to look at.

TL;DR :
iscsiadm -m node -T iqn.1992-04.com.emc:cx.ckm00094900174.a2 -l
...
...
-> sleeping there until I ctrl-c interrupt it.
The only error msg I get is on the console :
iscsi: invalid session 0
Specifying the SAN ip does not improve anything.

Long version :

We have a Dell PE R610 in 64bits with 4 NICs :
- em1 + em2 are bonded and dedicated to the management on a specific VLAN
- em3 and em4 are not bonded, and dedicated to the iSCSI specific VLAN

ping -I from em3 and em4 towards our EMC Cx4-120 SAN is working, towards its two different IPs.
And the ping from the SAN is also working.

In /etc/sysctl.conf, I have :
net.ipv4.conf.em3.arp_ignore = 1
net.ipv4.conf.em4.arp_ignore = 1
net.ipv4.conf.em3.arp_announce = 2
net.ipv4.conf.em4.arp_announce = 2
net.ipv4.conf.em3.rp_filter = 0
net.ipv4.conf.em4.rp_filter = 0


iptables and selinux are off.

LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID:    OracleServer
Description:    Oracle Linux Server release 6.6


The discovery sounds good :
root <at> serv3:/var/lib/iscsi# iscsiadm -m discovery -p 192.168.29.1 -t st -I default
192.168.29.1:3260,1 iqn.1992-04.com.emc:cx.ckm00094900174.a2
192.168.29.2:3260,2 iqn.1992-04.com.emc:cx.ckm00094900174.b2


The 2 NICs are NetXtreme II BCM5709 Gigabit Ethernet. They support offloading, but I'm not comfortable enough with that yet to play with it. So at present, I'd prefer just use a classical tcp transport.

Iface scanning sounds good too :
root <at> serv3:/var/lib/iscsi# iscsiadm -m iface
default tcp,<empty>,<empty>,<empty>,<empty>
iser iser,<empty>,<empty>,<empty>,<empty>
bnx2i.f0:4d:a2:07:59:91 bnx2i,f0:4d:a2:07:59:91,<empty>,<empty>,<empty>
bnx2i.00:00:00:00:00:00 bnx2i,00:00:00:00:00:00,<empty>,<empty>,<empty>
bnx2i.f0:4d:a2:07:59:95 bnx2i,f0:4d:a2:07:59:95,<empty>,<empty>,<empty>
bnx2i.f0:4d:a2:07:59:93 bnx2i,f0:4d:a2:07:59:93,<empty>,<empty>,<empty>


Other informations :
root <at> serv3:/var/lib/iscsi# rpm -qa|grep -i iscsi
iscsi-initiator-utils-6.2.0.873-2.0.2.el6.i686
root <at> serv3:/var/lib/iscsi# iscsiuio -v
iscsiuio: Version '0.7.6.1', Build Date: 'Wed May 29 14:08:11 PDT 2013'
root <at> serv3:/var/lib/iscsi# uname -a
Linux serv3 3.8.13-55.1.5.el6uek.x86_64 #2 SMP Wed Jan 28 17:03:28 PST 2015 x86_64 x86_64 x86_64 GNU/Linux


I tried to disable em4, reboot, and try a connection from a single NIC (em3), but that did nothing better.

I don't know if the fact that these NICs support offloading may disturb the simplest tcp transport way of connecting?
I must admit I'm a little blocked here, as this is not the first server I'm connecting using iscsi, but as the pings are OK, what else could I check?

Thank you.

-- 
Nicolas Ecarnot

--
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to open-iscsi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.
Chris Leech | 4 Feb 01:28 2015
Picon

[PATCH] iscsid safe session logout

Implement a safe logout option, which uses libmount from util-linux to
check for active mounts (and swaps) over devices, their partitions, and
any holders (like LVM and multipath device maps).  When enabled iscsid
will refuse to logout of sessions actively being used for mounts,
returning a status of EBUSY to the ipc request.

I've made it a configuration option (iscsid.safe_logout) that defaults
to "No" to preserve the existing behavior as the default, while making
it available for users that prefer a safety check.

This does add a new dependency on libmount.

Signed-off-by: Chris Leech <cleech@...>
---
 etc/iscsid.conf |   3 +
 usr/Makefile    |   4 +-
 usr/initiator.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 usr/sysfs.c     |  40 ++++++++++++
 usr/sysfs.h     |   4 ++
 5 files changed, 248 insertions(+), 2 deletions(-)

diff --git a/etc/iscsid.conf b/etc/iscsid.conf
index ef76dc0..6d9a5c0 100644
--- a/etc/iscsid.conf
+++ b/etc/iscsid.conf
 <at>  <at>  -22,6 +22,9  <at>  <at> 
 # Default for upstream open-iscsi scripts (uncomment to activate).
 iscsid.startup = /sbin/iscsid

+# Check for active mounts on devices reachable through a session
+# and refuse to logout if there are any.  Defaults to "No".
+# iscsid.safe_logout = Yes

 #############################
 # NIC/HBA and driver settings
diff --git a/usr/Makefile b/usr/Makefile
index 550fdff..9209d5d 100644
--- a/usr/Makefile
+++ b/usr/Makefile
 <at>  <at>  -55,14 +55,14  <at>  <at>  all: $(PROGRAMS)

 iscsid: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(DISCOVERY_SRCS) \
 	iscsid.o session_mgmt.o discoveryd.o
-	$(CC) $(CFLAGS) $^ -o $ <at>   -L../utils/open-isns -lisns -lrt
+	$(CC) $(CFLAGS) $^ -o $ <at>   -L../utils/open-isns -lisns -lrt -lmount

 iscsiadm: $(ISCSI_LIB_SRCS) $(DISCOVERY_SRCS) iscsiadm.o session_mgmt.o
 	$(CC) $(CFLAGS) $^ -o $ <at>  -L../utils/open-isns -lisns

 iscsistart: $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
 		iscsistart.o statics.o
-	$(CC) $(CFLAGS) -static $^ -o $ <at>  -lrt
+	$(CC) $(CFLAGS) $^ -o $ <at>  -lrt -lmount
 clean:
 	rm -f *.o $(PROGRAMS) .depend $(LIBSYS)

diff --git a/usr/initiator.c b/usr/initiator.c
index 1aadc9b..bedc4a8 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
 <at>  <at>  -30,6 +30,7  <at>  <at> 
 #include <errno.h>
 #include <dirent.h>
 #include <fcntl.h>
+#include <libmount/libmount.h>

 #include "initiator.h"
 #include "transport.h"
 <at>  <at>  -2140,11 +2141,200  <at>  <at>  static int session_unbind(struct iscsi_session *session)
 	return err;
 }

+static struct libmnt_table *mtab, *swaps;
+
+static void libmount_cleanup(void)
+{
+	mnt_free_table(mtab);
+	mnt_free_table(swaps);
+	mtab = swaps = NULL;
+}
+
+static int libmount_init(void)
+{
+	mnt_init_debug(0);
+	mtab = mnt_new_table();
+	swaps = mnt_new_table();
+	if (!mtab || !swaps) {
+		libmount_cleanup();
+		return -ENOMEM;
+	}
+	mnt_table_parse_mtab(mtab, NULL);
+	mnt_table_parse_swaps(swaps, NULL);
+	return 0;
+}
+
+static int trans_filter(const struct dirent *d)
+{
+	if (!strcmp(".", d->d_name) || !strcmp("..", d->d_name))
+		return 0;
+	return 1;
+}
+
+static int subdir_filter(const struct dirent *d)
+{
+	if (!(d->d_type & DT_DIR))
+		return 0;
+	return trans_filter(d);
+}
+
+static int is_partition(const char *path)
+{
+	char *devtype;
+	int rc = 0;
+
+	devtype = sysfs_get_uevent_devtype(path);
+	if (!devtype)
+		return 0;
+	if (strcmp(devtype, "partition") == 0)
+		rc = 1;
+	free(devtype);
+	return rc;
+}
+
+static int blockdev_check_mnts(char *syspath)
+{
+	struct libmnt_fs *fs;
+	char *devname = NULL;
+	char *_devname = NULL;
+	int rc = 0;
+
+	devname = sysfs_get_uevent_devname(syspath);
+	if (!devname)
+		goto out;
+
+	_devname = calloc(1, PATH_MAX);
+	if (!_devname)
+		goto out;
+	snprintf(_devname, PATH_MAX, "/dev/%s", devname);
+
+	fs = mnt_table_find_source(mtab, _devname, MNT_ITER_FORWARD);
+	if (fs) {
+		rc = 1;
+		goto out;
+	}
+	fs = mnt_table_find_source(swaps, _devname, MNT_ITER_FORWARD);
+	if (fs)
+		rc = 1;
+out:
+	free(devname);
+	free(_devname);
+	return rc;
+}
+
+static int count_device_users(char *syspath);
+
+static int blockdev_get_partitions(char *syspath)
+{
+	struct dirent **parts = NULL;
+	int n, i;
+	int count = 0;
+
+	n = scandir(syspath, &parts, subdir_filter, alphasort);
+	for (i = 0; i < n; i++) {
+		char *newpath;
+
+		newpath = calloc(1, PATH_MAX);
+		if (!newpath)
+			continue;
+		snprintf(newpath, PATH_MAX, "%s/%s", syspath, parts[i]->d_name);
+		free(parts[i]);
+		if (is_partition(newpath)) {
+			count += count_device_users(newpath);
+		}
+		free(newpath);
+	}
+	free(parts);
+	return count;
+}
+
+static int blockdev_get_holders(char *syspath)
+{
+	char *path = NULL;
+	struct dirent **holds = NULL;
+	int n, i;
+	int count = 0;
+
+	path = calloc(1, PATH_MAX);
+	if (!path)
+		return 0;
+	snprintf(path, PATH_MAX, "%s/holders", syspath);
+
+	n = scandir(path, &holds, trans_filter, alphasort);
+	for (i = 0; i < n; i++) {
+		char *newpath;
+		char *rp;
+
+		newpath = calloc(1, PATH_MAX);
+		if (!newpath)
+			continue;
+		snprintf(newpath, PATH_MAX, "%s/%s", path, holds[i]->d_name);
+
+		free(holds[i]);
+		rp = realpath(newpath, NULL);
+		if (rp)
+			count += count_device_users(rp);
+		free(newpath);
+		free(rp);
+	}
+	free(path);
+	free(holds);
+	return count;
+}
+
+static int count_device_users(char *syspath)
+{
+	int count = 0;
+	count += blockdev_check_mnts(syspath);
+	count += blockdev_get_partitions(syspath);
+	count += blockdev_get_holders(syspath);
+	return count;
+};
+
+static void device_in_use(void *data, int host_no, int target, int lun)
+{
+	char *syspath = NULL;
+	char *devname = NULL;
+	int *count = data;
+
+	devname = iscsi_sysfs_get_blockdev_from_lun(host_no, target, lun);
+	if (!devname)
+		goto out;
+	syspath = calloc(1, PATH_MAX);
+	if (!syspath)
+		goto out;
+	snprintf(syspath, PATH_MAX, "/sys/class/block/%s", devname);
+	*count += count_device_users(syspath);
+out:
+	free(syspath);
+	free(devname);
+}
+
+static int session_in_use(int sid)
+{
+	int host_no = -1, err = 0;
+	int count = 0;
+
+	if (libmount_init()) {
+		log_error("Failed to initialize libmount, "
+			  "not checking for active mounts on session [%d].\n", sid);
+		return 0;
+	}
+
+	host_no = iscsi_sysfs_get_host_no_from_sid(sid, &err);
+	if (!err)
+		iscsi_sysfs_for_each_device(&count, host_no, sid, device_in_use);
+
+	libmount_cleanup();
+	return count;
+}
+
 int session_logout_task(int sid, queue_task_t *qtask)
 {
 	iscsi_session_t *session;
 	iscsi_conn_t *conn;
 	int rc = ISCSI_SUCCESS;
+	char *safe;

 	session = session_find_by_sid(sid);
 	if (!session) {
 <at>  <at>  -2167,6 +2357,15  <at>  <at>  invalid_state:
 		return ISCSI_ERR_INTERNAL;
 	}

+	safe = cfg_get_string_param(dconfig->config_file, "iscsid.safe_logout");
+	if (safe && !strcmp(safe, "Yes") && session_in_use(sid)) {
+		log_error("Session is actively in use for mounted storage, "
+			  "and iscsid.safe_logout is configured.\n");
+		free(safe);
+		return ISCSI_ERR_BUSY;
+	}
+	free(safe);
+
 	/* FIXME: logout all active connections */
 	conn = &session->conn[0];
 	if (conn->logout_qtask)
diff --git a/usr/sysfs.c b/usr/sysfs.c
index d00c925..bbb00c0 100644
--- a/usr/sysfs.c
+++ b/usr/sysfs.c
 <at>  <at>  -709,3 +709,43  <at>  <at>  int sysfs_set_param(char *id, char *subsys, char *attr_name,
 	close(fd);
 	return rc;
 }
+
+char *sysfs_get_uevent_field(const char *path, const char *field)
+{
+	char *uevent_path = NULL;
+	FILE *f = NULL;
+	char *line, buffer[1024];
+	char *ff, *d;
+	char *out = NULL;
+
+	uevent_path = calloc(1, PATH_MAX);
+	if (!uevent_path)
+		return NULL;
+	snprintf(uevent_path, PATH_MAX, "%s/uevent", path);
+
+	f = fopen(uevent_path, "r");
+	if (!f)
+		goto out;
+	while ((line = fgets(buffer, sizeof (buffer), f))) {
+		ff = strtok(line, "=");
+		d = strtok(NULL, "\n");
+		if (strcmp(ff, field))
+			continue;
+		out = strdup(d);
+		break;
+	}
+	fclose(f);
+out:
+	free(uevent_path);
+	return out;
+}
+
+char *sysfs_get_uevent_devtype(const char *path)
+{
+	return sysfs_get_uevent_field(path, "DEVTYPE");
+}
+
+char *sysfs_get_uevent_devname(const char *path)
+{
+	return sysfs_get_uevent_field(path, "DEVNAME");
+}
diff --git a/usr/sysfs.h b/usr/sysfs.h
index 304dbbf..462060e 100644
--- a/usr/sysfs.h
+++ b/usr/sysfs.h
 <at>  <at>  -66,4 +66,8  <at>  <at>  extern int sysfs_get_uint16(char *id, char *subsys, char *param,
 extern int sysfs_set_param(char *id, char *subsys, char *attr_name,
 			   char *write_buf, ssize_t buf_size);

+extern char *sysfs_get_uevent_field(const char *path, const char *field);
+extern char *sysfs_get_uevent_devtype(const char *path);
+extern char *sysfs_get_uevent_devname(const char *path);
+
 #endif
-- 
2.1.0

--

-- 
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe@...
To post to this group, send email to open-iscsi@...
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

The Lee-Man | 30 Jan 23:09 2015
Picon

iscsid stop using system not working correctly

Hi Mike:

Just a heads up that stopping the open-iscsi iscsid daemon using systemd doesn't seem to be working correctly, at least not on SUSE SLE 12.

When I have one or more sessions present, and their startup value is set to "manual", when I try to stop the iscsid service, I get:

    # systemctl stop iscsid.service
    Job for iscsid.service canceled.

And a "ps" shows that iscsid is still running, but under a new process id. And, at times, I see that "iscsiadm -k 0 2" is hung.

Note that my systemd iscsid.service unit file looks like:

    [Unit]
    Description=Open-iSCSI
    Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
    DefaultDependencies=no
    After=network.target iscsiuio.service
    Before=remote-fs-pre.target

    [Service]
    Type=simple
    ExecStart=/sbin/iscsid -f
    ExecStop=/sbin/iscsiadm -k 0 2

    [Install]
    WantedBy=multi-user.target
    Also=iscsid.socket

While trying to track down this problem, I found a couple of issues:

1. I don't know what the "2" is on the "iscsiadm -k 0 2" is for. I see that command in systemd unit file in your master branch, and I see that other distributions use that, but the "2" seems to be ignored.

2. It looks like the "iscsiadm -k 0" is stopping the iscsi daemon, but that systemd is restarting it! I'm guessing this because (a) I get the "cancelled" message, and (b) iscsid is still running, but as a new process, i.e. it's been restarted.

I thought perhaps the problem was related to running iscsid as a "simple" service, in the foreground, but changing Type to forking and removing the "-f" from the iscsid command line did not change anything.

Then I simply commented out the "ExecStop" line, and iscsid now shutdowns correctly. This, I believe, is because systemd is shutting it down by sending first SIGHUP then SIGKILL, as per "man systemd.kill".

Before I comment out the "ExecStop=" for all SLE 12 users, I wondered if you've heard of any problems along these lines.

--
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To post to this group, send email to open-iscsi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.
Or Gerlitz | 21 Jan 15:19 2015

setting declarative params after login?

Hi Mike,

Long time.. hope you are all well after EOY holidays and with energy to 
for the MCS debates  <at>  LSF...

So back in upstream commit ea05be3ff043efd44256283d968fa1bb9a371568 
"iscsi tools: set non negotiated params early" we are
doing set_param towards the kernel/transport before sending the login 
request.

Running with latest upstream (commit 
76a441ba0dc0071a19daeac456aa898889437efd) we did dump of all set_params 
done towards iser and I see that Max Recv DSL and friends are set after 
sending the login, in both discovery and normal sessions (see below), is 
that a bug? aren't they declarative?

Or.

Discovery session param 43 value 0

scsi host11: iSCSI Initiator over iSER
iser: iscsi_iser_conn_bind: binding iscsi conn ffff880212309ca8 to 
iser_conn ffff880216838000
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 18 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 26 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 27 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 28 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 35 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 30 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 31 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 32 buf iser
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 34 buf 
iqn.1994-05.com.redhat:afa6a392a57a
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 43 buf 1
iser: iscsi_iser_mtask_xmit: mtask xmit [cid 0 itt 0x0]
iser: iser_send_control: op 43 dsl f4, posting login rx buffer
iser: iser_post_rx_bufs: req op 43 flags 87
iser: iser_post_rx_bufs: Discovery session, re-using login RX buffer
iser: iser_cq_tasklet_fn: got 1 completions
iser: iser_rcv_completion: op 0x23 itt 0x0 dlen 142
iser: iser_cq_tasklet_fn: got 1 completions
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 0 buf 8192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 
ISCSI_PARAM_MAX_RECV_DLENGTH size 8192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 1 buf 8192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 4 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 5 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 6 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 7 buf 262144
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 8 buf 16776192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 9 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 10 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 11 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 14 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 16 buf 1

Normal session param 43 value 0

iser: iscsi_iser_conn_bind: binding iscsi conn ffff8800c04394a8 to 
iser_conn ffff8800c147a000
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 15 buf 
iqn.2001-04.com.r-dcs53-tgt-2
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 17 buf 
192.168.20.18
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 18 buf 3260
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 26 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 27 buf 15
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 28 buf 30
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 35 buf 30
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 30 buf 5
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 31 buf 5
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 32 buf iser
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 34 buf 
iqn.1994-05.com.redhat:afa6a392a57a
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 43 buf 0
iser: iscsi_iser_mtask_xmit: mtask xmit [cid 0 itt 0x0]
iser: iser_send_control: op 43 dsl 1d4, posting login rx buffer
iser: iser_post_rx_bufs: req op 43 flags 87
iser: iser_post_rx_bufs: Normal session, posting batch of RX 32 buffers
iser: iser_cq_tasklet_fn: got 1 completions
iser: iser_rcv_completion: op 0x23 itt 0x0 dlen 355
iser: iser_cq_tasklet_fn: got 1 completions
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 0 buf 262144
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 
ISCSI_PARAM_MAX_RECV_DLENGTH size 262144
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 1 buf 8192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 4 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 5 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 6 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 7 buf 65536
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 8 buf 262144
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 9 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 10 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 11 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 14 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 16 buf 1

--

-- 
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe@...
To post to this group, send email to open-iscsi@...
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Or Gerlitz | 21 Jan 15:19 2015

setting declarative params after login?

Hi Mike,

Long time.. hope you are all well after EOY holidays and with energy to 
for the MCS debates  <at>  LSF...

So back in upstream commit ea05be3ff043efd44256283d968fa1bb9a371568 
"iscsi tools: set non negotiated params early" we are
doing set_param towards the kernel/transport before sending the login 
request.

Running with latest upstream (commit 
76a441ba0dc0071a19daeac456aa898889437efd) we did dump of all set_params 
done towards iser and I see that Max Recv DSL and friends are set after 
sending the login, in both discovery and normal sessions (see below), is 
that a bug? aren't they declarative?

Or.

Discovery session patam 43 value 0

scsi host11: iSCSI Initiator over iSER
iser: iscsi_iser_conn_bind: binding iscsi conn ffff880212309ca8 to 
iser_conn ffff880216838000
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 18 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 26 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 27 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 28 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 35 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 30 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 31 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 32 buf iser
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 34 buf 
iqn.1994-05.com.redhat:afa6a392a57a
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 43 buf 1
iser: iscsi_iser_mtask_xmit: mtask xmit [cid 0 itt 0x0]
iser: iser_send_control: op 43 dsl f4, posting login rx buffer
iser: iser_post_rx_bufs: req op 43 flags 87
iser: iser_post_rx_bufs: Discovery session, re-using login RX buffer
iser: iser_cq_tasklet_fn: got 1 completions
iser: iser_rcv_completion: op 0x23 itt 0x0 dlen 142
iser: iser_cq_tasklet_fn: got 1 completions
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 0 buf 8192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 
ISCSI_PARAM_MAX_RECV_DLENGTH size 8192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 1 buf 8192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 4 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 5 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 6 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 7 buf 262144
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 8 buf 16776192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 9 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 10 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 11 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 14 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 16 buf 1

Normal session patam 43 value 0
iser: iscsi_iser_conn_bind: binding iscsi conn ffff8800c04394a8 to 
iser_conn ffff8800c147a000
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 15 buf 
iqn.2001-04.com.r-dcs53-tgt-2
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 17 buf 
192.168.20.18
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 18 buf 3260
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 26 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 27 buf 15
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 28 buf 30
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 35 buf 30
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 30 buf 5
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 31 buf 5
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 32 buf iser
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 34 buf 
iqn.1994-05.com.redhat:afa6a392a57a
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 43 buf 0
iser: iscsi_iser_mtask_xmit: mtask xmit [cid 0 itt 0x0]
iser: iser_send_control: op 43 dsl 1d4, posting login rx buffer
iser: iser_post_rx_bufs: req op 43 flags 87
iser: iser_post_rx_bufs: Normal session, posting batch of RX 32 buffers
iser: iser_cq_tasklet_fn: got 1 completions
iser: iser_rcv_completion: op 0x23 itt 0x0 dlen 355
iser: iser_cq_tasklet_fn: got 1 completions
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 0 buf 262144
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 
ISCSI_PARAM_MAX_RECV_DLENGTH size 262144
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 1 buf 8192
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 4 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 5 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 6 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 7 buf 65536
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 8 buf 262144
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 9 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 10 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 11 buf 0
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 14 buf 1
iser: iscsi_iser_set_param: iscsi_iser_set_param called for 16 buf 1

--

-- 
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe@...
To post to this group, send email to open-iscsi@...
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Heinrich Schuchardt | 19 Jan 19:54 2015
Picon
Picon

[PATCH 1/1] Kernel include path

The path to the kernel include files is given by
/lib/modules/`uname -r`/build
on Debian.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@...>
---
 README | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README b/README
index 06d1b6f..ef97140 100644
--- a/README
+++ b/README
 <at>  <at>  -92,7 +92,7  <at>  <at>  by running:
 	make kernel

 When building those modules the kernel source found at
-/lib/modules/`uname -a`/build
+/lib/modules/`uname -r`/build
 will be used to compile the open-iscsi modules. To specify a different
 kernel to build against use:

-- 
2.1.4

--

-- 
You received this message because you are subscribed to the Google Groups "open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-iscsi+unsubscribe@...
To post to this group, send email to open-iscsi@...
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.


Gmane