[RFC PATCH] erofs-utils: fsck: support fragments

Yue Hu zbestahu at gmail.com
Wed Jan 4 18:26:51 AEDT 2023


On Wed, 4 Jan 2023 11:32:36 +0800
Xiang Gao <hsiangkao at linux.alibaba.com> wrote:

> On 2023/1/4 11:24, Yue Hu wrote:
> > Hi Xiang,
> > 
> > On Wed, 4 Jan 2023 10:48:40 +0800
> > Xiang Gao <hsiangkao at linux.alibaba.com> wrote:
> >   
> >> Hi Yue,
> >>
> >> 在 2022/12/24 17:43, Yue Hu 写道:  
> >>> From: Yue Hu <huyue2 at coolpad.com>
> >>>
> >>> Add compressed fragments support for fsck.erofs.
> >>>
> >>> Signed-off-by: Yue Hu <huyue2 at coolpad.com>
> >>> ---
> >>>    fsck/main.c | 41 +++++++++++++++++++++++++++++++++++++++--
> >>>    lib/zmap.c  |  1 +
> >>>    2 files changed, 40 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/fsck/main.c b/fsck/main.c
> >>> index 2a9c501..9babc61 100644
> >>> --- a/fsck/main.c
> >>> +++ b/fsck/main.c
> >>> @@ -421,6 +421,31 @@ static int erofs_verify_inode_data(struct erofs_inode *inode, int outfd)
> >>>    		if (!(map.m_flags & EROFS_MAP_MAPPED) || !fsckcfg.check_decomp)
> >>>    			continue;
> >>>    
> >>> +		if (map.m_flags & EROFS_MAP_FRAGMENT) {
> >>> +			struct erofs_inode packed_inode = {
> >>> +				.nid = sbi.packed_nid,
> >>> +			};  
> >>
> >> Sorry for late response.
> >>
> >> a question... why don't we just rely on z_erofs_read_data()?  
> > 
> > We may fall back to uncompressed mode for packed inode due to 'ENOSPC'.  
> 
> I think we could just export parts of erofs_pread() to clean up the 
> whole erofs_verify_inode_data()...

What's the clean up referring to?

However, i think erofs_verify_inode_data() looks a little duplicate compared to erofs_read_raw_data/z_erofs_read_data().

> 
> Thanks,
> Gao Xiang
> 
> 



More information about the Linux-erofs mailing list