From: Jeff Layton <jlayton@redhat.com>
To: Petr Tesarik <ptesarik@suse.cz>
Cc: linux-cifs-client@lists.samba.org,
Steve French <smfrench@gmail.com>,
linux-kernel@vger.kernel.org
Subject: Re: [linux-cifs-client] [CIFS] still incorrect cifs_reconnect fix?
Date: Mon, 19 Nov 2007 06:42:05 -0500 [thread overview]
Message-ID: <20071119064205.419e0758@tleilax.poochiereds.net> (raw)
In-Reply-To: <1195464645.29063.12.camel@elijah.suse.cz>
On Mon, 19 Nov 2007 10:30:45 +0100
Petr Tesarik <ptesarik@suse.cz> wrote:
> 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?
>
I think you're right that the logic there is wrong, but I don't see an
infinite loop happening. It looks like in this situation, that the next
call to kernel_recvmsg will be called a size of 0, which should
eventually return 0. It'll then fall into the previous condition -- do
a reconnect and then go around the big loop again.
A patch to clean that up would probably be a good thing. We likely
don't need to do a reconnect here.
--
Jeff Layton <jlayton@redhat.com>
next prev parent reply other threads:[~2007-11-19 11:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 9:30 Petr Tesarik
2007-11-19 11:42 ` Jeff Layton [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071119064205.419e0758@tleilax.poochiereds.net \
--to=jlayton@redhat.com \
--cc=linux-cifs-client@lists.samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ptesarik@suse.cz \
--cc=smfrench@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®