From: Steve French Date: Fri, 21 Nov 2008 07:28:52 +0000 (+0530) Subject: cifs: Fix error in smb_send2 X-Git-Tag: v2.6.27.8~47 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a996495680c25e646ffb65ab0a660f49e4155737;p=karo-tx-linux.git cifs: Fix error in smb_send2 Backport of upstream commit 61de800d33af585cb7e6f27b5cdd51029c6855cb for -stable. [CIFS] fix error in smb_send2 smb_send2 exit logic was strange, and with the previous change could cause us to fail large smb writes when all of the smb was not sent as one chunk. Acked-by: Jeff Layton Signed-off-by: Steve French Cc: Suresh Jayaraman Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 77a0d1fa27d0..97c98c7679bd 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -1534,7 +1534,7 @@ CIFSSMBWrite(const int xid, struct cifsTconInfo *tcon, __u32 bytes_sent; __u16 byte_count; - /* cFYI(1,("write at %lld %d bytes",offset,count));*/ + /* cFYI(1, ("write at %lld %d bytes",offset,count));*/ if (tcon->ses == NULL) return -ECONNABORTED; diff --git a/fs/cifs/file.c b/fs/cifs/file.c index cbefe1f1f9fe..46d59341256e 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -1813,7 +1813,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping, pTcon = cifs_sb->tcon; pagevec_init(&lru_pvec, 0); - cFYI(DBG2, ("rpages: num pages %d", num_pages)); + cFYI(DBG2, ("rpages: num pages %d", num_pages)); for (i = 0; i < num_pages; ) { unsigned contig_pages; struct page *tmp_page; diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index e4ccd9fdad8c..bb0f32960a7c 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -291,8 +291,11 @@ smb_send2(struct TCP_Server_Info *server, struct kvec *iov, int n_vec, if (rc < 0) break; - if (rc >= total_len) { - WARN_ON(rc > total_len); + if (rc == total_len) { + total_len = 0; + break; + } else if (rc > total_len) { + cERROR(1, ("sent %d requested %d", rc, total_len)); break; } if (rc == 0) {