Mercurial > illumos > illumos-gate
changeset 4132:a454cf8a2c90
6547966 panic: free: freeing free block, after newfs -T and fsck
author | abalfour |
---|---|
date | Sat, 28 Apr 2007 19:46:29 -0700 |
parents | 125b20be6798 |
children | 7137952457a5 |
files | usr/src/cmd/fs.d/ufs/fsck/fsck.h usr/src/cmd/fs.d/ufs/fsck/pass1.c usr/src/cmd/fs.d/ufs/fsck/utilities.c |
diffstat | 3 files changed, 19 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/cmd/fs.d/ufs/fsck/fsck.h Sat Apr 28 19:31:51 2007 -0700 +++ b/usr/src/cmd/fs.d/ufs/fsck/fsck.h Sat Apr 28 19:46:29 2007 -0700 @@ -21,7 +21,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -549,7 +549,7 @@ void dirty(struct bufarea *); int do_errorlock(int); int dofix(struct inodesc *, caddr_t, ...); -void examinelog(daddr32_t, void (*)(daddr32_t)); +void examinelog(void (*)(daddr32_t)); void errexit(caddr_t, ...); void fileerror(fsck_ino_t, fsck_ino_t, caddr_t, ...); caddr_t file_id(fsck_ino_t, mode_t);
--- a/usr/src/cmd/fs.d/ufs/fsck/pass1.c Sat Apr 28 19:31:51 2007 -0700 +++ b/usr/src/cmd/fs.d/ufs/fsck/pass1.c Sat Apr 28 19:46:29 2007 -0700 @@ -1,5 +1,5 @@ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -90,7 +90,7 @@ * freeing free block panic. */ if (islog && islogok && sblock.fs_logbno) - examinelog(sblock.fs_logbno, ¬e_used); + examinelog(¬e_used); /* * Find all allocated blocks. This must be completed before
--- a/usr/src/cmd/fs.d/ufs/fsck/utilities.c Sat Apr 28 19:31:51 2007 -0700 +++ b/usr/src/cmd/fs.d/ufs/fsck/utilities.c Sat Apr 28 19:46:29 2007 -0700 @@ -1175,7 +1175,7 @@ /* * If ufs log is not okay, note that we need to clear it. */ - examinelog(sblock.fs_logbno, NULL); + examinelog(NULL); if (fslogbno && !(islog && islogok)) { fsclean = FSACTIVE; fslogbno = 0; @@ -1289,7 +1289,7 @@ printclean(); if (sblock.fs_logbno != fslogbno) { - examinelog(sblock.fs_logbno, &freelogblk); + examinelog(&freelogblk); freedlog++; } @@ -2172,7 +2172,7 @@ } void -examinelog(daddr32_t start, void (*cb)(daddr32_t)) +examinelog(void (*cb)(daddr32_t)) { struct bufarea *bp; extent_block_t *ebp; @@ -2181,8 +2181,19 @@ int i; int j; - if (start < SBLOCK) + /* + * Since ufs stores fs_logbno as blocks and MTBufs stores it as frags + * we need to translate accordingly using logbtodb() + */ + + if (logbtodb(&sblock, sblock.fs_logbno) < SBLOCK) { + if (debug) { + (void) printf("fs_logbno < SBLOCK: %ld < %ld\n" \ + "Aborting log examination\n", \ + logbtodb(&sblock, sblock.fs_logbno), SBLOCK); + } return; + } /* * Read errors will return zeros, which will cause us