summaryrefslogtreecommitdiff
path: root/fs/ext4/balloc.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-08-25 10:54:07 +0200
committerIngo Molnar <mingo@elte.hu>2008-08-25 10:54:07 +0200
commite4f807c2b4d81636fc63993368646c5bfd42b22f (patch)
tree2ff100911b1ba4e26e3d9aad41edb9b48405f01e /fs/ext4/balloc.c
parent25258ef762bc4a05fa9c4523f7dae56e3fd01864 (diff)
parent83097aca8567a0bd593534853b71fe0fa9a75d69 (diff)
Merge branch 'linus' into x86/xen
Conflicts: arch/x86/kernel/paravirt.c Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r--fs/ext4/balloc.c3
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,
free_blocks =
percpu_counter_sum_and_set(&sbi->s_freeblocks_counter);
#endif
+ if (free_blocks <= root_blocks)
+ /* we don't have free space */
+ return 0;
if (free_blocks - root_blocks < nblocks)
return free_blocks - root_blocks;
return nblocks;