lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200129161839.GA3674276@magnolia>
Date:   Wed, 29 Jan 2020 08:18:39 -0800
From:   "Darrick J. Wong" <darrick.wong@...cle.com>
To:     Ritesh Harjani <riteshh@...ux.ibm.com>
Cc:     jack@...e.cz, tytso@....edu, adilger.kernel@...ger.ca,
        linux-ext4@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        hch@...radead.org, cmaiolino@...hat.com
Subject: Re: [RFCv2 4/4] ext4: Move ext4_fiemap to use iomap infrastructure

On Wed, Jan 29, 2020 at 11:49:38AM +0530, Ritesh Harjani wrote:
> Hello Darrick,
> 
> On 1/28/20 8:58 PM, Darrick J. Wong wrote:
> > On Tue, Jan 28, 2020 at 03:48:28PM +0530, Ritesh Harjani wrote:
> > > Since ext4 already defines necessary iomap_ops required to move to iomap
> > > for fiemap, so this patch makes those changes to use existing iomap_ops
> > > for ext4_fiemap and thus removes all unwanted code.
> > > 
> > > Signed-off-by: Ritesh Harjani <riteshh@...ux.ibm.com>
> > > ---
> > >   fs/ext4/extents.c | 279 +++++++---------------------------------------
> > >   fs/ext4/inline.c  |  41 -------
> > >   2 files changed, 38 insertions(+), 282 deletions(-)
> > > 
> > > diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> > > index 0de548bb3c90..901caee2fcb1 100644
> > > --- a/fs/ext4/extents.c
> > > +++ b/fs/ext4/extents.c
> > 
> > <snip> Just a cursory glance...
> > 
> > > @@ -5130,40 +4927,42 @@ static int ext4_xattr_fiemap(struct inode *inode,
> > >   				EXT4_I(inode)->i_extra_isize;
> > >   		physical += offset;
> > >   		length = EXT4_SB(inode->i_sb)->s_inode_size - offset;
> > > -		flags |= FIEMAP_EXTENT_DATA_INLINE;
> > >   		brelse(iloc.bh);
> > >   	} else { /* external block */
> > >   		physical = (__u64)EXT4_I(inode)->i_file_acl << blockbits;
> > >   		length = inode->i_sb->s_blocksize;
> > >   	}
> > > -	if (physical)
> > > -		error = fiemap_fill_next_extent(fieinfo, 0, physical,
> > > -						length, flags);
> > > -	return (error < 0 ? error : 0);
> > > +	iomap->addr = physical;
> > > +	iomap->offset = 0;
> > > +	iomap->length = length;
> > > +	iomap->type = IOMAP_INLINE;
> > > +	iomap->flags = 0;
> > 
> > Er... external "ACL" blocks aren't IOMAP_INLINE.
> 
> Sorry, I should have mentioned about this too in the cover letter.
> So current patchset is mainly only converting bmap & fiemap to use iomap
> APIs. Even the original implementation does not have external ACL block
> implemented for xattr_fiemap.

Er ... yes it did.  The "} else { /* external block */" block sets
physical to i_file_acl.

> Let me spend some time to implement it. But I would still like to keep
> that as a separate patch.
> 
> But thanks for looking into it. There's this point 2.a & 2.b mentioned in
> the cover letter where I could really use your help in understanding
> if all of that is a known behavior from iomap_fiemap side
> (whenever you have some time of course :) )

i'll go have a look.

--D

> -ritesh
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ