Author: delphij
Date: Mon Aug 19 04:28:12 2019
New Revision: 351204
URL: https://svnweb.freebsd.org/changeset/base/351204

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

Modified:
  head/sbin/fsck_msdosfs/dir.c

Modified: head/sbin/fsck_msdosfs/dir.c
==============================================================================
--- head/sbin/fsck_msdosfs/dir.c        Mon Aug 19 01:14:11 2019        
(r351203)
+++ head/sbin/fsck_msdosfs/dir.c        Mon Aug 19 04:28:12 2019        
(r351204)
@@ -220,7 +220,6 @@ int
 resetDosDirSection(struct bootblock *boot, struct fatEntry *fat)
 {
        int b1, b2;
-       cl_t cl;
        int ret = FSOK;
        size_t len;
 
@@ -253,24 +252,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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to