From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:57760 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727611AbeINShj (ORCPT ); Fri, 14 Sep 2018 14:37:39 -0400 Date: Fri, 14 Sep 2018 15:23:13 +0200 From: Christoph Hellwig To: Carlos Maiolino Cc: linux-fsdevel@vger.kernel.org, hch@lst.de, sandeen@redhat.com, david@fromorbit.com Subject: Re: [PATCH 1/3] fs: Enable bmap() function to properly return errors Message-ID: <20180914132313.GA27382@lst.de> References: <20180912122536.31977-1-cmaiolino@redhat.com> <20180912122536.31977-2-cmaiolino@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180912122536.31977-2-cmaiolino@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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