[PATCH] erofs-utils: erofs-utils: lib: fix dev_read

Gao Xiang hsiangkao at linux.alibaba.com
Fri Oct 21 18:32:27 AEDT 2022


On Fri, Oct 21, 2022 at 02:43:32PM +0800, Chen Linxuan wrote:
> When using `fsck.erofs` to extract some image have a very large file
> inside, for example 2G, my fsck.erofs report some thing like this:
> 
> <E> erofs_io: Failed to read data from device - erofs.image:[4096,
> 2147483648].
> <E> erofs: failed to read data of m_pa 4096, m_plen 2147483648 @ nid 40: -17
> <E> erofs: Failed to extract filesystem
> 
> You can use this script to reproduce this issue.
> 
> mkdir tmp extract
> dd if=/dev/urandom of=tmp/big_file bs=1M count=2048
> 
> mkfs.erofs erofs.image tmp
> fsck.erofs erofs.image --extract=extract
> 
> I found that dev_open will failed if we can not get all data we want
> with one pread call.
> 
> I write this little patch try to fix this issue.
> 
> Signed-off-by: Chen Linxuan <chenlinxuan at uniontech.com>

Reviewed-by: Gao Xiang <hsiangkao at linux.alibaba.com>
(I will fix up the subject to
 "erofs-utils: lib: fix dev_read for large files")

Thanks,
Gao Xiang


More information about the Linux-erofs mailing list