Date: Sun, 25 Nov 2018 18:09:39 +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: r340925 - head/sbin/fsck_ffs Message-ID: <201811251809.wAPI9de2089081@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mckusick Date: Sun Nov 25 18:09:39 2018 New Revision: 340925 URL: https://svnweb.freebsd.org/changeset/base/340925 Log: Properly recover from superblock check-hash failures. Specifically, report the check-hash failure and offer to search for and use alternate superblocks. Prior to this fix fsck_ffs would simply report the check-hash failure and exit. Reported by: Julian H. Stacey <jhs@berklix.com> Tested by: Peter Holm Sponsored by: Netflix Modified: head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Sun Nov 25 18:01:15 2018 (r340924) +++ head/sbin/fsck_ffs/setup.c Sun Nov 25 18:09:39 2018 (r340925) @@ -127,7 +127,7 @@ setup(char *dev) } } if ((fsreadfd = open(dev, O_RDONLY)) < 0 || - ufs_disk_fillout(&disk, dev) < 0) { + ufs_disk_fillout_blank(&disk, dev) < 0) { if (bkgrdflag) { unlink(snapname); bkgrdflag = 0; @@ -325,10 +325,8 @@ readsb(int listerr) if ((ret = sbget(fsreadfd, &fs, super)) != 0) { switch (ret) { case EINVAL: - fprintf(stderr, "The previous newfs operation " - "on this volume did not complete.\nYou must " - "complete newfs before using this volume.\n"); - exit(11); + /* Superblock check-hash failed */ + return (0); case ENOENT: if (bflag) fprintf(stderr, "%jd is not a file system "
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811251809.wAPI9de2089081>