Skip to content

Commit

Permalink
Ext2: mark inode dirty after the function dquot_free_block_nodirty is…
Browse files Browse the repository at this point in the history
… called

We should mark inode dirty after the function dquot_free_block_nodirty
is called.Besides,add a check whether it is necessary to call
dquot_free_block_nodirty functon.

Signed-off-by: Wang Shilong <[email protected]>
Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
Wang Shilong authored and jankara committed Feb 7, 2013
1 parent 98783e4 commit 8e3dffc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions fs/ext2/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,11 @@ void ext2_free_blocks (struct inode * inode, unsigned long block,
}
error_return:
brelse(bitmap_bh);
release_blocks(sb, freed);
dquot_free_block_nodirty(inode, freed);
if (freed) {
release_blocks(sb, freed);
dquot_free_block_nodirty(inode, freed);
mark_inode_dirty(inode);
}
}

/**
Expand Down Expand Up @@ -1412,9 +1415,11 @@ ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,

*errp = 0;
brelse(bitmap_bh);
dquot_free_block_nodirty(inode, *count-num);
mark_inode_dirty(inode);
*count = num;
if (num < *count) {
dquot_free_block_nodirty(inode, *count-num);
mark_inode_dirty(inode);
*count = num;
}
return ret_block;

io_error:
Expand Down

0 comments on commit 8e3dffc

Please sign in to comment.