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

alex chen alex.chen at huawei.com
Wed Mar 4 20:10:33 PST 2015


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 overwrited 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>
Reviewed-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