diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-04 22:44:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-04 22:44:40 -0400 |
commit | 24f0eed2668b059e847ff145848ddacb75419acc (patch) | |
tree | 010c89c06e191b068f8a078b10bfaf1d3699c834 /fs | |
parent | 8b6b4628126fd73d0a53b499a26133c15b73c1e6 (diff) | |
parent | 3567866bf26190d1e734c975c907eb06e923ba23 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
RCUify freeing acls, let check_acl() go ahead in RCU mode if acl is cached
get rid of boilerplate switches in posix_acl.h
fix block device fallout from ->fsync() changes
Diffstat (limited to 'fs')
-rw-r--r-- | fs/block_dev.c | 4 | ||||
-rw-r--r-- | fs/namei.c | 17 |
2 files changed, 10 insertions, 11 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index f28680553288..ff77262e887c 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -387,6 +387,10 @@ int blkdev_fsync(struct file *filp, loff_t start, loff_t end, int datasync) | |||
387 | struct inode *bd_inode = filp->f_mapping->host; | 387 | struct inode *bd_inode = filp->f_mapping->host; |
388 | struct block_device *bdev = I_BDEV(bd_inode); | 388 | struct block_device *bdev = I_BDEV(bd_inode); |
389 | int error; | 389 | int error; |
390 | |||
391 | error = filemap_write_and_wait_range(filp->f_mapping, start, end); | ||
392 | if (error) | ||
393 | return error; | ||
390 | 394 | ||
391 | /* | 395 | /* |
392 | * There is no need to serialise calls to blkdev_issue_flush with | 396 | * There is no need to serialise calls to blkdev_issue_flush with |
diff --git a/fs/namei.c b/fs/namei.c index 445fd5da11fa..3d607bd80e09 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -179,19 +179,14 @@ static int check_acl(struct inode *inode, int mask) | |||
179 | #ifdef CONFIG_FS_POSIX_ACL | 179 | #ifdef CONFIG_FS_POSIX_ACL |
180 | struct posix_acl *acl; | 180 | struct posix_acl *acl; |
181 | 181 | ||
182 | /* | ||
183 | * Under RCU walk, we cannot even do a "get_cached_acl()", | ||
184 | * because that involves locking and getting a refcount on | ||
185 | * a cached ACL. | ||
186 | * | ||
187 | * So the only case we handle during RCU walking is the | ||
188 | * case of a cached "no ACL at all", which needs no locks | ||
189 | * or refcounts. | ||
190 | */ | ||
191 | if (mask & MAY_NOT_BLOCK) { | 182 | if (mask & MAY_NOT_BLOCK) { |
192 | if (negative_cached_acl(inode, ACL_TYPE_ACCESS)) | 183 | acl = get_cached_acl_rcu(inode, ACL_TYPE_ACCESS); |
184 | if (!acl) | ||
193 | return -EAGAIN; | 185 | return -EAGAIN; |
194 | return -ECHILD; | 186 | /* no ->get_acl() calls in RCU mode... */ |
187 | if (acl == ACL_NOT_CACHED) | ||
188 | return -ECHILD; | ||
189 | return posix_acl_permission(inode, acl, mask); | ||
195 | } | 190 | } |
196 | 191 | ||
197 | acl = get_cached_acl(inode, ACL_TYPE_ACCESS); | 192 | acl = get_cached_acl(inode, ACL_TYPE_ACCESS); |