aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2012-10-08 15:31:32 +0400
committerAlexey Shvetsov <alexxy@gentoo.org>2012-10-08 15:31:32 +0400
commit57c4f824727fc8e08d12f3f41084d890f6a200b8 (patch)
tree5b412425044f027170652b6b9b21b77388050b2c /sys-cluster/lustre/files/2.4/0004-LU-1337-vfs-provides-ll_get_acl-to-i_op-get_acl.patch
parentMerge branch 'master' of git+ssh://git.overlays.gentoo.org/proj/sci (diff)
downloadsci-57c4f824727fc8e08d12f3f41084d890f6a200b8.tar.gz
sci-57c4f824727fc8e08d12f3f41084d890f6a200b8.tar.bz2
sci-57c4f824727fc8e08d12f3f41084d890f6a200b8.zip
[sys-cluster/lustre] Update patches
(Portage version: 2.2.0_alpha135/git/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'sys-cluster/lustre/files/2.4/0004-LU-1337-vfs-provides-ll_get_acl-to-i_op-get_acl.patch')
-rw-r--r--sys-cluster/lustre/files/2.4/0004-LU-1337-vfs-provides-ll_get_acl-to-i_op-get_acl.patch150
1 files changed, 150 insertions, 0 deletions
diff --git a/sys-cluster/lustre/files/2.4/0004-LU-1337-vfs-provides-ll_get_acl-to-i_op-get_acl.patch b/sys-cluster/lustre/files/2.4/0004-LU-1337-vfs-provides-ll_get_acl-to-i_op-get_acl.patch
new file mode 100644
index 000000000..a9ef35739
--- /dev/null
+++ b/sys-cluster/lustre/files/2.4/0004-LU-1337-vfs-provides-ll_get_acl-to-i_op-get_acl.patch
@@ -0,0 +1,150 @@
+From 45331d1b634b8c79e753cc4f75659b09315b3037 Mon Sep 17 00:00:00 2001
+From: Liu Xuezhao <xuezhao.liu@emc.com>
+Date: Mon, 27 Aug 2012 17:19:22 +0800
+Subject: [PATCH 04/13] LU-1337 vfs: provides ll_get_acl to ->i_op->get_acl
+
+Since kernel 3.1 generic_permission() has lost the check_acl
+argument, ACL checking has been taken to VFS and filesystems
+need to provide a non-NULL ->i_op->get_acl to read an ACL
+from disk.
+
+This patch is a complementarity to http://review.whamcloud.com/3397
+(d018b087c962b8c66e8dc479fc66e964a2e5fd94), to fix failure of test_25
+of sanityn.sh.
+
+Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
+Change-Id: Ica96adac03c1792e2e8b668b959457a4ffec9a43
+---
+ lustre/autoconf/lustre-core.m4 | 3 +++
+ lustre/llite/file.c | 28 +++++++++++++++++++++-------
+ lustre/llite/llite_internal.h | 3 +++
+ lustre/llite/namei.c | 6 ++++++
+ 4 files changed, 33 insertions(+), 7 deletions(-)
+
+diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4
+index ec3723e..5a039e2 100644
+--- a/lustre/autoconf/lustre-core.m4
++++ b/lustre/autoconf/lustre-core.m4
+@@ -1767,6 +1767,9 @@ LB_LINUX_TRY_COMPILE([
+ #
+ # 3.1 generic_permission taken 2 parameters.
+ # see kernel commit 2830ba7f34ebb27c4e5b8b6ef408cd6d74860890
++# When generic_permission taken 2 parameters, it also means
++# inode_operations has get_acl member function,
++# see kernel commit 4e34e719e457f2e031297175410fc0bd4016a085
+ #
+ AC_DEFUN([LC_GENERIC_PERMISSION],
+ [AC_MSG_CHECKING([if generic_permission take 2 or 4 arguments])
+diff --git a/lustre/llite/file.c b/lustre/llite/file.c
+index d03ec76..f9c99a6 100644
+--- a/lustre/llite/file.c
++++ b/lustre/llite/file.c
+@@ -2541,16 +2541,29 @@ int ll_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
+ }
+ #endif
+
++struct posix_acl * ll_get_acl(struct inode *inode, int type)
++{
++ struct ll_inode_info *lli = ll_i2info(inode);
++ struct posix_acl *acl = NULL;
++ ENTRY;
++
++ cfs_spin_lock(&lli->lli_lock);
++ /* VFS' acl_permission_check->check_acl will release the refcount */
++ acl = posix_acl_dup(lli->lli_posix_acl);
++ cfs_spin_unlock(&lli->lli_lock);
++
++ RETURN(acl);
++}
++
+ #ifndef HAVE_GENERIC_PERMISSION_2ARGS
+ static int
+ # ifdef HAVE_GENERIC_PERMISSION_4ARGS
+-lustre_check_acl(struct inode *inode, int mask, unsigned int flags)
++ll_check_acl(struct inode *inode, int mask, unsigned int flags)
+ # else
+-lustre_check_acl(struct inode *inode, int mask)
++ll_check_acl(struct inode *inode, int mask)
+ # endif
+ {
+ # ifdef CONFIG_FS_POSIX_ACL
+- struct ll_inode_info *lli = ll_i2info(inode);
+ struct posix_acl *acl;
+ int rc;
+ ENTRY;
+@@ -2559,9 +2572,7 @@ lustre_check_acl(struct inode *inode, int mask)
+ if (flags & IPERM_FLAG_RCU)
+ return -ECHILD;
+ # endif
+- cfs_spin_lock(&lli->lli_lock);
+- acl = posix_acl_dup(lli->lli_posix_acl);
+- cfs_spin_unlock(&lli->lli_lock);
++ acl = ll_get_acl(inode, ACL_TYPE_ACCESS);
+
+ if (!acl)
+ RETURN(-EAGAIN);
+@@ -2613,7 +2624,7 @@ int ll_inode_permission(struct inode *inode, int mask, struct nameidata *nd)
+ return lustre_check_remote_perm(inode, mask);
+
+ ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_INODE_PERM, 1);
+- rc = ll_generic_permission(inode, mask, flags, lustre_check_acl);
++ rc = ll_generic_permission(inode, mask, flags, ll_check_acl);
+
+ RETURN(rc);
+ }
+@@ -2708,6 +2719,9 @@ struct inode_operations ll_file_inode_operations = {
+ #ifdef HAVE_LINUX_FIEMAP_H
+ .fiemap = ll_fiemap,
+ #endif
++#ifdef HAVE_GENERIC_PERMISSION_2ARGS
++ .get_acl = ll_get_acl,
++#endif
+ };
+
+ /* dynamic ioctl number support routins */
+diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h
+index ab60e58..8222dca 100644
+--- a/lustre/llite/llite_internal.h
++++ b/lustre/llite/llite_internal.h
+@@ -742,6 +742,8 @@ int ll_getattr_it(struct vfsmount *mnt, struct dentry *de,
+ struct lookup_intent *it, struct kstat *stat);
+ int ll_getattr(struct vfsmount *mnt, struct dentry *de, struct kstat *stat);
+ struct ll_file_data *ll_file_data_get(void);
++struct posix_acl * ll_get_acl(struct inode *inode, int type);
++
+ #ifdef HAVE_GENERIC_PERMISSION_4ARGS
+ int ll_inode_permission(struct inode *inode, int mask, unsigned int flags);
+ #else
+@@ -751,6 +753,7 @@ int ll_inode_permission(struct inode *inode, int mask, struct nameidata *nd);
+ int ll_inode_permission(struct inode *inode, int mask);
+ # endif
+ #endif
++
+ int ll_lov_setstripe_ea_info(struct inode *inode, struct file *file,
+ int flags, struct lov_user_md *lum,
+ int lum_size);
+diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c
+index 4cb3bf4..036674f 100644
+--- a/lustre/llite/namei.c
++++ b/lustre/llite/namei.c
+@@ -1193,6 +1193,9 @@ struct inode_operations ll_dir_inode_operations = {
+ .getxattr = ll_getxattr,
+ .listxattr = ll_listxattr,
+ .removexattr = ll_removexattr,
++#ifdef HAVE_GENERIC_PERMISSION_2ARGS
++ .get_acl = ll_get_acl,
++#endif
+ };
+
+ struct inode_operations ll_special_inode_operations = {
+@@ -1203,4 +1206,7 @@ struct inode_operations ll_special_inode_operations = {
+ .getxattr = ll_getxattr,
+ .listxattr = ll_listxattr,
+ .removexattr = ll_removexattr,
++#ifdef HAVE_GENERIC_PERMISSION_2ARGS
++ .get_acl = ll_get_acl,
++#endif
+ };
+--
+1.7.12
+