From 3c100a36d5399238efa0a142771a3898a866e4f4 Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Mon, 5 Jan 2009 21:49:12 -0500 Subject: [PATCH] --- yaml --- r: 127960 b: refs/heads/master c: 0087d9fb3f29f59e8d42c8b058376d80e5adde4c h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/mballoc.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 65d42e3bc7ac..fabf798a16cf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 29eaf024980e07cc01f31ae4ea5d68c917f4b7da +refs/heads/master: 0087d9fb3f29f59e8d42c8b058376d80e5adde4c diff --git a/trunk/fs/ext4/mballoc.c b/trunk/fs/ext4/mballoc.c index fd2294de404c..05d9f81956c6 100644 --- a/trunk/fs/ext4/mballoc.c +++ b/trunk/fs/ext4/mballoc.c @@ -4541,7 +4541,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, } if (ar->len == 0) { *errp = -EDQUOT; - return 0; + goto out3; } inquota = ar->len; @@ -4614,6 +4614,13 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, out1: if (ar->len < inquota) DQUOT_FREE_BLOCK(ar->inode, inquota - ar->len); +out3: + if (!ar->len) { + if (!EXT4_I(ar->inode)->i_delalloc_reserved_flag) + /* release all the reserved blocks if non delalloc */ + percpu_counter_sub(&sbi->s_dirtyblocks_counter, + reserv_blks); + } return block; }