[Ocfs2-tools-devel] [PATCH RESEND] fsck.ocfs2: do not remove the chain when verifying global bitmap chain alloc

Joseph Qi joseph.qi at huawei.com
Tue Mar 8 23:59:27 PST 2016


From: Alex Chen <alex.chen at huawei.com>

In verify_chain_alloc(), when cr->c_blkno is equal to 0 we think this
chain record is missing, we remove the chain and move the last chain into
this missing chain record. But it's not necessary to remove the missing
chain record when we verify the global bitmap chain allocator, otherwise,
the last chain record will be overwritten when we recover the missing
chain record in verify_bitmap_descs(), in this way, the last chain record
will be lost forever.

Signed-off-by: Alex Chen <alex.chen at huawei.com>
Signed-off-by: Joseph Qi <joseph.qi at huawei.com>
---
 fsck.ocfs2/pass0.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fsck.ocfs2/pass0.c b/fsck.ocfs2/pass0.c
index bb05040..ea20f4a 100755
--- a/fsck.ocfs2/pass0.c
+++ b/fsck.ocfs2/pass0.c
@@ -1095,7 +1095,8 @@ static errcode_t verify_chain_alloc(o2fsck_state *ost,
 			free += cs.cs_free_bits;
 			total += cs.cs_total_bits;
 			continue;
-		}
+		} else if (allowed && forbidden)
+			continue;

 		if (prompt(ost, PY, PR_CHAIN_EMPTY,
 			   "Chain %d in allocator inode %"PRIu64" "
-- 
1.8.4.3




More information about the Ocfs2-tools-devel mailing list