diff options
author | Jeff Layton <jlayton@redhat.com> | 2011-02-10 08:03:50 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-02-11 03:59:12 +0000 |
commit | 71823baff1978be892e7a36eddf6170e1cc6650d (patch) | |
tree | 2cc136ce754cc5c24ed8aefde5e486fc873ae139 /fs/cifs/transport.c | |
parent | 195291e68c2ad59a046fc56d32bf59635b100e5c (diff) | |
download | lwn-71823baff1978be892e7a36eddf6170e1cc6650d.tar.gz lwn-71823baff1978be892e7a36eddf6170e1cc6650d.zip |
cifs: don't always drop malformed replies on the floor (try #3)
Slight revision to this patch...use min_t() instead of conditional
assignment. Also, remove the FIXME comment and replace it with the
explanation that Steve gave earlier.
After receiving a packet, we currently check the header. If it's no
good, then we toss it out and continue the loop, leaving the caller
waiting on that response.
In cases where the packet has length inconsistencies, but the MID is
valid, this leads to unneeded delays. That's especially problematic now
that the client waits indefinitely for responses.
Instead, don't immediately discard the packet if checkSMB fails. Try to
find a matching mid_q_entry, mark it as having a malformed response and
issue the callback.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/transport.c')
-rw-r--r-- | fs/cifs/transport.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index fbc5aace54b1..46d8756f2b24 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -457,6 +457,9 @@ sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) case MID_RETRY_NEEDED: rc = -EAGAIN; break; + case MID_RESPONSE_MALFORMED: + rc = -EIO; + break; default: cERROR(1, "%s: invalid mid state mid=%d state=%d", __func__, mid->mid, mid->midState); |