source:
branches/fc15-dev/server/common/patches/openafs-0004-Linux-2.6.38-Adjust-for-permission-inode-operation-c.patch
@
1893
Last change on this file since 1893 was 1835, checked in by achernya, 13 years ago | |
---|---|
File size: 3.8 KB |
-
acinclude.m4
From 29ef9bb31f31c371272ee9b2860729af2277ab95 Mon Sep 17 00:00:00 2001 From: Marc Dionne <marc.c.dionne@gmail.com> Date: Fri, 28 Jan 2011 19:41:32 -0500 Subject: [PATCH 4/8] Linux: 2.6.38: Adjust for permission inode operation changes The permission i_op has a new signature with a flags argument, and must now deal with RCU path walking. - Fix existing configure test for this i_op, it succeeds when it shouldn't - Add a new configure test for the new signature - Make our permission i_op "RCU-walk aware" - return ECHILD if called in that mode Reviewed-on: http://gerrit.openafs.org/3770 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> (cherry picked from commit 5bcc0ea735ea519298c98b46c66bf1326cdee5e4) Change-Id: I38db16f0f62500f46fad9c92d045ccfa6cfe1c38 Signed-off-by: Anders Kaseorg <andersk@mit.edu> Reviewed-on: http://gerrit.openafs.org/3997 Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Russ Allbery <rra@stanford.edu> Reviewed-on: http://gerrit.openafs.org/4040 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org> --- acinclude.m4 | 1 + src/afs/LINUX/osi_vnodeops.c | 13 +++++++++++-- src/cf/linux-test4.m4 | 16 ++++++++++++++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 60c47d1..de82283 100644
a b case $AFS_SYSNAME in *_linux* | *_umlinux*) 768 768 LINUX_WRITE_INODE_RETURN_TYPE 769 769 LINUX_IOP_I_CREATE_TAKES_NAMEIDATA 770 770 LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA 771 LINUX_IOP_I_PERMISSION_TAKES_FLAGS 771 772 LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA 772 773 LINUX_IOP_I_PUT_LINK_TAKES_COOKIE 773 774 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA -
src/afs/LINUX/osi_vnodeops.c
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 2389389..8352769 100644
a b afs_linux_updatepage(struct file *fp, struct page *pp, unsigned long offset, 1786 1786 * Check access rights - returns error if can't check or permission denied. 1787 1787 */ 1788 1788 static int 1789 #ifdef IOP_PERMISSION_TAKES_NAMEIDATA 1789 #if defined(IOP_PERMISSION_TAKES_FLAGS) 1790 afs_linux_permission(struct inode *ip, int mode, unsigned int flags) 1791 #elif defined(IOP_PERMISSION_TAKES_NAMEIDATA) 1790 1792 afs_linux_permission(struct inode *ip, int mode, struct nameidata *nd) 1791 1793 #else 1792 1794 afs_linux_permission(struct inode *ip, int mode) 1793 1795 #endif 1794 1796 { 1795 1797 int code; 1796 cred_t *credp = crref();1798 cred_t *credp; 1797 1799 int tmp = 0; 1798 1800 1801 #if defined(IOP_PERMISSION_TAKES_FLAGS) 1802 /* We don't support RCU path walking */ 1803 if (flags & IPERM_FLAG_RCU) 1804 return -ECHILD; 1805 #endif 1806 1807 credp = crref(); 1799 1808 AFS_GLOCK(); 1800 1809 if (mode & MAY_EXEC) 1801 1810 tmp |= VEXEC; -
src/cf/linux-test4.m4
diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 67ddf91..88e4863 100644
a b AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [ 680 680 [#include <linux/fs.h> 681 681 #include <linux/namei.h>], 682 682 [struct inode _inode; 683 struct dentry _dentry;684 683 struct nameidata _nameidata; 685 684 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);], 686 685 [IOP_PERMISSION_TAKES_NAMEIDATA], 687 686 [define if your iops.permission takes a nameidata argument], 688 []) 687 [-Werror]) 688 ]) 689 690 691 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_FLAGS], [ 692 AC_CHECK_LINUX_BUILD([whether inode_operations.permission takes flags], 693 [ac_cv_linux_func_i_permission_takes_flags], 694 [#include <linux/fs.h>], 695 [struct inode _inode; 696 unsigned int flags = 0; 697 (void)_inode.i_op->permission(&_inode, 0, flags);], 698 [IOP_PERMISSION_TAKES_FLAGS], 699 [define if your iops.permission takes a flags argument], 700 [-Werror]) 689 701 ]) 690 702 691 703
Note: See TracBrowser
for help on using the repository browser.