]> git.baikalelectronics.ru Git - kernel.git/commit
erofs: fix missing xas_retry() in fscache mode
authorJingbo Xu <jefflexu@linux.alibaba.com>
Mon, 14 Nov 2022 12:19:43 +0000 (20:19 +0800)
committerGao Xiang <hsiangkao@linux.alibaba.com>
Mon, 14 Nov 2022 15:48:38 +0000 (23:48 +0800)
commit36bb2bcc76a5b31e8f9ff81d54f7ca80ab016719
tree4d62cb1eda9dd8b6ee2f1059a9746492412c11c4
parent14f0dc86588bbc406d7e325a4816f5e7e797744e
erofs: fix missing xas_retry() in fscache mode

The xarray iteration only holds the RCU read lock and thus may encounter
XA_RETRY_ENTRY if there's process modifying the xarray concurrently.
This will cause oops when referring to the invalid entry.

Fix this by adding the missing xas_retry(), which will make the
iteration wind back to the root node if XA_RETRY_ENTRY is encountered.

Fixes: fbbf592f0c25 ("erofs: change to use asynchronous io for fscache readpage/readahead")
Suggested-by: David Howells <dhowells@redhat.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Jia Zhu <zhujia.zj@bytedance.com>
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
Link: https://lore.kernel.org/r/20221114121943.29987-1-jefflexu@linux.alibaba.com
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
fs/erofs/fscache.c