-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Here is the patch, rebased against 1.4.20.2-11

Cheers

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBXRdEACgkQ8dLMyEl6F20q4wCgll9G1Vcrgc8254LumI2gk722
CPYAnRvQEQBcyC57x7yZH5zhHG4QEgE1
=wrJx
-----END PGP SIGNATURE-----
diff --git a/debian/changelog b/debian/changelog
index d79aab8..b581cfc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,17 @@
-iscsitarget (1.4.20.2-11) experimental; urgency=low
+iscsitarget (1.4.20.2-11) UNRELEASED; urgency=low
 
+  [ Ritesh Raj Sarraf ]
   * [6dfdd7c] Add iscsitarget-dkms to Recommends and drop iscsitarget-module
   * [281b4a4] Update README.Debian explaining the new DKMS package.
     Thanks to Olaf van der Spek (Closes: #668382)
   * [a0d484c] Drop patch fix-build-3-2.patch
   * [afdf1df] Add patches from 1.4.20 stable branch (Closes: #685422)
 
- -- Ritesh Raj Sarraf <r...@debian.org>  Sat, 15 Sep 2012 12:55:24 +0530
+  [ Loic Dachary (OuoU) ]
+
+  * Fixes ietadm not detecting inactive sessions (Closes: #687925).
+  
+ -- 
 
 iscsitarget (1.4.20.2-10) unstable; urgency=low
 
diff --git a/debian/patches/inactive-sessions.patch b/debian/patches/inactive-sessions.patch
new file mode 100644
index 0000000..839f762
--- /dev/null
+++ b/debian/patches/inactive-sessions.patch
@@ -0,0 +1,83 @@
+Description: ietadm not detecting inactive sessions
+ Once 1.4.20.3 is released, this patch can be dropped, it is commited at
+ http://iscsitarget.svn.sourceforge.net/viewvc/iscsitarget?revision=478&view=revision
+ .
+ Fix retrieval of ietd pid from netlink
+ .
+ The ietd pid was retrieved from the credentials in the netlink skb
+ which happened to work with kernels < 3.2. These days the credentials
+ are not sent by default anymore (and ietd doesn't fill them in) so
+ the pid needs to be determined from the netlink_skb_parms.
+ .
+ This fixes a bug reported by Clay Gerrard ("Can't delete target after
+ initiator logs out", caused by the session removal event not making it
+ to ietd).
+ .
+Author: Arne Redlich <arne.redl...@googlemail.com>
+Reviewed-by: Loic Dachary <l...@debian.org>
+Last-Update: 2012-09-17
+Applied-Upstream: http://iscsitarget.svn.sourceforge.net/viewvc/iscsitarget?revision=478&view=revision
+Bug-Debian: http://bugs.debian.org/687925
+Bug-Ubuntu: https://launchpad.net/bugs/967984
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+--- trunk/kernel/event.c	2012/04/03 18:19:28	477
++++ trunk/kernel/event.c	2012/04/06 21:58:31	478
+@@ -14,24 +14,8 @@
+ static struct sock *nl;
+ static u32 ietd_pid;
+ 
+-static int event_recv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
+-{
+-	u32 uid, pid, seq;
+-	char *data;
+-
+-	pid  = NETLINK_CREDS(skb)->pid;
+-	uid  = NETLINK_CREDS(skb)->uid;
+-	seq  = nlh->nlmsg_seq;
+-	data = NLMSG_DATA(nlh);
+-
+-	ietd_pid = pid;
+-
+-	return 0;
+-}
+-
+ static void event_recv_skb(struct sk_buff *skb)
+ {
+-	int err;
+ 	struct nlmsghdr	*nlh;
+ 	u32 rlen;
+ 
+@@ -42,9 +26,9 @@
+ 		rlen = NLMSG_ALIGN(nlh->nlmsg_len);
+ 		if (rlen > skb->len)
+ 			rlen = skb->len;
+-		if ((err = event_recv_msg(skb, nlh))) {
+-			netlink_ack(skb, nlh, -err);
+-		} else if (nlh->nlmsg_flags & NLM_F_ACK)
++		ietd_pid = NETLINK_CB(skb).pid;
++		WARN_ON(ietd_pid == 0);
++		if (nlh->nlmsg_flags & NLM_F_ACK)
+ 			netlink_ack(skb, nlh, 0);
+ 		skb_pull(skb, rlen);
+ 	}
+@@ -59,6 +43,7 @@
+ 	if (!(skb = alloc_skb(NLMSG_SPACE(len), gfp_mask)))
+ 		return -ENOMEM;
+ 
++	WARN_ON(ietd_pid == 0);
+ 	nlh = __nlmsg_put(skb, ietd_pid, seq++, NLMSG_DONE, len - sizeof(*nlh), 0);
+ 
+ 	memcpy(NLMSG_DATA(nlh), data, len);
diff --git a/debian/patches/series b/debian/patches/series
index f267d0c..8f7e56c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ iscsitarget-prelim-1.4.20.3.patch
 0001-Makefile-changes-to-support-3.x-kernels.patch
 0002-Fix-send_data_rsp-to-handle-sense-data-correctly.patch
 0003-Compile-fix-for-kernels-3.1-and-3.2.patch
+inactive-sessions.patch

Attachment: 687925.patch.sig
Description: PGP signature

<<attachment: loic.vcf>>

Reply via email to