]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: consolidate SendReceive response checks
authorJeff Layton <jlayton@redhat.com>
Thu, 19 May 2011 20:22:52 +0000 (16:22 -0400)
committerSteve French <sfrench@us.ibm.com>
Mon, 23 May 2011 02:58:24 +0000 (02:58 +0000)
commit19817c2891e9584a37edf0a462b600b075c3366a
tree8150cda7231acf1afc073b2eaaed0947d1937e16
parent603e5eb50430305a79cbd4c307b89e67c2b4befa
cifs: consolidate SendReceive response checks

Further consolidate the SendReceive code by moving the checks run over
the packet into a separate function that all the SendReceive variants
can call.

We can also eliminate the check for a receive_len that's too big or too
small. cifs_demultiplex_thread already checks that and disconnects the
socket if that occurs, while setting the midStatus to MALFORMED. It'll
never call this code if that's the case.

Finally do a little cleanup. Use "goto out" on errors so that the flow
of code in the normal case is more evident. Also switch the logErr
variable in map_smb_to_linux_error to a bool.

Reviewed-by: Pavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifsproto.h
fs/cifs/netmisc.c
fs/cifs/transport.c