On 1/29/20 9:48 PM, Darrick J. Wong wrote:
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@xxxxxxxxxxxxx>
---
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.
Oops.. my bad. I got it confused with EA inode feature.
Urghh... I should remove my bias while looking at a review comment.
so I think for i_file_acl (external block) we should set
iomap->type = IOMAP_MAPPED.
Will fix this and submit in the same thread. Thanks for catching it.
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.
Thanks.
--D
-ritesh