Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Sep 2019 06:52:21 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r351735 - stable/12/sbin/fsck_msdosfs
Message-ID:  <201909030652.x836qLi6098464@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Tue Sep  3 06:52:21 2019
New Revision: 351735
URL: https://svnweb.freebsd.org/changeset/base/351735

Log:
  MFC r351204:
  
  Remove redundant check and wrong fix: fat.c checks already take care
  about cluster chains.
  
  Obtained from:	OpenBSD

Modified:
  stable/12/sbin/fsck_msdosfs/dir.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/fsck_msdosfs/dir.c
==============================================================================
--- stable/12/sbin/fsck_msdosfs/dir.c	Tue Sep  3 06:41:19 2019	(r351734)
+++ stable/12/sbin/fsck_msdosfs/dir.c	Tue Sep  3 06:52:21 2019	(r351735)
@@ -219,7 +219,6 @@ int
 resetDosDirSection(struct bootblock *boot, struct fatEntry *fat)
 {
 	int b1, b2;
-	cl_t cl;
 	int ret = FSOK;
 	size_t len;
 
@@ -252,24 +251,9 @@ resetDosDirSection(struct bootblock *boot, struct fatE
 			       boot->bpbRootClust);
 			return FSFATAL;
 		}
-		cl = fat[boot->bpbRootClust].next;
-		if (cl < CLUST_FIRST
-		    || (cl >= CLUST_RSRVD && cl< CLUST_EOFS)
-		    || fat[boot->bpbRootClust].head != boot->bpbRootClust) {
-			if (cl == CLUST_FREE)
-				pwarn("Root directory starts with free cluster\n");
-			else if (cl >= CLUST_RSRVD)
-				pwarn("Root directory starts with cluster marked %s\n",
-				      rsrvdcltype(cl));
-			else {
-				pfatal("Root directory doesn't start a cluster chain");
-				return FSFATAL;
-			}
-			if (ask(1, "Fix")) {
-				fat[boot->bpbRootClust].next = CLUST_FREE;
-				ret = FSFATMOD;
-			} else
-				ret = FSFATAL;
+		if (fat[boot->bpbRootClust].head != boot->bpbRootClust) {
+			pfatal("Root directory doesn't start a cluster chain");
+			return FSFATAL;
 		}
 
 		fat[boot->bpbRootClust].flags |= FAT_USED;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909030652.x836qLi6098464>