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

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

 



On Fri, Sep 14, 2018 at 03:26:16PM +0200, Christoph Hellwig wrote:
> 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;
> }

I can change, without problem.
> 
> But the idea that we even support ->bmap on ecryptfs sounds way too
> dangerous.

I can't argue here, I don't know much about ecryptfs, I just replaced the ->bmap
call keeping the same logic, but thanks a lot for the review, I'll update it and
send a V2

-- 
Carlos



[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