diff options
author | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:49:58 -0500 |
---|---|---|
committer | Nick Piggin <npiggin@kernel.dk> | 2011-01-07 01:50:29 -0500 |
commit | b74c79e99389cd79b31fcc08f82c24e492e63c7e (patch) | |
tree | 763c6b412517306670bc625e90035f2d16bb739f /fs/fuse | |
parent | 34286d6662308d82aed891852d04c7c3a2649b16 (diff) |
fs: provide rcu-walk aware permission i_ops
Signed-off-by: Nick Piggin <npiggin@kernel.dk>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/dir.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 07f4b5e675fc..f738599fd8cd 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -985,12 +985,15 @@ static int fuse_access(struct inode *inode, int mask) | |||
985 | * access request is sent. Execute permission is still checked | 985 | * access request is sent. Execute permission is still checked |
986 | * locally based on file mode. | 986 | * locally based on file mode. |
987 | */ | 987 | */ |
988 | static int fuse_permission(struct inode *inode, int mask) | 988 | static int fuse_permission(struct inode *inode, int mask, unsigned int flags) |
989 | { | 989 | { |
990 | struct fuse_conn *fc = get_fuse_conn(inode); | 990 | struct fuse_conn *fc = get_fuse_conn(inode); |
991 | bool refreshed = false; | 991 | bool refreshed = false; |
992 | int err = 0; | 992 | int err = 0; |
993 | 993 | ||
994 | if (flags & IPERM_FLAG_RCU) | ||
995 | return -ECHILD; | ||
996 | |||
994 | if (!fuse_allow_task(fc, current)) | 997 | if (!fuse_allow_task(fc, current)) |
995 | return -EACCES; | 998 | return -EACCES; |
996 | 999 | ||
@@ -1005,7 +1008,7 @@ static int fuse_permission(struct inode *inode, int mask) | |||
1005 | } | 1008 | } |
1006 | 1009 | ||
1007 | if (fc->flags & FUSE_DEFAULT_PERMISSIONS) { | 1010 | if (fc->flags & FUSE_DEFAULT_PERMISSIONS) { |
1008 | err = generic_permission(inode, mask, NULL); | 1011 | err = generic_permission(inode, mask, flags, NULL); |
1009 | 1012 | ||
1010 | /* If permission is denied, try to refresh file | 1013 | /* If permission is denied, try to refresh file |
1011 | attributes. This is also needed, because the root | 1014 | attributes. This is also needed, because the root |
@@ -1013,7 +1016,8 @@ static int fuse_permission(struct inode *inode, int mask) | |||
1013 | if (err == -EACCES && !refreshed) { | 1016 | if (err == -EACCES && !refreshed) { |
1014 | err = fuse_do_getattr(inode, NULL, NULL); | 1017 | err = fuse_do_getattr(inode, NULL, NULL); |
1015 | if (!err) | 1018 | if (!err) |
1016 | err = generic_permission(inode, mask, NULL); | 1019 | err = generic_permission(inode, mask, |
1020 | flags, NULL); | ||
1017 | } | 1021 | } |
1018 | 1022 | ||
1019 | /* Note: the opposite of the above test does not | 1023 | /* Note: the opposite of the above test does not |