diff options
-rw-r--r-- | fs/ext4/inode.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index ab807963a614..282621f18c10 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2993,11 +2993,18 @@ static int ext4_nonda_switch(struct super_block *sb) | |||
2993 | if (2 * free_blocks < 3 * dirty_blocks || | 2993 | if (2 * free_blocks < 3 * dirty_blocks || |
2994 | free_blocks < (dirty_blocks + EXT4_FREEBLOCKS_WATERMARK)) { | 2994 | free_blocks < (dirty_blocks + EXT4_FREEBLOCKS_WATERMARK)) { |
2995 | /* | 2995 | /* |
2996 | * free block count is less that 150% of dirty blocks | 2996 | * free block count is less than 150% of dirty blocks |
2997 | * or free blocks is less that watermark | 2997 | * or free blocks is less than watermark |
2998 | */ | 2998 | */ |
2999 | return 1; | 2999 | return 1; |
3000 | } | 3000 | } |
3001 | /* | ||
3002 | * Even if we don't switch but are nearing capacity, | ||
3003 | * start pushing delalloc when 1/2 of free blocks are dirty. | ||
3004 | */ | ||
3005 | if (free_blocks < 2 * dirty_blocks) | ||
3006 | writeback_inodes_sb_if_idle(sb); | ||
3007 | |||
3001 | return 0; | 3008 | return 0; |
3002 | } | 3009 | } |
3003 | 3010 | ||