| [2060] | 1 | From f129142dde2a2637b2e638ca0cca372a45188923 Mon Sep 17 00:00:00 2001 | 
|---|
|  | 2 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 3 | Date: Sat, 29 Oct 2011 19:23:07 -0400 | 
|---|
|  | 4 | Subject: [PATCH] Linux: 3.1: update RCU path walking detection in permission i_op | 
|---|
|  | 5 |  | 
|---|
|  | 6 | The permission() inode operation changed again with kernel 3.1, | 
|---|
|  | 7 | back to the form it had before 2.6.38.  This compiles fine, | 
|---|
|  | 8 | but is missing the new way of detecting when we get called in | 
|---|
|  | 9 | RCU path walking mode, resulting in system hangs. | 
|---|
|  | 10 |  | 
|---|
|  | 11 | Reviewed-on: http://gerrit.openafs.org/5740 | 
|---|
|  | 12 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 13 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 14 | (cherry picked from commit 4952df3f0359531e4a660c99c94c51eb0b169f59) | 
|---|
|  | 15 |  | 
|---|
|  | 16 | Change-Id: Ibd497309e6699fb585cf70e618373e800b73cbb8 | 
|---|
|  | 17 | Reviewed-on: http://gerrit.openafs.org/6088 | 
|---|
|  | 18 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 19 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 20 | --- | 
|---|
|  | 21 | src/afs/LINUX/osi_vnodeops.c |    5 ++++- | 
|---|
|  | 22 | 1 files changed, 4 insertions(+), 1 deletions(-) | 
|---|
|  | 23 |  | 
|---|
|  | 24 | diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 25 | index e9215db..696146b 100644 | 
|---|
|  | 26 | --- a/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 27 | +++ b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 28 | @@ -2245,10 +2245,13 @@ afs_linux_permission(struct inode *ip, int mode) | 
|---|
|  | 29 | cred_t *credp; | 
|---|
|  | 30 | int tmp = 0; | 
|---|
|  | 31 |  | 
|---|
|  | 32 | +    /* Check for RCU path walking */ | 
|---|
|  | 33 | #if defined(IOP_PERMISSION_TAKES_FLAGS) | 
|---|
|  | 34 | -    /* We don't support RCU path walking */ | 
|---|
|  | 35 | if (flags & IPERM_FLAG_RCU) | 
|---|
|  | 36 | return -ECHILD; | 
|---|
|  | 37 | +#elif defined(MAY_NOT_BLOCK) | 
|---|
|  | 38 | +    if (mode & MAY_NOT_BLOCK) | 
|---|
|  | 39 | +       return -ECHILD; | 
|---|
|  | 40 | #endif | 
|---|
|  | 41 |  | 
|---|
|  | 42 | credp = crref(); | 
|---|
|  | 43 | -- | 
|---|
|  | 44 | 1.7.2.5 | 
|---|
|  | 45 |  | 
|---|