[PATCH v3 4/9] cachefiles: propagate errors from vfs_getxattr() to avoid infinite loop
Gao Xiang
hsiangkao at linux.alibaba.com
Fri Jun 28 17:30:35 AEST 2024
On 2024/6/28 14:29, libaokun at huaweicloud.com wrote:
> From: Baokun Li <libaokun1 at huawei.com>
>
> In cachefiles_check_volume_xattr(), the error returned by vfs_getxattr()
> is not passed to ret, so it ends up returning -ESTALE, which leads to an
> endless loop as follows:
>
> cachefiles_acquire_volume
> retry:
> ret = cachefiles_check_volume_xattr
> ret = -ESTALE
> xlen = vfs_getxattr // return -EIO
> // The ret is not updated when xlen < 0, so -ESTALE is returned.
> return ret
> // Supposed to jump out of the loop at this judgement.
> if (ret != -ESTALE)
> goto error_dir;
> cachefiles_bury_object
> // EIO causes rename failure
> goto retry;
>
> Hence propagate the error returned by vfs_getxattr() to avoid the above
> issue. Do the same in cachefiles_check_auxdata().
>
> Fixes: 32e150037dce ("fscache, cachefiles: Store the volume coherency data")
> Fixes: 72b957856b0c ("cachefiles: Implement metadata/coherency data storage in xattrs")
> Signed-off-by: Baokun Li <libaokun1 at huawei.com>
It looks good to me,
Reviewed-by: Gao Xiang <hsiangkao at linux.alibaba.com>
Thanks,
Gao Xiang
More information about the Linux-erofs
mailing list