From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com ([209.85.221.68]:33786 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbeIFMhT (ORCPT ); Thu, 6 Sep 2018 08:37:19 -0400 Received: by mail-wr1-f68.google.com with SMTP id v90-v6so10347784wrc.0 for ; Thu, 06 Sep 2018 01:03:06 -0700 (PDT) Date: Thu, 6 Sep 2018 10:03:03 +0200 From: Carlos Maiolino To: Eric Sandeen Cc: linux-fsdevel@vger.kernel.org, hch@lst.de, david@fromorbit.com Subject: Re: [PATCH 1/2] fs: Replace direct ->bmap calls by bmap() Message-ID: <20180906080303.zfe3f45zahrb7fbb@odin.usersys.redhat.com> References: <20180905135748.30098-1-cmaiolino@redhat.com> <20180905135748.30098-2-cmaiolino@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Sep 05, 2018 at 09:23:26AM -0500, Eric Sandeen wrote: > On 9/5/18 8:57 AM, Carlos Maiolino wrote: > > Prepare the field to use ->fiemap for FIBMAP ioctl > > > > Signed-off-by: Carlos Maiolino > > --- > > fs/cachefiles/rdwr.c | 5 ++--- > > fs/ecryptfs/mmap.c | 5 ++--- > > fs/ioctl.c | 14 ++++++++------ > > 3 files changed, 12 insertions(+), 12 deletions(-) > > > > diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c > > index 40f7595aad10..186e203d64a7 100644 > > --- a/fs/cachefiles/rdwr.c > > +++ b/fs/cachefiles/rdwr.c > > @@ -435,7 +435,7 @@ int cachefiles_read_or_alloc_page(struct fscache_retrieval *op, > > block0 = page->index; > > block0 <<= shift; > > > > - block = inode->i_mapping->a_ops->bmap(inode->i_mapping, block0); > > + block = bmap(inode, block0); > > Prior to this there's an ASSERT that inode->i_mapping->a_ops->bmap > exists. Should that stay, if the goal is to move all ->bmap use out > of calling code? OTOH, what will this code do if bmap() finds that there > is no ->bmap present and returns 0? > > > + res = bmap(inode, block); > > + > > + if (res) > > + return put_user(res, p); > > + else > > + return -EINVAL; > > So now mapping a hole will return -EINVAL? I don't think that change > in behavior is ok. > Thanks for catching it, I messed the return value here. I'm going to think about your 2 points for the next review and work on a real patch for retiring ->bmap once I've got more information now. > -Eric > > > } > > > > /** > > > -- Carlos