diff options
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.patch | 60 |
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 @@ | |||
1 | From 3ef708aec9359ad6b05d8ae43663cf5e73c58e9d Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff Layton <jlayton@redhat.com> | ||
3 | Date: Mon, 2 Jul 2012 07:24:25 -0400 | ||
4 | Subject: [PATCH 42/49] cifs: when server doesn't set CAP_LARGE_READ_X, cap | ||
5 | default rsize at MaxBufferSize | ||
6 | |||
7 | commit ec01d738a1691dfc85b96b9f796020267a7be577 upstream. | ||
8 | |||
9 | When the server doesn't advertise CAP_LARGE_READ_X, then MS-CIFS states | ||
10 | that you must cap the size of the read at the client's MaxBufferSize. | ||
11 | Unfortunately, testing with many older servers shows that they often | ||
12 | can't service a read larger than their own MaxBufferSize. | ||
13 | |||
14 | Since we can't assume what the server will do in this situation, we must | ||
15 | be conservative here for the default. When the server can't do large | ||
16 | reads, then assume that it can't satisfy any read larger than its | ||
17 | MaxBufferSize either. | ||
18 | |||
19 | Luckily almost all modern servers can do large reads, so this won't | ||
20 | affect them. This is really just for older win9x and OS/2 era servers. | ||
21 | Also, note that this patch just governs the default rsize. The admin can | ||
22 | always override this if he so chooses. | ||
23 | |||
24 | Reported-by: David H. Durgee <dhdurgee@acm.org> | ||
25 | Signed-off-by: Jeff Layton <jlayton@redhat.com> | ||
26 | Signed-off-by: Steven French <sfrench@w500smf.(none)> | ||
27 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
28 | --- | ||
29 | fs/cifs/connect.c | 9 +++------ | ||
30 | 1 file changed, 3 insertions(+), 6 deletions(-) | ||
31 | |||
32 | diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c | ||
33 | index 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 | -- | ||
59 | 1.7.10 | ||
60 | |||