From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:35934 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726748AbeIOACz (ORCPT ); Fri, 14 Sep 2018 20:02:55 -0400 Received: by mail-wr1-f67.google.com with SMTP id e1-v6so11581504wrt.3 for ; Fri, 14 Sep 2018 11:47:10 -0700 (PDT) Date: Fri, 14 Sep 2018 20:47:06 +0200 From: Carlos Maiolino To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, sandeen@redhat.com, david@fromorbit.com Subject: Re: [PATCH 3/3] ecryptfs: drop direct calls to ->bmap Message-ID: <20180914184706.hpzjataspqfhm3ob@odin.usersys.redhat.com> References: <20180912122536.31977-1-cmaiolino@redhat.com> <20180912122536.31977-4-cmaiolino@redhat.com> <20180914132616.GC27382@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180914132616.GC27382@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Fri, Sep 14, 2018 at 03:26:16PM +0200, Christoph Hellwig wrote: > On Wed, Sep 12, 2018 at 02:25:36PM +0200, Carlos Maiolino wrote: > > static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block) > > { > > + sector_t blk_map = 0; > > + int ret; > > struct inode *inode; > > struct inode *lower_inode; > > > > inode = (struct inode *)mapping->host; > > lower_inode = ecryptfs_inode_to_lower(inode); > > + > > + ret = bmap(lower_inode, &blk_map); > > + > > + return !ret ? blk_map : 0; > > This could be simplified to: > > static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block) > { > struct inode *lower_inode = ecryptfs_inode_to_lower(mapping->host); > int ret = bmap(lower_inode, &block); > > if (ret) > return 0; > return block; > } I can change, without problem. > > But the idea that we even support ->bmap on ecryptfs sounds way too > dangerous. I can't argue here, I don't know much about ecryptfs, I just replaced the ->bmap call keeping the same logic, but thanks a lot for the review, I'll update it and send a V2 -- Carlos