diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-cifs-lower-default-wsize-when-unix-extensions-are-no.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-cifs-lower-default-wsize-when-unix-extensions-are-no.patch | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-cifs-lower-default-wsize-when-unix-extensions-are-no.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-cifs-lower-default-wsize-when-unix-extensions-are-no.patch new file mode 100644 index 00000000..cd300c61 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-cifs-lower-default-wsize-when-unix-extensions-are-no.patch | |||
@@ -0,0 +1,67 @@ | |||
1 | From c851c03d3c252029f2d0a4b96439fb2e7baf0071 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jeff Layton <jlayton@redhat.com> | ||
3 | Date: Tue, 17 Jan 2012 16:08:51 -0500 | ||
4 | Subject: [PATCH 122/130] cifs: lower default wsize when unix extensions are | ||
5 | not used | ||
6 | |||
7 | commit ce91acb3acae26f4163c5a6f1f695d1a1e8d9009 upstream. | ||
8 | |||
9 | We've had some reports of servers (namely, the Solaris in-kernel CIFS | ||
10 | server) that don't deal properly with writes that are "too large" even | ||
11 | though they set CAP_LARGE_WRITE_ANDX. Change the default to better | ||
12 | mirror what windows clients do. | ||
13 | |||
14 | Cc: Pavel Shilovsky <piastry@etersoft.ru> | ||
15 | Reported-by: Nick Davis <phireph0x@yahoo.com> | ||
16 | Signed-off-by: Jeff Layton <jlayton@redhat.com> | ||
17 | Signed-off-by: Steve French <smfrench@gmail.com> | ||
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | ||
19 | --- | ||
20 | fs/cifs/connect.c | 23 +++++++++++++++++++---- | ||
21 | 1 files changed, 19 insertions(+), 4 deletions(-) | ||
22 | |||
23 | diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c | ||
24 | index f3670cf..63e4be4 100644 | ||
25 | --- a/fs/cifs/connect.c | ||
26 | +++ b/fs/cifs/connect.c | ||
27 | @@ -2914,18 +2914,33 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, | ||
28 | #define CIFS_DEFAULT_IOSIZE (1024 * 1024) | ||
29 | |||
30 | /* | ||
31 | - * Windows only supports a max of 60k reads. Default to that when posix | ||
32 | - * extensions aren't in force. | ||
33 | + * Windows only supports a max of 60kb reads and 65535 byte writes. Default to | ||
34 | + * those values when posix extensions aren't in force. In actuality here, we | ||
35 | + * use 65536 to allow for a write that is a multiple of 4k. Most servers seem | ||
36 | + * to be ok with the extra byte even though Windows doesn't send writes that | ||
37 | + * are that large. | ||
38 | + * | ||
39 | + * Citation: | ||
40 | + * | ||
41 | + * http://blogs.msdn.com/b/openspecification/archive/2009/04/10/smb-maximum-transmit-buffer-size-and-performance-tuning.aspx | ||
42 | */ | ||
43 | #define CIFS_DEFAULT_NON_POSIX_RSIZE (60 * 1024) | ||
44 | +#define CIFS_DEFAULT_NON_POSIX_WSIZE (65536) | ||
45 | |||
46 | static unsigned int | ||
47 | cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) | ||
48 | { | ||
49 | __u64 unix_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); | ||
50 | struct TCP_Server_Info *server = tcon->ses->server; | ||
51 | - unsigned int wsize = pvolume_info->wsize ? pvolume_info->wsize : | ||
52 | - CIFS_DEFAULT_IOSIZE; | ||
53 | + unsigned int wsize; | ||
54 | + | ||
55 | + /* start with specified wsize, or default */ | ||
56 | + if (pvolume_info->wsize) | ||
57 | + wsize = pvolume_info->wsize; | ||
58 | + else if (tcon->unix_ext && (unix_cap & CIFS_UNIX_LARGE_WRITE_CAP)) | ||
59 | + wsize = CIFS_DEFAULT_IOSIZE; | ||
60 | + else | ||
61 | + wsize = CIFS_DEFAULT_NON_POSIX_WSIZE; | ||
62 | |||
63 | /* can server support 24-bit write sizes? (via UNIX extensions) */ | ||
64 | if (!tcon->unix_ext || !(unix_cap & CIFS_UNIX_LARGE_WRITE_CAP)) | ||
65 | -- | ||
66 | 1.7.7.4 | ||
67 | |||