Skip to contentSkip to conversation

ocfs2: rollback the cleared bits if error occurs after ocfs2_block_group_clear_bits

PATCH New Joseph Qi 1 participant 1 message Mar 17, 2015 OCFS2

lore
Share & tools
lore

Joseph Qi

author
#0 lore raw

PATCH 1/1 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.

---
 fs/ocfs2/suballoc.c | 2 ++
 1 file changed, 2 insertions(+)
fs/ocfs2/suballoc.c +2 -0
index 0cb889a..4479029 100644
@@ -2499,6 +2499,8 @@ static int _ocfs2_free_suballoc_bits(handle_t *handle,
 					 alloc_bh, OCFS2_JOURNAL_ACCESS_WRITE);
 	if (status < 0) {
 		mlog_errno(status);
+		ocfs2_block_group_set_bits(handle, alloc_inode, group, group_bh,
+				start_bit, count);
 		goto bail;
 	}
 
Signature · 1 line
1.8.4.3