Date: Wed, 31 Jan 2018 23:13:37 +0000 (UTC) From: Kirk McKusick <mckusick@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328644 - head/sys/ufs/ffs Message-ID: <201801312313.w0VNDb4m096807@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mckusick Date: Wed Jan 31 23:13:37 2018 New Revision: 328644 URL: https://svnweb.freebsd.org/changeset/base/328644 Log: When reading a cylinder group, break out reporting of check hash errors from other types of errors so that the error is correctly reported. Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Wed Jan 31 22:49:50 2018 (r328643) +++ head/sys/ufs/ffs/ffs_alloc.c Wed Jan 31 23:13:37 2018 (r328644) @@ -2635,16 +2635,31 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) if (error != 0) return (error); cgp = (struct cg *)bp->b_data; - if (((fs->fs_metackhash & CK_CYLGRP) != 0 && + if ((fs->fs_metackhash & CK_CYLGRP) != 0 && (bp->b_flags & B_CKHASH) != 0 && - cgp->cg_ckhash != bp->b_ckhash) || - !cg_chkmagic(cgp) || cgp->cg_cgx != cg) { + cgp->cg_ckhash != bp->b_ckhash) { sfs = ffs_getmntstat(devvp); printf("UFS %s%s (%s) cylinder checksum failed: cg %u, cgp: " "0x%x != bp: 0x%jx\n", devvp->v_type == VCHR ? "" : "snapshot of ", sfs->f_mntfromname, sfs->f_mntonname, cg, cgp->cg_ckhash, (uintmax_t)bp->b_ckhash); + bp->b_flags &= ~B_CKHASH; + bp->b_flags |= B_INVAL | B_NOCACHE; + brelse(bp); + return (EIO); + } + if (!cg_chkmagic(cgp) || cgp->cg_cgx != cg) { + sfs = ffs_getmntstat(devvp); + printf("UFS %s%s (%s)", + devvp->v_type == VCHR ? "" : "snapshot of ", + sfs->f_mntfromname, sfs->f_mntonname); + if (!cg_chkmagic(cgp)) + printf(" cg %u: bad magic number 0x%x should be 0x%x\n", + cg, cgp->cg_magic, CG_MAGIC); + else + printf(": wrong cylinder group cg %u != cgx %u\n", cg, + cgp->cg_cgx); bp->b_flags &= ~B_CKHASH; bp->b_flags |= B_INVAL | B_NOCACHE; brelse(bp);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801312313.w0VNDb4m096807>