aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <smfltc@us.ibm.com>2006-02-22 18:31:52 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-22 18:20:33 -0500
commit6cec2aed8686840906f6298391dc4fd04d9ba843 (patch)
treea6ae4784522a03c5b8eb6041ef0da5e8c81b14dc /fs
parentc45ec6566021ba3162233b575e7bc76d57b86688 (diff)
[PATCH] CIFS: CIFSSMBRead was returning an invalid pointer in buf on socket error
Thanks to Adrian Bunk for debugging the problem and to Shaggy for helping find the solution. Also added a fix for 64K pages we found in loosely-related testing Signed-off-by: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifssmb.c7
-rw-r--r--fs/cifs/connect.c8
2 files changed, 8 insertions, 7 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 217323b0c896..b41e8b379652 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1048,13 +1048,14 @@ CIFSSMBRead(const int xid, struct cifsTconInfo *tcon,
1048 cifs_small_buf_release(iov[0].iov_base); 1048 cifs_small_buf_release(iov[0].iov_base);
1049 else if(resp_buf_type == CIFS_LARGE_BUFFER) 1049 else if(resp_buf_type == CIFS_LARGE_BUFFER)
1050 cifs_buf_release(iov[0].iov_base); 1050 cifs_buf_release(iov[0].iov_base);
1051 } else /* return buffer to caller to free */ /* BB FIXME how do we tell caller if it is not a large buffer */ { 1051 } else if(resp_buf_type != CIFS_NO_BUFFER) {
1052 *buf = iov[0].iov_base; 1052 /* return buffer to caller to free */
1053 *buf = iov[0].iov_base;
1053 if(resp_buf_type == CIFS_SMALL_BUFFER) 1054 if(resp_buf_type == CIFS_SMALL_BUFFER)
1054 *pbuf_type = CIFS_SMALL_BUFFER; 1055 *pbuf_type = CIFS_SMALL_BUFFER;
1055 else if(resp_buf_type == CIFS_LARGE_BUFFER) 1056 else if(resp_buf_type == CIFS_LARGE_BUFFER)
1056 *pbuf_type = CIFS_LARGE_BUFFER; 1057 *pbuf_type = CIFS_LARGE_BUFFER;
1057 } 1058 } /* else no valid buffer on return - leave as null */
1058 1059
1059 /* Note: On -EAGAIN error only caller can retry on handle based calls 1060 /* Note: On -EAGAIN error only caller can retry on handle based calls
1060 since file handle passed in no longer valid */ 1061 since file handle passed in no longer valid */
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e488603fb1e7..ef5ae6f93c75 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1795,10 +1795,10 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
1795 conjunction with 52K kvec constraint on arch with 4K 1795 conjunction with 52K kvec constraint on arch with 4K
1796 page size */ 1796 page size */
1797 1797
1798 if(cifs_sb->rsize < PAGE_CACHE_SIZE) { 1798 if(cifs_sb->rsize < 2048) {
1799 cifs_sb->rsize = PAGE_CACHE_SIZE; 1799 cifs_sb->rsize = 2048;
1800 /* Windows ME does this */ 1800 /* Windows ME may prefer this */
1801 cFYI(1,("Attempt to set readsize for mount to less than one page (4096)")); 1801 cFYI(1,("readsize set to minimum 2048"));
1802 } 1802 }
1803 cifs_sb->mnt_uid = volume_info.linux_uid; 1803 cifs_sb->mnt_uid = volume_info.linux_uid;
1804 cifs_sb->mnt_gid = volume_info.linux_gid; 1804 cifs_sb->mnt_gid = volume_info.linux_gid;