[PATCH v3] erofs-utils: fuse: fix random readlink error

胡玮文 sehuww at mail.scut.edu.cn
Sun Feb 14 01:36:36 AEDT 2021


On Wed, Feb 10, 2021 at 03:38:50AM +0800, Gao Xiang wrote:

...

> From bfbd8ee056aca57a77034b8723f3f828f806747b Mon Sep 17 00:00:00 2001
> From: Hu Weiwen <sehuww at mail.scut.edu.cn>
> Date: Sat, 30 Jan 2021 02:07:47 +0800
> Subject: [PATCH v3] erofs-utils: fuse: fix random readlink error
> 
> readlink should fill a **null-terminated** string in the buffer [1].
> 
> To achieve this:
> 1) memset(0) for unmapped extents;
> 2) make erofsfuse_read() properly returning the actual bytes read;
> 3) insert a null character if the path is truncated.
> 
> [1] https://lore.kernel.org/r/20210121101233.GC6680@DESKTOP-N4CECTO.huww98.cn
> Signed-off-by: Hu Weiwen <sehuww at mail.scut.edu.cn>
> Signed-off-by: Gao Xiang <hsiangkao at aol.com>

It looks good. I've run this patched version against previously failing tests.

Also now I understand the purpose of erofs_map_blocks_flatmode() better.

Thanks,
Hu Weiwen



More information about the Linux-erofs mailing list