Skip to content

Commit

Permalink
fs/dax.c: fix inefficiency in dax_writeback_mapping_range()
Browse files Browse the repository at this point in the history
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/[email protected]
Fixes: 9973c98 ("dax: add support for fsync/sync")
Signed-off-by: Jan Kara <[email protected]>
Reviewed-by: Ross Zwisler <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
jankara authored and torvalds committed Jun 23, 2017
1 parent 9fa4eb8 commit 1eb643d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/dax.c
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,7 @@ int dax_writeback_mapping_range(struct address_space *mapping,
if (ret < 0)
goto out;
}
start_index = indices[pvec.nr - 1] + 1;
}
out:
put_dax(dax_dev);
Expand Down

0 comments on commit 1eb643d

Please sign in to comment.