[PATCH v2] erofs: fix refcount on the metabuf used for inode lookup

Gao Xiang hsiangkao at linux.alibaba.com
Thu Feb 22 11:42:46 AEDT 2024



On 2024/2/22 05:03, Sandeep Dhavale wrote:
> In erofs_find_target_block() when erofs_dirnamecmp() returns 0,
> we do not assign the target metabuf. This causes the caller
> erofs_namei()'s erofs_put_metabuf() at the end to be not effective
> leaving the refcount on the page.
> As the page from metabuf (buf->page) is never put, such page cannot be
> migrated or reclaimed. Fix it now by putting the metabuf from
> previous loop and assigning the current metabuf to target before
> returning so caller erofs_namei() can do the final put as it was
> intended.
> 
> Fixes: 500edd095648 ("erofs: use meta buffers for inode lookup")
> Cc: stable at vger.kernel.org
> Signed-off-by: Sandeep Dhavale <dhavale at google.com>

Reviewed-by: Gao Xiang <hsiangkao at linux.alibaba.com>

Thanks,
Gao Xiang


More information about the Linux-erofs mailing list