Skip to content

Commit 1eb643d

Browse files
jankaratorvalds
authored andcommitted
fs/dax.c: fix inefficiency in dax_writeback_mapping_range()
dax_writeback_mapping_range() fails to update iteration index when searching radix tree for entries needing cache flushing. Thus each pagevec worth of entries is searched starting from the start which is inefficient and prone to livelocks. Update index properly. Link: http://lkml.kernel.org/r/20170619124531.21491-1-jack@suse.cz Fixes: 9973c98 ("dax: add support for fsync/sync") Signed-off-by: Jan Kara <jack@suse.cz> Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com> Cc: Dan Williams <dan.j.williams@intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 9fa4eb8 commit 1eb643d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/dax.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ int dax_writeback_mapping_range(struct address_space *mapping,
859859
if (ret < 0)
860860
goto out;
861861
}
862+
start_index = indices[pvec.nr - 1] + 1;
862863
}
863864
out:
864865
put_dax(dax_dev);

0 commit comments

Comments
 (0)