Date: Sun, 24 Sep 2017 19:01:23 +0300 From: Konstantin Belousov <kostikbel@gmail.com> To: "Rodney W. Grimes" <freebsd-rwg@pdx.rh.CN85.dnsmgr.net> Cc: "O. Hartmann" <ohartmann@walstatt.org>, FreeBSD CURRENT <freebsd-current@freebsd.org>, Kirk McKusick <mckusick@mckusick.com> Subject: Re: Dying SD memory? handle_workitem_freefile: got error 5 while accessing filesystem Message-ID: <20170924160123.GV2271@kib.kiev.ua> In-Reply-To: <201709241532.v8OFWsWN008079@pdx.rh.CN85.dnsmgr.net> References: <20170924075238.GS2271@kib.kiev.ua> <201709241532.v8OFWsWN008079@pdx.rh.CN85.dnsmgr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Sep 24, 2017 at 08:32:54AM -0700, Rodney W. Grimes wrote: > Would it be possible to add some robustness to these checksum > failed errors to indicate there source more accurately? Ie > either a /dev entry or a fstab entry, and the fact they are > from the ffs layer? Perhaps this. But untested and somewhat racy. diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index b981b5e5794..bd78b760442 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -2584,6 +2584,15 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz) return (-1); } +static const struct statfs * +ffs_getmntstat(struct vnode *devvp) +{ + + if (devvp->v_type == VCHR) + return (&devvp->v_rdev->si_mountpt->mnt_stat); + return (ffs_getmntstat(VFSTOUFS(devvp->v_mount)->um_devvp)); +} + /* * Fetch and verify a cylinder group. */ @@ -2597,6 +2606,7 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) { struct buf *bp; struct cg *cgp; + const struct statfs *sfs; int flags, error; *bpp = NULL; @@ -2615,7 +2625,11 @@ ffs_getcg(fs, devvp, cg, bpp, cgpp) (bp->b_flags & B_CKHASH) != 0 && cgp->cg_ckhash != bp->b_ckhash) || !cg_chkmagic(cgp) || cgp->cg_cgx != cg) { - printf("checksum failed: cg %u, cgp: 0x%x != bp: 0x%jx\n", + 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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170924160123.GV2271>