sbin/fsck_msdosfs: Bring in freebsd/freebsd@89f9bddc (properly restore lfcl)
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 14 Sep 2019 21:35:43 +0000 (06:35 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 14 Sep 2019 22:57:20 +0000 (07:57 +0900)
sbin/fsck_msdosfs/dir.c

index 2934f01..b5cb53e 100644 (file)
@@ -1068,6 +1068,7 @@ reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head)
                if (lfcl < CLUST_FIRST || lfcl >= boot->NumClusters) {
                        /* Extend LOSTDIR?                              XXX */
                        pwarn("No space in %s\n", LOSTDIR);
+                       lfcl = (lostDir->head < boot->NumClusters) ? lostDir->head : 0;
                        return FSERROR;
                }
                lfoff = lfcl * boot->ClusterSize