From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f66.google.com ([209.85.128.66]:53446 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbeIOAEM (ORCPT ); Fri, 14 Sep 2018 20:04:12 -0400 Received: by mail-wm1-f66.google.com with SMTP id b19-v6so2957864wme.3 for ; Fri, 14 Sep 2018 11:48:27 -0700 (PDT) Date: Fri, 14 Sep 2018 20:48:23 +0200 From: Carlos Maiolino To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, sandeen@redhat.com, david@fromorbit.com Subject: Re: [PATCH 1/3] fs: Enable bmap() function to properly return errors Message-ID: <20180914184823.seyorb6q4o22mcfc@odin.usersys.redhat.com> References: <20180912122536.31977-1-cmaiolino@redhat.com> <20180912122536.31977-2-cmaiolino@redhat.com> <20180914132313.GA27382@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180914132313.GA27382@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 -- Carlos