diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-07-16 16:28:47 +0200 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-07-16 16:28:47 +0200 |
commit | 63b999685cb372e24eb73f255cd73547026370fd (patch) | |
tree | 92053ac3ca2fa7ba351fce31d558ba13cc37926d /fs/ext4/extents.c | |
parent | ext4: yield during large unlinks (diff) | |
download | linux-63b999685cb372e24eb73f255cd73547026370fd.tar.xz linux-63b999685cb372e24eb73f255cd73547026370fd.zip |
ext4: call ext4_es_lru_add() after handling cache miss
If there are no items in the extent status tree, ext4_es_lru_add() is
a no-op. So it is not sufficient to call ext4_es_lru_add() before we
try to lookup an entry in the extent status tree. We also need to
call it at the end of ext4_ext_map_blocks(), after items have been
added to the extent status tree.
This could lead to inodes with that have extent status trees but which
are not in the LRU list, which means they won't get considered for
eviction by the es_shrinker.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Zheng Liu <wenqing.lz@taobao.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/ext4/extents.c')
-rw-r--r-- | fs/ext4/extents.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index cfdc51e30257..a61873808f76 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -4385,8 +4385,9 @@ out2: } out3: - trace_ext4_ext_map_blocks_exit(inode, flags, map, err ? err : allocated); - + trace_ext4_ext_map_blocks_exit(inode, flags, map, + err ? err : allocated); + ext4_es_lru_add(inode); return err ? err : allocated; } |