mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [CIFS] still incorrect cifs_reconnect fix?
@ 2007-11-19  9:30 Petr Tesarik
  2007-11-19 11:42 ` [linux-cifs-client] " Jeff Layton
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Tesarik @ 2007-11-19  9:30 UTC (permalink / raw)
  To: linux-cifs-client; +Cc: Steve French, linux-kernel

Hi,

while merging commits f01d5e14e764b14b6bf5512678523d009254b209 and
638b250766272fcaaa0f7ed2776f58f4ac701914 into SLES10, I've noticed that
there's apparently a bug. The code currently looks like this:

		pdu_length = 4; /* enough to get RFC1001 header */
incomplete_rcv:
		length =
		    kernel_recvmsg(csocket, &smb_msg,
				&iov, 1, pdu_length, 0 /* BB other flags? */);

/* ... some irrelevant code left out ... */

		} else if (length < 4) {	/* <----- HERE IS THE PROBLEM
			cFYI(1, ("less than four bytes received (%d bytes)",
			      length));
			pdu_length -= length;
			msleep(1);
			goto incomplete_rcv;
		}

I think we should be checking for length < pdu_length, not for length <
4, because if we read 2 bytes in the first run and 2 bytes in the second
un, CIFS will still treat the second run as incomplete (and possibly run
in an infinite loop). Am I missing something obvious?

Kind regards,
Petr Tesarik


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-20  2:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-19  9:30 [CIFS] still incorrect cifs_reconnect fix? Petr Tesarik
2007-11-19 11:42 ` [linux-cifs-client] " Jeff Layton
2007-11-19 13:23   ` [linux-cifs-client] [PATCH] get rid of spurious session reconnects Petr Tesarik
2007-11-19 14:47     ` Jeff Layton
2007-11-20  2:26       ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®