rpms/kernel/F-7 linux-2.6-cifs-fix-incomplete-rcv.patch, NONE, 1.1 kernel-2.6.spec, 1.3367, 1.3368

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Tue Oct 30 14:25:17 UTC 2007


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv20435

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-cifs-fix-incomplete-rcv.patch 
Log Message:
* Tue Oct 30 2007 Chuck Ebbert <cebbert at redhat.com>
- CIFS: fix reconnect when incomplete packet is received


linux-2.6-cifs-fix-incomplete-rcv.patch:

--- NEW FILE linux-2.6-cifs-fix-incomplete-rcv.patch ---

# HG changeset patch
# User Steve French <sfrench at us.ibm.com>
# Date 1188508411 0
# Node ID 28a3163b078167de5419aa942d516a23ac1e7d5b
# Parent 1742bac9b5a02269c427ff82982c6fedbc85c01e
[CIFS] fix for incorrect session reconnects

cifs reconnect could end up happening incorrectly due to
the small initial tcp recvmsg response. When the socket
was within three bytes of being full and the recvmsg
returned only 1 to 3 bytes of the initial 4 byte
read of the RFC1001 length field. Fortunately this
seems to be less common on more current kernels, but
this fixes it so cifs tries to retrieve all 4 bytes
of the initial tcp read.

Signed-off-by: Shirish Pargoankar <shirishp at us.ibm.com>
Signed-off-by: Steve French <sfrench at us.ibm.com>

committer: Steve French <sfrench at us.ibm.com>

--- a/fs/cifs/connect.c	Thu Aug 30 20:18:41 2007 +0000
+++ b/fs/cifs/connect.c	Thu Aug 30 21:13:31 2007 +0000
@@ -400,9 +400,11 @@ cifs_demultiplex_thread(struct TCP_Serve
 		iov.iov_len = 4;
 		smb_msg.msg_control = NULL;
 		smb_msg.msg_controllen = 0;
+		pdu_length = 4; /* enough to get RFC1001 header */
+incomplete_rcv:
 		length =
 		    kernel_recvmsg(csocket, &smb_msg,
-				 &iov, 1, 4, 0 /* BB see socket.h flags */);
+				&iov, 1, pdu_length, 0 /* BB other flags? */);
 
 		if ( kthread_should_stop() ) {
 			break;
@@ -437,13 +439,12 @@ cifs_demultiplex_thread(struct TCP_Serve
 			wake_up(&server->response_q);
 			continue;
 		} else if (length < 4) {
-			cFYI(1,
-			    ("Frame under four bytes received (%d bytes long)",
+			cFYI(1, ("less than four bytes received (%d bytes)",
 			      length));
+			pdu_length -= length;
 			cifs_reconnect(server);
-			csocket = server->ssocket;
-			wake_up(&server->response_q);
-			continue;
+			msleep(1);
+			goto incomplete_rcv;
 		}
 
 		/* The right amount was read from socket - 4 bytes */



Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-7/kernel-2.6.spec,v
retrieving revision 1.3367
retrieving revision 1.3368
diff -u -r1.3367 -r1.3368
--- kernel-2.6.spec	30 Oct 2007 00:21:32 -0000	1.3367
+++ kernel-2.6.spec	30 Oct 2007 14:24:41 -0000	1.3368
@@ -561,8 +561,9 @@
 Patch404: linux-2.6-scsi-mpt-vmware-fix.patch
 
 Patch420: linux-2.6-squashfs.patch
-Patch423: linux-2.6-gfs-locking-exports.patch
-Patch428: linux-2.6-cifs-fix-bad-handling-of-EAGAIN.patch
+Patch421: linux-2.6-gfs-locking-exports.patch
+Patch422: linux-2.6-cifs-fix-incomplete-rcv.patch
+Patch423: linux-2.6-cifs-fix-bad-handling-of-EAGAIN.patch
 
 Patch430: linux-2.6-net-silence-noisy-printks.patch
 
@@ -1201,6 +1202,8 @@
 # export symbols for gfs2 locking modules
 ApplyPatch linux-2.6-gfs-locking-exports.patch
 # CIFS
+# fix incomplete rcv and handling of EAGAIN
+ApplyPatch linux-2.6-cifs-fix-incomplete-rcv.patch
 ApplyPatch linux-2.6-cifs-fix-bad-handling-of-EAGAIN.patch
 
 # Networking
@@ -2248,6 +2251,9 @@
 %endif
 
 %changelog
+* Tue Oct 30 2007 Chuck Ebbert <cebbert at redhat.com>
+- CIFS: fix reconnect when incomplete packet is received
+
 * Mon Oct 29 2007 Chuck Ebbert <cebbert at redhat.com>
 - Fix oops for some x86_64 systems with AGP (#249174, #336281)
 - Properly synchronize IRQs




More information about the fedora-extras-commits mailing list