[Midnightbsd-cvs] src [8656] trunk/sbin/fsck_ffs/suj.c: blk_equals() is too strict.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Sep 25 16:04:29 EDT 2016
Revision: 8656
http://svnweb.midnightbsd.org/src/?rev=8656
Author: laffer1
Date: 2016-09-25 16:04:29 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
blk_equals() is too strict. if the journal entry defines more frags than we claim it should still be considered an exact mmatch.
Modified Paths:
--------------
trunk/sbin/fsck_ffs/suj.c
Modified: trunk/sbin/fsck_ffs/suj.c
===================================================================
--- trunk/sbin/fsck_ffs/suj.c 2016-09-25 20:03:48 UTC (rev 8655)
+++ trunk/sbin/fsck_ffs/suj.c 2016-09-25 20:04:29 UTC (rev 8656)
@@ -504,7 +504,7 @@
return (0);
if (brec->jb_blkno + brec->jb_oldfrags != start)
return (0);
- if (brec->jb_frags != frags)
+ if (brec->jb_frags < frags)
return (0);
return (1);
}
@@ -551,7 +551,6 @@
brec = (struct jblkrec *)srec->sr_rec;
/*
* If the block overlaps but does not match
- * exactly it's a new allocation. If it matches
* exactly this record refers to the current
* location.
*/
@@ -648,7 +647,8 @@
uint8_t *blksfree;
if (debug)
- printf("Freeing %d frags at blk %jd\n", frags, bno);
+ printf("Freeing %d frags at blk %jd mask 0x%x\n",
+ frags, bno, mask);
cg = dtog(fs, bno);
sc = cg_lookup(cg);
cgp = sc->sc_cgp;
@@ -1140,12 +1140,8 @@
static void
blk_free_visit(ino_t ino, ufs_lbn_t lbn, ufs2_daddr_t blk, int frags)
{
- int mask;
- mask = blk_freemask(blk, ino, lbn, frags);
- if (debug)
- printf("blk %jd freemask 0x%X\n", blk, mask);
- blk_free(blk, mask, frags);
+ blk_free(blk, blk_freemask(blk, ino, lbn, frags), frags);
}
/*
@@ -1160,8 +1156,6 @@
int mask;
mask = blk_freemask(blk, ino, lbn, frags);
- if (debug)
- printf("blk %jd freemask 0x%X\n", blk, mask);
resid = 0;
if (lbn <= -NDADDR && follow && mask == 0)
indir_visit(ino, lbn, blk, &resid, blk_free_visit, VISIT_INDIR);
@@ -2328,6 +2322,10 @@
}
if (newseq != oldseq) {
+ TAILQ_FOREACH(seg, &allsegs, ss_next) {
+ printf("%jd, ", seg->ss_rec.jsr_seq);
+ }
+ printf("\n");
err_suj("Journal file sequence mismatch %jd != %jd\n",
newseq, oldseq);
}
More information about the Midnightbsd-cvs
mailing list