summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0042-cifs-when-server-doesn-t-set-CAP_LARGE_READ_X-cap-de.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0042-cifs-when-server-doesn-t-set-CAP_LARGE_READ_X-cap-de.patch')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0042-cifs-when-server-doesn-t-set-CAP_LARGE_READ_X-cap-de.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0042-cifs-when-server-doesn-t-set-CAP_LARGE_READ_X-cap-de.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0042-cifs-when-server-doesn-t-set-CAP_LARGE_READ_X-cap-de.patch
new file mode 100644
index 00000000..435c9cb3
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.23/0042-cifs-when-server-doesn-t-set-CAP_LARGE_READ_X-cap-de.patch
@@ -0,0 +1,60 @@
1From 3ef708aec9359ad6b05d8ae43663cf5e73c58e9d Mon Sep 17 00:00:00 2001
2From: Jeff Layton <jlayton@redhat.com>
3Date: Mon, 2 Jul 2012 07:24:25 -0400
4Subject: [PATCH 42/49] cifs: when server doesn't set CAP_LARGE_READ_X, cap
5 default rsize at MaxBufferSize
6
7commit ec01d738a1691dfc85b96b9f796020267a7be577 upstream.
8
9When the server doesn't advertise CAP_LARGE_READ_X, then MS-CIFS states
10that you must cap the size of the read at the client's MaxBufferSize.
11Unfortunately, testing with many older servers shows that they often
12can't service a read larger than their own MaxBufferSize.
13
14Since we can't assume what the server will do in this situation, we must
15be conservative here for the default. When the server can't do large
16reads, then assume that it can't satisfy any read larger than its
17MaxBufferSize either.
18
19Luckily almost all modern servers can do large reads, so this won't
20affect them. This is really just for older win9x and OS/2 era servers.
21Also, note that this patch just governs the default rsize. The admin can
22always override this if he so chooses.
23
24Reported-by: David H. Durgee <dhdurgee@acm.org>
25Signed-off-by: Jeff Layton <jlayton@redhat.com>
26Signed-off-by: Steven French <sfrench@w500smf.(none)>
27Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
28---
29 fs/cifs/connect.c | 9 +++------
30 1 file changed, 3 insertions(+), 6 deletions(-)
31
32diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
33index 9e0675a..b21670c 100644
34--- a/fs/cifs/connect.c
35+++ b/fs/cifs/connect.c
36@@ -2975,18 +2975,15 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info)
37 * MS-CIFS indicates that servers are only limited by the client's
38 * bufsize for reads, testing against win98se shows that it throws
39 * INVALID_PARAMETER errors if you try to request too large a read.
40+ * OS/2 just sends back short reads.
41 *
42- * If the server advertises a MaxBufferSize of less than one page,
43- * assume that it also can't satisfy reads larger than that either.
44- *
45- * FIXME: Is there a better heuristic for this?
46+ * If the server doesn't advertise CAP_LARGE_READ_X, then assume that
47+ * it can't handle a read request larger than its MaxBufferSize either.
48 */
49 if (tcon->unix_ext && (unix_cap & CIFS_UNIX_LARGE_READ_CAP))
50 defsize = CIFS_DEFAULT_IOSIZE;
51 else if (server->capabilities & CAP_LARGE_READ_X)
52 defsize = CIFS_DEFAULT_NON_POSIX_RSIZE;
53- else if (server->maxBuf >= PAGE_CACHE_SIZE)
54- defsize = CIFSMaxBufSize;
55 else
56 defsize = server->maxBuf - sizeof(READ_RSP);
57
58--
591.7.10
60