It is possible that inline reclaim returns null. Continue to wait for free
range in that case.

Signed-off-by: Vivek Goyal <[email protected]>
---
 fs/fuse/file.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index d9bada37d8ef..310fb22b31bd 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -4074,8 +4074,11 @@ static struct fuse_dax_mapping 
*alloc_dax_mapping_reclaim(struct fuse_conn *fc,
                if (dmap)
                        return dmap;

-               if (fi->nr_dmaps)
-                       return inode_reclaim_first_dmap(fc, inode);
+               if (fi->nr_dmaps) {
+                       dmap = inode_reclaim_first_dmap(fc, inode);
+                       if (dmap)
+                               return dmap;
+               }
                /*
                 * There are no mappings which can be reclaimed.
                 * Wait for one.
-- 
2.20.1

Reply via email to