svn commit: r340925 - head/sbin/fsck_ffs

Kirk McKusick mckusick at FreeBSD.org
Sun Nov 25 18:09:40 UTC 2018


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 at 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 "


More information about the svn-src-head mailing list