linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fuse: fix return value of inode_inline_reclaim_one_dmap in error path
@ 2023-04-24 12:32 Jingbo Xu
  2023-05-17  0:07 ` Jingbo Xu
       [not found] ` <ZHeoIFrp303f0E8d@redhat.com>
  0 siblings, 2 replies; 6+ messages in thread
From: Jingbo Xu @ 2023-04-24 12:32 UTC (permalink / raw)
  To: miklos, vgoyal, linux-fsdevel; +Cc: gerry, linux-kernel

When range already got reclaimed by somebody else, return NULL so that
the caller could retry to allocate or reclaim another range, instead of
mistakenly returning the range already got reclaimed and reused by
others.

Reported-by: Liu Jiang <gerry@linux.alibaba.com>
Fixes: 9a752d18c85a ("virtiofs: add logic to free up a memory range")
Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com>
---
 fs/fuse/dax.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c
index 8e74f278a3f6..59aadfd89ee5 100644
--- a/fs/fuse/dax.c
+++ b/fs/fuse/dax.c
@@ -985,6 +985,7 @@ inode_inline_reclaim_one_dmap(struct fuse_conn_dax *fcd, struct inode *inode,
 	node = interval_tree_iter_first(&fi->dax->tree, start_idx, start_idx);
 	/* Range already got reclaimed by somebody else */
 	if (!node) {
+		dmap = NULL;
 		if (retry)
 			*retry = true;
 		goto out_write_dmap_sem;
-- 
2.19.1.6.gb485710b


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-20  3:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-24 12:32 [PATCH] fuse: fix return value of inode_inline_reclaim_one_dmap in error path Jingbo Xu
2023-05-17  0:07 ` Jingbo Xu
     [not found] ` <ZHeoIFrp303f0E8d@redhat.com>
2023-06-01  1:45   ` Jingbo Xu
2023-06-01 11:45     ` Vivek Goyal
2023-06-02  2:01       ` Jingbo Xu
2023-06-20  3:50       ` Jingbo Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).