lkml.org 
[lkml]   [2024]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 10/13] ocfs2: fiemap: return correct extent physical length
On Wed 03-04-24 03:22:51, Sweet Tea Dorminy wrote:
> Signed-off-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
> ---
> fs/ocfs2/extent_map.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c
> index eabdf97cd685..229ea45df37b 100644
> --- a/fs/ocfs2/extent_map.c
> +++ b/fs/ocfs2/extent_map.c
> @@ -705,7 +705,9 @@ static int ocfs2_fiemap_inline(struct inode *inode, struct buffer_head *di_bh,
> unsigned int id_count;
> struct ocfs2_dinode *di;
> u64 phys;
> - u32 flags = FIEMAP_EXTENT_DATA_INLINE|FIEMAP_EXTENT_LAST;
> + u32 flags = (FIEMAP_EXTENT_DATA_INLINE|
> + FIEMAP_EXTENT_HAS_PHYS_LEN|
> + FIEMAP_EXTENT_LAST);
> struct ocfs2_inode_info *oi = OCFS2_I(inode);
>
> di = (struct ocfs2_dinode *)di_bh->b_data;
> @@ -782,7 +784,7 @@ int ocfs2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
> continue;
> }
>
> - fe_flags = 0;
> + fe_flags = FIEMAP_EXTENT_HAS_PHYS_LEN;
> if (rec.e_flags & OCFS2_EXT_UNWRITTEN)
> fe_flags |= FIEMAP_EXTENT_UNWRITTEN;
> if (rec.e_flags & OCFS2_EXT_REFCOUNTED)

Again, we should be passing non-zero phys_len if we set
FIEMAP_EXTENT_HAS_PHYS_LEN flag AFAIU.

Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR

\
 
 \ /
  Last update: 2024-05-27 16:22    [W:0.271 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site