]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Feb 2014 21:25:21 +0000 (13:25 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Feb 2014 21:25:21 +0000 (13:25 -0800)
added patches:
add-protocol-specific-operation-for-cifs-xattrs.patch
cifs-fix-smb2-mounts-so-they-don-t-try-to-set-or-get-xattrs-via-cifs.patch
fs-file.c-fdtable-avoid-triggering-ooms-from-alloc_fdmem.patch
mm-memory-failure.c-move-refcount-only-in-mf_count_increased.patch
retrieving-cifs-acls-when-mounted-with-smb2-fails-dropping-session.patch

queue-3.10/add-protocol-specific-operation-for-cifs-xattrs.patch [new file with mode: 0644]
queue-3.10/cifs-fix-smb2-mounts-so-they-don-t-try-to-set-or-get-xattrs-via-cifs.patch [new file with mode: 0644]
queue-3.10/fs-file.c-fdtable-avoid-triggering-ooms-from-alloc_fdmem.patch [new file with mode: 0644]
queue-3.10/mm-memory-failure.c-move-refcount-only-in-mf_count_increased.patch [new file with mode: 0644]
queue-3.10/retrieving-cifs-acls-when-mounted-with-smb2-fails-dropping-session.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/add-protocol-specific-operation-for-cifs-xattrs.patch b/queue-3.10/add-protocol-specific-operation-for-cifs-xattrs.patch
new file mode 100644 (file)
index 0000000..049fbc2
--- /dev/null
@@ -0,0 +1,67 @@
+From d979f3b0a1f0b5499ab85e68cdf02b56852918b6 Mon Sep 17 00:00:00 2001
+From: Steve French <smfrench@gmail.com>
+Date: Sat, 1 Feb 2014 23:27:18 -0600
+Subject: Add protocol specific operation for CIFS xattrs
+
+From: Steve French <smfrench@gmail.com>
+
+commit d979f3b0a1f0b5499ab85e68cdf02b56852918b6 upstream.
+
+Changeset 666753c3ef8fc88b0ddd5be4865d0aa66428ac35 added protocol
+operations for get/setxattr to avoid calling cifs operations
+on smb2/smb3 mounts for xattr operations and this changeset
+adds the calls to cifs specific protocol operations for xattrs
+(in order to reenable cifs support for xattrs which was
+temporarily disabled by the previous changeset.  We do not
+have SMB2/SMB3 worker function for setting xattrs yet so
+this only enables it for cifs.
+
+CCing stable since without these two small changsets (its
+small coreq 666753c3ef8fc88b0ddd5be4865d0aa66428ac35 is
+also needed) calling getfattr/setfattr on smb2/smb3 mounts
+causes problems.
+
+Signed-off-by: Steve French <smfrench@gmail.com>
+Reviewed-by: Shirish Pargaonkar <spargaonkar@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/cifs/inode.c   |   13 +++++++++----
+ fs/cifs/smb1ops.c |    4 ++++
+ 2 files changed, 13 insertions(+), 4 deletions(-)
+
+--- a/fs/cifs/inode.c
++++ b/fs/cifs/inode.c
+@@ -490,10 +490,15 @@ static int cifs_sfu_mode(struct cifs_fat
+               return PTR_ERR(tlink);
+       tcon = tlink_tcon(tlink);
+-      rc = CIFSSMBQAllEAs(xid, tcon, path, "SETFILEBITS",
+-                          ea_value, 4 /* size of buf */, cifs_sb->local_nls,
+-                          cifs_sb->mnt_cifs_flags &
+-                              CIFS_MOUNT_MAP_SPECIAL_CHR);
++      if (tcon->ses->server->ops->query_all_EAs == NULL) {
++              cifs_put_tlink(tlink);
++              return -EOPNOTSUPP;
++      }
++
++      rc = tcon->ses->server->ops->query_all_EAs(xid, tcon, path,
++                      "SETFILEBITS", ea_value, 4 /* size of buf */,
++                      cifs_sb->local_nls,
++                      cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
+       cifs_put_tlink(tlink);
+       if (rc < 0)
+               return (int)rc;
+--- a/fs/cifs/smb1ops.c
++++ b/fs/cifs/smb1ops.c
+@@ -948,6 +948,10 @@ struct smb_version_operations smb1_opera
+       .mand_lock = cifs_mand_lock,
+       .mand_unlock_range = cifs_unlock_range,
+       .push_mand_locks = cifs_push_mandatory_locks,
++#ifdef CONFIG_CIFS_XATTR
++      .query_all_EAs = CIFSSMBQAllEAs,
++      .set_EA = CIFSSMBSetEA,
++#endif /* CIFS_XATTR */
+ };
+ struct smb_version_values smb1_values = {
diff --git a/queue-3.10/cifs-fix-smb2-mounts-so-they-don-t-try-to-set-or-get-xattrs-via-cifs.patch b/queue-3.10/cifs-fix-smb2-mounts-so-they-don-t-try-to-set-or-get-xattrs-via-cifs.patch
new file mode 100644 (file)
index 0000000..78f7fbc
--- /dev/null
@@ -0,0 +1,130 @@
+From 666753c3ef8fc88b0ddd5be4865d0aa66428ac35 Mon Sep 17 00:00:00 2001
+From: Steve French <smfrench@gmail.com>
+Date: Sun, 26 Jan 2014 23:53:43 -0600
+Subject: CIFS: Fix SMB2 mounts so they don't try to set or get xattrs via cifs
+
+From: Steve French <smfrench@gmail.com>
+
+commit 666753c3ef8fc88b0ddd5be4865d0aa66428ac35 upstream.
+
+When mounting with smb2 (or smb2.1 or smb3) we need to check to make
+sure that attempts to query or set extended attributes do not
+attempt to send the request with the older cifs protocol instead
+(eventually we also need to add the support in SMB2
+to query/set extended attributes but this patch prevents us from
+using the wrong protocol for extended attribute operations).
+
+Signed-off-by: Steve French <smfrench@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/cifs/cifsglob.h |    6 ++++++
+ fs/cifs/xattr.c    |   49 ++++++++++++++++++++++++++++++-------------------
+ 2 files changed, 36 insertions(+), 19 deletions(-)
+
+--- a/fs/cifs/cifsglob.h
++++ b/fs/cifs/cifsglob.h
+@@ -370,6 +370,12 @@ struct smb_version_operations {
+       void (*new_lease_key)(struct cifs_fid *fid);
+       int (*calc_signature)(struct smb_rqst *rqst,
+                                  struct TCP_Server_Info *server);
++      ssize_t (*query_all_EAs)(const unsigned int, struct cifs_tcon *,
++                      const unsigned char *, const unsigned char *, char *,
++                      size_t, const struct nls_table *, int);
++      int (*set_EA)(const unsigned int, struct cifs_tcon *, const char *,
++                      const char *, const void *, const __u16,
++                      const struct nls_table *, int);
+ };
+ struct smb_version_values {
+--- a/fs/cifs/xattr.c
++++ b/fs/cifs/xattr.c
+@@ -82,9 +82,11 @@ int cifs_removexattr(struct dentry *dire
+                       goto remove_ea_exit;
+               ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
+-              rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, NULL,
+-                      (__u16)0, cifs_sb->local_nls,
+-                      cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
++              if (pTcon->ses->server->ops->set_EA)
++                      rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
++                              full_path, ea_name, NULL, (__u16)0,
++                              cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
++                                      CIFS_MOUNT_MAP_SPECIAL_CHR);
+       }
+ remove_ea_exit:
+       kfree(full_path);
+@@ -149,18 +151,22 @@ int cifs_setxattr(struct dentry *direntr
+                       cifs_dbg(FYI, "attempt to set cifs inode metadata\n");
+               ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
+-              rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
+-                      (__u16)value_size, cifs_sb->local_nls,
+-                      cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
++              if (pTcon->ses->server->ops->set_EA)
++                      rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
++                              full_path, ea_name, ea_value, (__u16)value_size,
++                              cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
++                                      CIFS_MOUNT_MAP_SPECIAL_CHR);
+       } else if (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN)
+                  == 0) {
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
+                       goto set_ea_exit;
+               ea_name += XATTR_OS2_PREFIX_LEN; /* skip past os2. prefix */
+-              rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
+-                      (__u16)value_size, cifs_sb->local_nls,
+-                      cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
++              if (pTcon->ses->server->ops->set_EA)
++                      rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
++                              full_path, ea_name, ea_value, (__u16)value_size,
++                              cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
++                                      CIFS_MOUNT_MAP_SPECIAL_CHR);
+       } else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL,
+                       strlen(CIFS_XATTR_CIFS_ACL)) == 0) {
+ #ifdef CONFIG_CIFS_ACL
+@@ -272,17 +278,21 @@ ssize_t cifs_getxattr(struct dentry *dir
+                       /* revalidate/getattr then populate from inode */
+               } /* BB add else when above is implemented */
+               ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
+-              rc = CIFSSMBQAllEAs(xid, pTcon, full_path, ea_name, ea_value,
+-                      buf_size, cifs_sb->local_nls,
+-                      cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
++              if (pTcon->ses->server->ops->query_all_EAs)
++                      rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon,
++                              full_path, ea_name, ea_value, buf_size,
++                              cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
++                                      CIFS_MOUNT_MAP_SPECIAL_CHR);
+       } else if (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN) == 0) {
+               if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
+                       goto get_ea_exit;
+               ea_name += XATTR_OS2_PREFIX_LEN; /* skip past os2. prefix */
+-              rc = CIFSSMBQAllEAs(xid, pTcon, full_path, ea_name, ea_value,
+-                      buf_size, cifs_sb->local_nls,
+-                      cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
++              if (pTcon->ses->server->ops->query_all_EAs)
++                      rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon,
++                              full_path, ea_name, ea_value, buf_size,
++                              cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
++                                      CIFS_MOUNT_MAP_SPECIAL_CHR);
+       } else if (strncmp(ea_name, POSIX_ACL_XATTR_ACCESS,
+                         strlen(POSIX_ACL_XATTR_ACCESS)) == 0) {
+ #ifdef CONFIG_CIFS_POSIX
+@@ -400,11 +410,12 @@ ssize_t cifs_listxattr(struct dentry *di
+       /* if proc/fs/cifs/streamstoxattr is set then
+               search server for EAs or streams to
+               returns as xattrs */
+-      rc = CIFSSMBQAllEAs(xid, pTcon, full_path, NULL, data,
+-                              buf_size, cifs_sb->local_nls,
+-                              cifs_sb->mnt_cifs_flags &
+-                                      CIFS_MOUNT_MAP_SPECIAL_CHR);
++      if (pTcon->ses->server->ops->query_all_EAs)
++              rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon,
++                              full_path, NULL, data, buf_size,
++                              cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
++                                      CIFS_MOUNT_MAP_SPECIAL_CHR);
+ list_ea_exit:
+       kfree(full_path);
+       free_xid(xid);
diff --git a/queue-3.10/fs-file.c-fdtable-avoid-triggering-ooms-from-alloc_fdmem.patch b/queue-3.10/fs-file.c-fdtable-avoid-triggering-ooms-from-alloc_fdmem.patch
new file mode 100644 (file)
index 0000000..f83a54a
--- /dev/null
@@ -0,0 +1,64 @@
+From 96c7a2ff21501691587e1ae969b83cbec8b78e08 Mon Sep 17 00:00:00 2001
+From: "Eric W. Biederman" <ebiederm@xmission.com>
+Date: Mon, 10 Feb 2014 14:25:41 -0800
+Subject: fs/file.c:fdtable: avoid triggering OOMs from alloc_fdmem
+
+From: "Eric W. Biederman" <ebiederm@xmission.com>
+
+commit 96c7a2ff21501691587e1ae969b83cbec8b78e08 upstream.
+
+Recently due to a spike in connections per second memcached on 3
+separate boxes triggered the OOM killer from accept.  At the time the
+OOM killer was triggered there was 4GB out of 36GB free in zone 1.  The
+problem was that alloc_fdtable was allocating an order 3 page (32KiB) to
+hold a bitmap, and there was sufficient fragmentation that the largest
+page available was 8KiB.
+
+I find the logic that PAGE_ALLOC_COSTLY_ORDER can't fail pretty dubious
+but I do agree that order 3 allocations are very likely to succeed.
+
+There are always pathologies where order > 0 allocations can fail when
+there are copious amounts of free memory available.  Using the pigeon
+hole principle it is easy to show that it requires 1 page more than 50%
+of the pages being free to guarantee an order 1 (8KiB) allocation will
+succeed, 1 page more than 75% of the pages being free to guarantee an
+order 2 (16KiB) allocation will succeed and 1 page more than 87.5% of
+the pages being free to guarantee an order 3 allocate will succeed.
+
+A server churning memory with a lot of small requests and replies like
+memcached is a common case that if anything can will skew the odds
+against large pages being available.
+
+Therefore let's not give external applications a practical way to kill
+linux server applications, and specify __GFP_NORETRY to the kmalloc in
+alloc_fdmem.  Unless I am misreading the code and by the time the code
+reaches should_alloc_retry in __alloc_pages_slowpath (where
+__GFP_NORETRY becomes signification).  We have already tried everything
+reasonable to allocate a page and the only thing left to do is wait.  So
+not waiting and falling back to vmalloc immediately seems like the
+reasonable thing to do even if there wasn't a chance of triggering the
+OOM killer.
+
+Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
+Cc: Eric Dumazet <eric.dumazet@gmail.com>
+Acked-by: David Rientjes <rientjes@google.com>
+Cc: Cong Wang <cwang@twopensource.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/file.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/file.c
++++ b/fs/file.c
+@@ -34,7 +34,7 @@ static void *alloc_fdmem(size_t size)
+        * vmalloc() if the allocation size will be considered "large" by the VM.
+        */
+       if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
+-              void *data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN);
++              void *data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY);
+               if (data != NULL)
+                       return data;
+       }
diff --git a/queue-3.10/mm-memory-failure.c-move-refcount-only-in-mf_count_increased.patch b/queue-3.10/mm-memory-failure.c-move-refcount-only-in-mf_count_increased.patch
new file mode 100644 (file)
index 0000000..03394db
--- /dev/null
@@ -0,0 +1,51 @@
+From 8d547ff4ac5927245e0833ac18528f939da0ee0e Mon Sep 17 00:00:00 2001
+From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
+Date: Mon, 10 Feb 2014 14:25:50 -0800
+Subject: mm/memory-failure.c: move refcount only in !MF_COUNT_INCREASED
+
+From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
+
+commit 8d547ff4ac5927245e0833ac18528f939da0ee0e upstream.
+
+mce-test detected a test failure when injecting error to a thp tail
+page.  This is because we take page refcount of the tail page in
+madvise_hwpoison() while the fix in commit a3e0f9e47d5e
+("mm/memory-failure.c: transfer page count from head page to tail page
+after split thp") assumes that we always take refcount on the head page.
+
+When a real memory error happens we take refcount on the head page where
+memory_failure() is called without MF_COUNT_INCREASED set, so it seems
+to me that testing memory error on thp tail page using madvise makes
+little sense.
+
+This patch cancels moving refcount in !MF_COUNT_INCREASED for valid
+testing.
+
+[akpm@linux-foundation.org: s/&&/&/]
+Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
+Cc: Andi Kleen <andi@firstfloor.org>
+Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
+Cc: Chen Gong <gong.chen@linux.intel.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/memory-failure.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/mm/memory-failure.c
++++ b/mm/memory-failure.c
+@@ -943,8 +943,10 @@ static int hwpoison_user_mappings(struct
+                        * to it. Similarly, page lock is shifted.
+                        */
+                       if (hpage != p) {
+-                              put_page(hpage);
+-                              get_page(p);
++                              if (!(flags & MF_COUNT_INCREASED)) {
++                                      put_page(hpage);
++                                      get_page(p);
++                              }
+                               lock_page(p);
+                               unlock_page(hpage);
+                               *hpagep = p;
diff --git a/queue-3.10/retrieving-cifs-acls-when-mounted-with-smb2-fails-dropping-session.patch b/queue-3.10/retrieving-cifs-acls-when-mounted-with-smb2-fails-dropping-session.patch
new file mode 100644 (file)
index 0000000..f02c580
--- /dev/null
@@ -0,0 +1,159 @@
+From 83e3bc23ef9ce7c03b7b4e5d3d790246ea59db3e Mon Sep 17 00:00:00 2001
+From: Steve French <smfrench@gmail.com>
+Date: Sun, 2 Feb 2014 23:31:47 -0600
+Subject: retrieving CIFS ACLs when mounted with SMB2 fails dropping session
+
+From: Steve French <smfrench@gmail.com>
+
+commit 83e3bc23ef9ce7c03b7b4e5d3d790246ea59db3e upstream.
+
+The get/set ACL xattr support for CIFS ACLs attempts to send old
+cifs dialect protocol requests even when mounted with SMB2 or later
+dialects. Sending cifs requests on an smb2 session causes problems -
+the server drops the session due to the illegal request.
+
+This patch makes CIFS ACL operations protocol specific to fix that.
+
+Attempting to query/set CIFS ACLs for SMB2 will now return
+EOPNOTSUPP (until we add worker routines for sending query
+ACL requests via SMB2) instead of sending invalid (cifs)
+requests.
+
+A separate followon patch will be needed to fix cifs_acl_to_fattr
+(which takes a cifs specific u16 fid so can't be abstracted
+to work with SMB2 until that is changed) and will be needed
+to fix mount problems when "cifsacl" is specified on mount
+with e.g. vers=2.1
+
+Signed-off-by: Steve French <smfrench@gmail.com>
+Reviewed-by: Shirish Pargaonkar <spargaonkar@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/cifs/cifsacl.c  |   28 ++++++++++++++++++++++++----
+ fs/cifs/cifsglob.h |    4 ++++
+ fs/cifs/smb1ops.c  |    4 ++++
+ fs/cifs/xattr.c    |   15 +++++++++++----
+ 4 files changed, 43 insertions(+), 8 deletions(-)
+
+--- a/fs/cifs/cifsacl.c
++++ b/fs/cifs/cifsacl.c
+@@ -1027,15 +1027,30 @@ id_mode_to_cifs_acl(struct inode *inode,
+       __u32 secdesclen = 0;
+       struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */
+       struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
++      struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
++      struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
++      struct cifs_tcon *tcon;
++
++      if (IS_ERR(tlink))
++              return PTR_ERR(tlink);
++      tcon = tlink_tcon(tlink);
+       cifs_dbg(NOISY, "set ACL from mode for %s\n", path);
+       /* Get the security descriptor */
+-      pntsd = get_cifs_acl(CIFS_SB(inode->i_sb), inode, path, &secdesclen);
++
++      if (tcon->ses->server->ops->get_acl == NULL) {
++              cifs_put_tlink(tlink);
++              return -EOPNOTSUPP;
++      }
++
++      pntsd = tcon->ses->server->ops->get_acl(cifs_sb, inode, path,
++                                              &secdesclen);
+       if (IS_ERR(pntsd)) {
+               rc = PTR_ERR(pntsd);
+               cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);
+-              goto out;
++              cifs_put_tlink(tlink);
++              return rc;
+       }
+       /*
+@@ -1048,6 +1063,7 @@ id_mode_to_cifs_acl(struct inode *inode,
+       pnntsd = kmalloc(secdesclen, GFP_KERNEL);
+       if (!pnntsd) {
+               kfree(pntsd);
++              cifs_put_tlink(tlink);
+               return -ENOMEM;
+       }
+@@ -1056,14 +1072,18 @@ id_mode_to_cifs_acl(struct inode *inode,
+       cifs_dbg(NOISY, "build_sec_desc rc: %d\n", rc);
++      if (tcon->ses->server->ops->set_acl == NULL)
++              rc = -EOPNOTSUPP;
++
+       if (!rc) {
+               /* Set the security descriptor */
+-              rc = set_cifs_acl(pnntsd, secdesclen, inode, path, aclflag);
++              rc = tcon->ses->server->ops->set_acl(pnntsd, secdesclen, inode,
++                                                   path, aclflag);
+               cifs_dbg(NOISY, "set_cifs_acl rc: %d\n", rc);
+       }
++      cifs_put_tlink(tlink);
+       kfree(pnntsd);
+       kfree(pntsd);
+-out:
+       return rc;
+ }
+--- a/fs/cifs/cifsglob.h
++++ b/fs/cifs/cifsglob.h
+@@ -376,6 +376,10 @@ struct smb_version_operations {
+       int (*set_EA)(const unsigned int, struct cifs_tcon *, const char *,
+                       const char *, const void *, const __u16,
+                       const struct nls_table *, int);
++      struct cifs_ntsd * (*get_acl)(struct cifs_sb_info *, struct inode *,
++                      const char *, u32 *);
++      int (*set_acl)(struct cifs_ntsd *, __u32, struct inode *, const char *,
++                      int);
+ };
+ struct smb_version_values {
+--- a/fs/cifs/smb1ops.c
++++ b/fs/cifs/smb1ops.c
+@@ -952,6 +952,10 @@ struct smb_version_operations smb1_opera
+       .query_all_EAs = CIFSSMBQAllEAs,
+       .set_EA = CIFSSMBSetEA,
+ #endif /* CIFS_XATTR */
++#ifdef CONFIG_CIFS_ACL
++      .get_acl = get_cifs_acl,
++      .set_acl = set_cifs_acl,
++#endif /* CIFS_ACL */
+ };
+ struct smb_version_values smb1_values = {
+--- a/fs/cifs/xattr.c
++++ b/fs/cifs/xattr.c
+@@ -176,8 +176,12 @@ int cifs_setxattr(struct dentry *direntr
+                       rc = -ENOMEM;
+               } else {
+                       memcpy(pacl, ea_value, value_size);
+-                      rc = set_cifs_acl(pacl, value_size,
+-                              direntry->d_inode, full_path, CIFS_ACL_DACL);
++                      if (pTcon->ses->server->ops->set_acl)
++                              rc = pTcon->ses->server->ops->set_acl(pacl,
++                                              value_size, direntry->d_inode,
++                                              full_path, CIFS_ACL_DACL);
++                      else
++                              rc = -EOPNOTSUPP;
+                       if (rc == 0) /* force revalidate of the inode */
+                               CIFS_I(direntry->d_inode)->time = 0;
+                       kfree(pacl);
+@@ -323,8 +327,11 @@ ssize_t cifs_getxattr(struct dentry *dir
+                       u32 acllen;
+                       struct cifs_ntsd *pacl;
+-                      pacl = get_cifs_acl(cifs_sb, direntry->d_inode,
+-                                              full_path, &acllen);
++                      if (pTcon->ses->server->ops->get_acl == NULL)
++                              goto get_ea_exit; /* rc already EOPNOTSUPP */
++
++                      pacl = pTcon->ses->server->ops->get_acl(cifs_sb,
++                                      direntry->d_inode, full_path, &acllen);
+                       if (IS_ERR(pacl)) {
+                               rc = PTR_ERR(pacl);
+                               cifs_dbg(VFS, "%s: error %zd getting sec desc\n",
index a263391703fc5a56ceb69e1b37fc721e05394310..05bf7a431ab777e4abcee26aed882f15173f8558 100644 (file)
@@ -1,3 +1,8 @@
 xen-blkfront-handle-backend-closed-without-closing.patch
 xen-p2m-check-mfn-is-in-range-before-using-the-m2p-table.patch
 xen-fix-possible-user-space-selector-corruption.patch
+fs-file.c-fdtable-avoid-triggering-ooms-from-alloc_fdmem.patch
+mm-memory-failure.c-move-refcount-only-in-mf_count_increased.patch
+cifs-fix-smb2-mounts-so-they-don-t-try-to-set-or-get-xattrs-via-cifs.patch
+add-protocol-specific-operation-for-cifs-xattrs.patch
+retrieving-cifs-acls-when-mounted-with-smb2-fails-dropping-session.patch