source: branches/fc15-dev/server/common/patches/openafs-0004-Linux-2.6.38-Adjust-for-permission-inode-operation-c.patch @ 1835

Last change on this file since 1835 was 1835, checked in by achernya, 13 years ago
OpenAFS builds on F15 Get OpenAFS to build on F15, using the cherry-picked patches.
File size: 3.8 KB
RevLine 
[1835]1From 29ef9bb31f31c371272ee9b2860729af2277ab95 Mon Sep 17 00:00:00 2001
2From: Marc Dionne <marc.c.dionne@gmail.com>
3Date: Fri, 28 Jan 2011 19:41:32 -0500
4Subject: [PATCH 4/8] Linux: 2.6.38: Adjust for permission inode operation changes
5
6The permission i_op has a new signature with a flags argument, and
7must now deal with RCU path walking.
8- Fix existing configure test for this i_op, it succeeds when it
9shouldn't
10- Add a new configure test for the new signature
11- Make our permission i_op "RCU-walk aware" - return ECHILD if
12called in that mode
13
14Reviewed-on: http://gerrit.openafs.org/3770
15Tested-by: BuildBot <buildbot@rampaginggeek.com>
16Reviewed-by: Derrick Brashear <shadow@dementia.org>
17(cherry picked from commit 5bcc0ea735ea519298c98b46c66bf1326cdee5e4)
18
19Change-Id: I38db16f0f62500f46fad9c92d045ccfa6cfe1c38
20Signed-off-by: Anders Kaseorg <andersk@mit.edu>
21Reviewed-on: http://gerrit.openafs.org/3997
22Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
23Tested-by: BuildBot <buildbot@rampaginggeek.com>
24Reviewed-by: Russ Allbery <rra@stanford.edu>
25Reviewed-on: http://gerrit.openafs.org/4040
26Reviewed-by: Derrick Brashear <shadow@dementia.org>
27Tested-by: Derrick Brashear <shadow@dementia.org>
28---
29 acinclude.m4                 |    1 +
30 src/afs/LINUX/osi_vnodeops.c |   13 +++++++++++--
31 src/cf/linux-test4.m4        |   16 ++++++++++++++--
32 3 files changed, 26 insertions(+), 4 deletions(-)
33
34diff --git a/acinclude.m4 b/acinclude.m4
35index 60c47d1..de82283 100644
36--- a/acinclude.m4
37+++ b/acinclude.m4
38@@ -768,6 +768,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
39                 LINUX_WRITE_INODE_RETURN_TYPE
40                 LINUX_IOP_I_CREATE_TAKES_NAMEIDATA
41                 LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA
42+                LINUX_IOP_I_PERMISSION_TAKES_FLAGS
43                 LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA
44                 LINUX_IOP_I_PUT_LINK_TAKES_COOKIE
45                 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA
46diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
47index 2389389..8352769 100644
48--- a/src/afs/LINUX/osi_vnodeops.c
49+++ b/src/afs/LINUX/osi_vnodeops.c
50@@ -1786,16 +1786,25 @@ afs_linux_updatepage(struct file *fp, struct page *pp, unsigned long offset,
51  * Check access rights - returns error if can't check or permission denied.
52  */
53 static int
54-#ifdef IOP_PERMISSION_TAKES_NAMEIDATA
55+#if defined(IOP_PERMISSION_TAKES_FLAGS)
56+afs_linux_permission(struct inode *ip, int mode, unsigned int flags)
57+#elif defined(IOP_PERMISSION_TAKES_NAMEIDATA)
58 afs_linux_permission(struct inode *ip, int mode, struct nameidata *nd)
59 #else
60 afs_linux_permission(struct inode *ip, int mode)
61 #endif
62 {
63     int code;
64-    cred_t *credp = crref();
65+    cred_t *credp;
66     int tmp = 0;
67 
68+#if defined(IOP_PERMISSION_TAKES_FLAGS)
69+    /* We don't support RCU path walking */
70+    if (flags & IPERM_FLAG_RCU)
71+       return -ECHILD;
72+#endif
73+
74+    credp = crref();
75     AFS_GLOCK();
76     if (mode & MAY_EXEC)
77        tmp |= VEXEC;
78diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
79index 67ddf91..88e4863 100644
80--- a/src/cf/linux-test4.m4
81+++ b/src/cf/linux-test4.m4
82@@ -680,12 +680,24 @@ AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
83 [#include <linux/fs.h>
84 #include <linux/namei.h>],
85 [struct inode _inode;
86-struct dentry _dentry;
87 struct nameidata _nameidata;
88 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
89                       [IOP_PERMISSION_TAKES_NAMEIDATA],
90                       [define if your iops.permission takes a nameidata argument],
91-                      [])
92+                      [-Werror])
93+])
94+
95+
96+AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_FLAGS], [
97+  AC_CHECK_LINUX_BUILD([whether inode_operations.permission takes flags],
98+                       [ac_cv_linux_func_i_permission_takes_flags],
99+                       [#include <linux/fs.h>],
100+                       [struct inode _inode;
101+                       unsigned int flags = 0;
102+                       (void)_inode.i_op->permission(&_inode, 0, flags);],
103+                      [IOP_PERMISSION_TAKES_FLAGS],
104+                      [define if your iops.permission takes a flags argument],
105+                      [-Werror])
106 ])
107 
108 
109--
1101.7.3.4
111
Note: See TracBrowser for help on using the repository browser.