diff options
author | Joseph Qi <joseph.qi@huawei.com> | 2015-04-14 18:43:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 19:48:58 -0400 |
commit | a47726bcf299db6b5743d574df36c423263b4e65 (patch) | |
tree | db86b25fa9dac5b76e0cbbf1973d5359306bab6e /fs/ocfs2/suballoc.c | |
parent | 62f8b1f0d609838361d65b5b2114859d464e6baa (diff) |
ocfs2: rollback the cleared bits if error occurs after ocfs2_block_group_clear_bits
ocfs2_block_group_clear_bits will clear bits in block group bitmap.
Once it succeeds but fails in the following step, it will cause block
group bitmap mismatch the corresponding count recorded in dinode.
So rollback the cleared bits if error occurs.
Signed-off-by: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/suballoc.c')
-rw-r--r-- | fs/ocfs2/suballoc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c index 0cb889a17ae1..4479029630bb 100644 --- a/fs/ocfs2/suballoc.c +++ b/fs/ocfs2/suballoc.c | |||
@@ -2499,6 +2499,8 @@ static int _ocfs2_free_suballoc_bits(handle_t *handle, | |||
2499 | alloc_bh, OCFS2_JOURNAL_ACCESS_WRITE); | 2499 | alloc_bh, OCFS2_JOURNAL_ACCESS_WRITE); |
2500 | if (status < 0) { | 2500 | if (status < 0) { |
2501 | mlog_errno(status); | 2501 | mlog_errno(status); |
2502 | ocfs2_block_group_set_bits(handle, alloc_inode, group, group_bh, | ||
2503 | start_bit, count); | ||
2502 | goto bail; | 2504 | goto bail; |
2503 | } | 2505 | } |
2504 | 2506 | ||