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. Otherwise looks fine: Reviewed-by: Christoph Hellwig <hch@xxxxxx>