From 69c20b02bc84161fb527ea23a7c61818f48a0088 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sun, 30 Oct 2011 05:39:38 -0700 Subject: [PATCH] 3.1 patches --- ...x-dfs-handling-in-cifs_get_file_info.patch | 61 +++++++++++++++++++ ...correct-max-rfc1002-write-size-value.patch | 35 +++++++++++ queue-3.1/series | 2 + 3 files changed, 98 insertions(+) create mode 100644 queue-3.1/cifs-fix-dfs-handling-in-cifs_get_file_info.patch create mode 100644 queue-3.1/cifs-fix-incorrect-max-rfc1002-write-size-value.patch create mode 100644 queue-3.1/series diff --git a/queue-3.1/cifs-fix-dfs-handling-in-cifs_get_file_info.patch b/queue-3.1/cifs-fix-dfs-handling-in-cifs_get_file_info.patch new file mode 100644 index 00000000000..f7402f8a17c --- /dev/null +++ b/queue-3.1/cifs-fix-dfs-handling-in-cifs_get_file_info.patch @@ -0,0 +1,61 @@ +From 42274bb22afc3e877ae5abed787b0b09d7dede52 Mon Sep 17 00:00:00 2001 +From: Pavel Shilovsky +Date: Sat, 22 Oct 2011 14:37:50 +0400 +Subject: CIFS: Fix DFS handling in cifs_get_file_info + +From: Pavel Shilovsky + +commit 42274bb22afc3e877ae5abed787b0b09d7dede52 upstream. + +We should call cifs_all_info_to_fattr in rc == 0 case only. + +Signed-off-by: Pavel Shilovsky +Reviewed-by: Jeff Layton +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/inode.c | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +--- a/fs/cifs/inode.c ++++ b/fs/cifs/inode.c +@@ -562,7 +562,16 @@ int cifs_get_file_info(struct file *filp + + xid = GetXid(); + rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data); +- if (rc == -EOPNOTSUPP || rc == -EINVAL) { ++ switch (rc) { ++ case 0: ++ cifs_all_info_to_fattr(&fattr, &find_data, cifs_sb, false); ++ break; ++ case -EREMOTE: ++ cifs_create_dfs_fattr(&fattr, inode->i_sb); ++ rc = 0; ++ break; ++ case -EOPNOTSUPP: ++ case -EINVAL: + /* + * FIXME: legacy server -- fall back to path-based call? + * for now, just skip revalidating and mark inode for +@@ -570,18 +579,14 @@ int cifs_get_file_info(struct file *filp + */ + rc = 0; + CIFS_I(inode)->time = 0; ++ default: + goto cgfi_exit; +- } else if (rc == -EREMOTE) { +- cifs_create_dfs_fattr(&fattr, inode->i_sb); +- rc = 0; +- } else if (rc) +- goto cgfi_exit; ++ } + + /* + * don't bother with SFU junk here -- just mark inode as needing + * revalidation. + */ +- cifs_all_info_to_fattr(&fattr, &find_data, cifs_sb, false); + fattr.cf_uniqueid = CIFS_I(inode)->uniqueid; + fattr.cf_flags |= CIFS_FATTR_NEED_REVAL; + cifs_fattr_to_inode(inode, &fattr); diff --git a/queue-3.1/cifs-fix-incorrect-max-rfc1002-write-size-value.patch b/queue-3.1/cifs-fix-incorrect-max-rfc1002-write-size-value.patch new file mode 100644 index 00000000000..cecb218630a --- /dev/null +++ b/queue-3.1/cifs-fix-incorrect-max-rfc1002-write-size-value.patch @@ -0,0 +1,35 @@ +From 94443f43404239c2a6dc4252a7cb9e77f5b1eb6e Mon Sep 17 00:00:00 2001 +From: Pavel Shilovsky +Date: Fri, 7 Oct 2011 18:57:45 +0400 +Subject: CIFS: Fix incorrect max RFC1002 write size value + +From: Pavel Shilovsky + +commit 94443f43404239c2a6dc4252a7cb9e77f5b1eb6e upstream. + +..the length field has only 17 bits. + +Acked-by: Jeff Layton +Signed-off-by: Pavel Shilovsky +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/connect.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -2807,10 +2807,10 @@ void cifs_setup_cifs_sb(struct smb_vol * + + /* + * When the server doesn't allow large posix writes, only allow a wsize of +- * 128k minus the size of the WRITE_AND_X header. That allows for a write up ++ * 2^17-1 minus the size of the WRITE_AND_X header. That allows for a write up + * to the maximum size described by RFC1002. + */ +-#define CIFS_MAX_RFC1002_WSIZE (128 * 1024 - sizeof(WRITE_REQ) + 4) ++#define CIFS_MAX_RFC1002_WSIZE ((1<<17) - 1 - sizeof(WRITE_REQ) + 4) + + /* + * The default wsize is 1M. find_get_pages seems to return a maximum of 256 diff --git a/queue-3.1/series b/queue-3.1/series new file mode 100644 index 00000000000..0ad14608b9b --- /dev/null +++ b/queue-3.1/series @@ -0,0 +1,2 @@ +cifs-fix-incorrect-max-rfc1002-write-size-value.patch +cifs-fix-dfs-handling-in-cifs_get_file_info.patch -- 2.47.3