Skip to content

Commit 65aa5f6

Browse files
Jia Zhudhowells
authored andcommitted
cachefiles: narrow the scope of flushed requests when releasing fd
When an anonymous fd is released, only flush the requests associated with it, rather than all of requests in xarray. Fixes: 9032b6e ("cachefiles: implement on-demand read") Signed-off-by: Jia Zhu <zhujia.zj@bytedance.com> Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeffle Xu <jefflexu@linux.alibaba.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://listman.redhat.com/archives/linux-cachefs/2022-June/006937.html
1 parent 5c4588a commit 65aa5f6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/cachefiles/ondemand.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ static int cachefiles_ondemand_fd_release(struct inode *inode,
2121
* anon_fd.
2222
*/
2323
xas_for_each(&xas, req, ULONG_MAX) {
24-
if (req->msg.opcode == CACHEFILES_OP_READ) {
24+
if (req->msg.object_id == object_id &&
25+
req->msg.opcode == CACHEFILES_OP_READ) {
2526
req->error = -EIO;
2627
complete(&req->done);
2728
xas_store(&xas, NULL);

0 commit comments

Comments
 (0)