diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-02-08 22:04:49 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-02-08 22:04:49 +0100 |
commit | 236f45329460f76d058111de1a1cea12f5a8b734 (patch) | |
tree | ca848d9200a3a785f6cbbbff2720a4ff021c5947 /fs/ecryptfs | |
parent | Merge branch 'pipe-exclusive-wakeup' (diff) | |
parent | saner copy_mount_options() (diff) | |
download | linux-236f45329460f76d058111de1a1cea12f5a8b734.tar.xz linux-236f45329460f76d058111de1a1cea12f5a8b734.zip |
Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc vfs updates from Al Viro:
- bmap series from cmaiolino
- getting rid of convolutions in copy_mount_options() (use a couple of
copy_from_user() instead of the __get_user() crap)
* 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
saner copy_mount_options()
fibmap: Reject negative block numbers
fibmap: Use bmap instead of ->bmap method in ioctl_fibmap
ecryptfs: drop direct calls to ->bmap
cachefiles: drop direct usage of ->bmap method.
fs: Enable bmap() function to properly return errors
Diffstat (limited to 'fs/ecryptfs')
-rw-r--r-- | fs/ecryptfs/mmap.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/ecryptfs/mmap.c b/fs/ecryptfs/mmap.c index cffa0c1ec829..019572c6b39a 100644 --- a/fs/ecryptfs/mmap.c +++ b/fs/ecryptfs/mmap.c @@ -524,16 +524,12 @@ out: static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block) { - int rc = 0; - struct inode *inode; - struct inode *lower_inode; - - inode = (struct inode *)mapping->host; - lower_inode = ecryptfs_inode_to_lower(inode); - if (lower_inode->i_mapping->a_ops->bmap) - rc = lower_inode->i_mapping->a_ops->bmap(lower_inode->i_mapping, - block); - return rc; + struct inode *lower_inode = ecryptfs_inode_to_lower(mapping->host); + int ret = bmap(lower_inode, &block); + + if (ret) + return 0; + return block; } const struct address_space_operations ecryptfs_aops = { |