[PATCH 3/5] erofs-utils: fix the wrong address of inline dir content.

Gao Xiang hsiangkao at aol.com
Sat Oct 17 02:36:03 AEDT 2020


On Thu, Oct 15, 2020 at 09:39:57PM +0800, Huang Jianan wrote:
> Signed-off-by: Huang Jianan <huangjianan at oppo.com>
> Signed-off-by: Guo Weichao <guoweichao at oppo.com>
> ---
>  fuse/namei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fuse/namei.c b/fuse/namei.c
> index 21e6ba0..3503a8d 100644
> --- a/fuse/namei.c
> +++ b/fuse/namei.c
> @@ -158,7 +158,7 @@ struct dcache_entry *disk_lookup(struct dcache_entry *parent, const char *name,
>  	if (v.datalayout == EROFS_INODE_FLAT_INLINE) {
>  		uint32_t dir_off = erofs_blkoff(dirsize);
>  		off_t dir_addr = nid2addr(dcache_get_nid(parent))
> -			+ sizeof(struct erofs_inode_compact);
> +			+ sizeof(struct erofs_inode_compact) + v.xattr_isize;

hmm... just considering this line, I think it should be

+               off_t dir_addr = nid2addr(dcache_get_nid(parent)) +
+                       v.inode_isize + v.xattr_isize;

btw, I've fixed it, will send out the next integrated WIP
erofsfuse patchset.

Thanks,
Gao Xiang

>  
>  		memset(buf, 0, sizeof(buf));
>  		ret = dev_read(buf, dir_off, dir_addr);
> -- 
> 2.25.1
> 


More information about the Linux-erofs mailing list