Patch "posix_acl: Add set_posix_acl" has been added to the 3.14-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
posix_acl: Add set_posix_acl
to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
posix_acl-add-set_posix_acl.patch
and it can be found in the queue-3.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
485e71e8fb6356c08c7fc6bcce4bf02c9a9a663fMon Sep 17 00:00:00 2001
From: Andreas Gruenbacher <[email protected]>
Date: Wed, 22 Jun 2016 23:57:25 +0200
Subject: posix_acl: Add set_posix_acl
From: Andreas Gruenbacher <[email protected]>
commit 485e71e8fb6356c08c7fc6bcce4bf02c9a9a663f upstream.
Factor out part of posix_acl_xattr_set into a common function that takes a posix_acl, which nfsd can also call.
The prototype already exists in include/linux/posix_acl.h.
--- fs/posix_acl.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-)
fs/posix_acl.c +21 -17
@@ -787,38 +787,42 @@ posix_acl_xattr_get(struct dentry *dentrreturn error; } -static int -posix_acl_xattr_set (struct dentry *dentry,const char *name, -const void *value,size_t size,int flags,int type) +int +set_posix_acl (struct inode *inode,int type,struct posix_acl *acl) { -struct inode *inode = dentry->d_inode; -struct posix_acl *acl =NULL ; -int ret; -if (!IS_POSIXACL (inode))return -EOPNOTSUPP ;if (!inode->i_op->set_acl)return -EOPNOTSUPP ;if (type ==ACL_TYPE_DEFAULT && !S_ISDIR (inode->i_mode)) -return value ? -EACCES :0 ; +return acl ? -EACCES :0 ;if (!inode_owner_or_capable (inode))return -EPERM ; +if (acl) { +int ret =posix_acl_valid (acl); +if (ret) +return ret; + } +return inode->i_op->set_acl (inode, acl, type); +} +EXPORT_SYMBOL (set_posix_acl); + +static int +posix_acl_xattr_set (struct dentry *dentry,const char *name, +const void *value,size_t size,int flags,int type) +{ +struct inode *inode = dentry->d_inode; +struct posix_acl *acl =NULL ; +int ret; +if (value) { acl =posix_acl_from_xattr (&init_user_ns, value, size);if (IS_ERR (acl))return PTR_ERR (acl); - -if (acl) { - ret =posix_acl_valid (acl); -if (ret) - goto out; - } } - - ret = inode->i_op->set_acl (inode, acl, type); -out: + ret =set_posix_acl (inode, type, acl);posix_acl_release (acl);return ret; }
Patches currently in stable-queue which might be from [email protected] are
queue-3.14/posix_acl-add-set_posix_acl.patch