summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2008-10-30 20:15:22 +0000
committerSteve French <sfrench@us.ibm.com>2008-10-30 20:15:22 +0000
commit61de800d33af585cb7e6f27b5cdd51029c6855cb (patch)
tree3b16b4cca031c646a30a55218adfed6e0c59332e /fs
parentedf1ae403896cb7750800508b14996ba6be39a53 (diff)
downloadlinux-3.10-61de800d33af585cb7e6f27b5cdd51029c6855cb.tar.gz
linux-3.10-61de800d33af585cb7e6f27b5cdd51029c6855cb.tar.bz2
linux-3.10-61de800d33af585cb7e6f27b5cdd51029c6855cb.zip
[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 <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifssmb.c2
-rw-r--r--fs/cifs/file.c2
-rw-r--r--fs/cifs/transport.c7
3 files changed, 7 insertions, 4 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 843a85fb8b9..d5eac48fc41 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1536,7 +1536,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 62d8bd8f14c..ead1a3bb025 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1824,7 +1824,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 ba4d66644eb..ff8243a8fe3 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -290,8 +290,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) {