All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2: rollback the cleared bits if error occurs after ocfs2_block_group_clear_bits
@ 2015-03-17  4:07 Joseph Qi
  0 siblings, 0 replies; only message in thread
From: Joseph Qi @ 2015-03-17  4:07 UTC (permalink / raw)
  To: ocfs2-devel

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>
---
 fs/ocfs2/suballoc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
index 0cb889a..4479029 100644
--- a/fs/ocfs2/suballoc.c
+++ b/fs/ocfs2/suballoc.c
@@ -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;
 	}

-- 
1.8.4.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-03-17  4:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-17  4:07 [Ocfs2-devel] [PATCH] ocfs2: rollback the cleared bits if error occurs after ocfs2_block_group_clear_bits Joseph Qi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.