When we are reclaiming inodes which have I_METADATA_WRITEBACK set, we have to callback into the filesystem to write out any dirty metadata associated with the inode since we are going to loose track of it. This will require IO and is problematic from memory reclaim paths. Defer reclaim of inodes with I_METADATA_WRITEBACK set. Reported-by: Christian Brauner (Amutable) Signed-off-by: Jan Kara --- fs/inode.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/inode.c b/fs/inode.c index e6af38faa964..5cc36e3df2e8 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1084,7 +1084,8 @@ long prune_icache_sb(struct super_block *sb, struct shrink_control *sc) inode_lru_isolate, &freeable); list_for_each_entry_safe(inode, tmp, &freeable, i_lru) { - if (inode_state_read_once(inode) & I_DEFER_RECLAIM) { + if (inode_state_read_once(inode) & + (I_DEFER_RECLAIM | I_METADATA_WRITEBACK)) { deferred++; continue; } -- 2.53.0