Re: [PATCH 3/3] ecryptfs: drop direct calls to ->bmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 12, 2018 at 02:25:36PM +0200, Carlos Maiolino wrote:
>  static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block)
>  {
> +	sector_t blk_map = 0;
> +	int ret;
>  	struct inode *inode;
>  	struct inode *lower_inode;
>  
>  	inode = (struct inode *)mapping->host;
>  	lower_inode = ecryptfs_inode_to_lower(inode);
> +
> +	ret = bmap(lower_inode, &blk_map);
> +
> +	return !ret ? blk_map : 0;

This could be simplified to:

static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block)
{
 	struct inode *lower_inode = ecryptfs_inode_to_lower(mapping->host);
	int ret = bmap(lower_inode, &block);

	if (ret)
		return 0;
	return block;
}

But the idea that we even support ->bmap on ecryptfs sounds way too
dangerous.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux