diff options
-rw-r--r-- | fs/ext4/balloc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 1ae5004e93fc..e9fa960ba6da 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -1626,6 +1626,9 @@ ext4_fsblk_t ext4_has_free_blocks(struct ext4_sb_info *sbi, | |||
1626 | free_blocks = | 1626 | free_blocks = |
1627 | percpu_counter_sum_and_set(&sbi->s_freeblocks_counter); | 1627 | percpu_counter_sum_and_set(&sbi->s_freeblocks_counter); |
1628 | #endif | 1628 | #endif |
1629 | if (free_blocks <= root_blocks) | ||
1630 | /* we don't have free space */ | ||
1631 | return 0; | ||
1629 | if (free_blocks - root_blocks < nblocks) | 1632 | if (free_blocks - root_blocks < nblocks) |
1630 | return free_blocks - root_blocks; | 1633 | return free_blocks - root_blocks; |
1631 | return nblocks; | 1634 | return nblocks; |