[bug] fsck refuses to repair damaged UFS using backup superblock
Rick Macklem
rmacklem at uoguelph.ca
Mon Nov 26 00:07:39 UTC 2018
________________________________________
From: Rick Macklem
Sent: Sunday, November 25, 2018 6:45 PM
To: Kirk McKusick
Cc: soralx at cydem.org; freebsd-fs at freebsd.org; Julian H. Stacey; Konstantin Belousov
Subject: Re: [bug] fsck refuses to repair damaged UFS using backup superblock
Rick Macklem wrote:
[stuff snipped]
>Maybe setting all elements of fs_sparecon32[] to zeros before writing the
>superblock out would minimize these issues for the future and could be MFC'd.
>(I'm not claiming that a new FFS2 should be movable between stable/11 and
> head, but it might be a nice feature?)
Ok, it looks like the FS_METACKHASH flag was meant to handle the old->new
kernel transition. However, if I am reading the code correctly, it needs to be
checked for sooner. Here's the code snippet:
/* fetch the superblock and summary information */
812 if ((error = ffs_sbget(devvp, &fs, -1, M_UFSMNT, ffs_use_bread)) != 0)
813 goto out;
814 fs->fs_fmod = 0;
815 /* if we ran on a kernel without metadata check hashes, disable them */
816 if ((fs->fs_flags & FS_METACKHASH) == 0)
817 fs->fs_metackhash = 0;
I think ffs_sbget() calls readsuper() which calls calc_sbhash(), so lines 815-817
need to be near the top of readsuper(), I think?
rick
[more stuff snipped]
More information about the freebsd-fs
mailing list