Re: [PATCH 1/3] fs: Enable bmap() function to properly return errors

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

 



On Fri, Sep 14, 2018 at 03:23:13PM +0200, Christoph Hellwig wrote:
> On Wed, Sep 12, 2018 at 02:25:34PM +0200, Carlos Maiolino wrote:
> >  	attach_page_buffers(page, bh);
> > -	block = index << (PAGE_SHIFT - inode->i_blkbits);
> > +	blk_cur = index << (PAGE_SHIFT - inode->i_blkbits);
> >  	while (bh) {
> > +		block = blk_cur;
> > +
> >  		if (count == 0)
> >  			bh->b_blocknr = 0;
> >  		else {
> > -			bh->b_blocknr = bmap(inode, block);
> > -			if (bh->b_blocknr == 0) {
> > -				/* Cannot use this file! */
> > +			ret = bmap(inode, &block);
> > +			if (ret || !block) {
> >  				ret = -EINVAL;
> > +				bh->b_blocknr = 0;
> >  				goto out;
> 
> 
> This conversion look good, but the code you are starting with is
> completely broken.  It really needs to switch to use normal read/write_iter
> interfaces ASAP.
> 
Thanks for the review Christoph, I'll add this to my todo list. Thanks a lot.


> Otherwise looks fine:
> 
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>


-- 
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