aboutsummaryrefslogtreecommitdiff
path: root/sbin/fsck_msdosfs/dir.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2019-04-04 23:34:03 +0000
committerXin LI <delphij@FreeBSD.org>2019-04-04 23:34:03 +0000
commitfbf8a5605fbb5b0ef766336247f8c708a8652f8d (patch)
treeceb2b7d98993951c0d1372140d5447bc76f31dbe /sbin/fsck_msdosfs/dir.c
parentfff4eaebbff9cf9084e0cb4634fb9170e3cfb252 (diff)
Restore lfcl when LOSTDIR's chain was corrupted and overwritten
Notes
Notes: svn path=/head/; revision=345897
Diffstat (limited to 'sbin/fsck_msdosfs/dir.c')
-rw-r--r--sbin/fsck_msdosfs/dir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c
index 0a2418eb9d12..a468a42b4276 100644
--- a/sbin/fsck_msdosfs/dir.c
+++ b/sbin/fsck_msdosfs/dir.c
@@ -973,6 +973,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