fsck.gfs2: "undo" functions can stop too early on duplicates
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 fsck.gfs2: "undo" functions can stop too early on duplicates
Hi,
This patch addresses a bug in which blocks may not be freed properly because the "undo" processing in pass1 can stop early when duplicate data blocks are encountered. What happens is this: The "undo" process called from metawalk.c is coded to stop its undo when it encounters the block containing corruption. However, if the block containing the corruption is actually the second reference to the same block, inside the same dinode, the undo process stops early when it encounters the first reference. The problem is that it's coded to stop when it sees a reference to the corrupt block. That's wrong. It should really stop when it sees the reference to that block that triggered the "unrecoverable" error. In other words, when it hits that exact metadata block and its offset. This patch scraps the old system of looking for the corrupt block in favor of looking for the corrupt reference, including metadata block and offset within that block.
---
gfs2/fsck/fsck.h +6 -0
@@ -106,6 +106,12 @@ enum rgindex_trust_level { /* how far can we trust our RG index? */must have been converted from gfs2_convert. */ }; +struct error_block { +uint64_t metablk;/* metadata block where error was found */ +int metaoff;/* offset in that metadata block where error found */ +uint64_t errblk;/* error block */ +}; +extern struct gfs2_inode *fsck_load_inode (struct gfs2_sbd *sdp,uint64_t block); extern struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct rgrp_tree *rgd,
gfs2/fsck/metawalk.c +57 -20
141 lines not on this page · raw message