Skip to content

Commit a47726b

Browse files
josephhztorvalds
authored andcommitted
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>
1 parent 62f8b1f commit a47726b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/ocfs2/suballoc.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,6 +2499,8 @@ static int _ocfs2_free_suballoc_bits(handle_t *handle,
24992499
alloc_bh, OCFS2_JOURNAL_ACCESS_WRITE);
25002500
if (status < 0) {
25012501
mlog_errno(status);
2502+
ocfs2_block_group_set_bits(handle, alloc_inode, group, group_bh,
2503+
start_bit, count);
25022504
goto bail;
25032505
}
25042506

0 commit comments

Comments
 (0)