f2fs: check bdi->dirty_exceeded when trying to skip data writes
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 27 Jun 2014 16:00:41 +0000 (01:00 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 9 Jul 2014 12:59:45 +0000 (05:59 -0700)
If we don't check the current backing device status, balance_dirty_pages can
fall into infinite pausing routine.

This can be occurred when a lot of directories make a small number of dirty
dentry pages including files.

Reported-by: Brian Chadwick <brianchad@westnet.com.au>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/node.c

index 9dfb9a042fd295bf20d31cf1bb4d8f280a631368..4b697ccc9b0cd248003062a34d0bea8fda720428 100644 (file)
@@ -42,6 +42,8 @@ bool available_free_memory(struct f2fs_sb_info *sbi, int type)
                mem_size = (nm_i->nat_cnt * sizeof(struct nat_entry)) >> 12;
                res = mem_size < ((val.totalram * nm_i->ram_thresh / 100) >> 2);
        } else if (type == DIRTY_DENTS) {
+               if (sbi->sb->s_bdi->dirty_exceeded)
+                       return false;
                mem_size = get_pages(sbi, F2FS_DIRTY_DENTS);
                res = mem_size < ((val.totalram * nm_i->ram_thresh / 100) >> 1);
        }