Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Apr 2019 23:34:03 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r345897 - head/sbin/fsck_msdosfs
Message-ID:  <201904042334.x34NY3jw029213@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Apr  4 23:34:03 2019
New Revision: 345897
URL: https://svnweb.freebsd.org/changeset/base/345897

Log:
  Restore lfcl when LOSTDIR's chain was corrupted and overwritten
  with invalid value.
  
  Obtained from:	Android https://android.googlesource.com/platform/external/fsck_msdos/+/4d6d6f8a3674ad67f970e2ae908d34f64e4854cf%5E%21/
  MFC after:	2 weeks

Modified:
  head/sbin/fsck_msdosfs/dir.c

Modified: head/sbin/fsck_msdosfs/dir.c
==============================================================================
--- head/sbin/fsck_msdosfs/dir.c	Thu Apr  4 23:32:27 2019	(r345896)
+++ head/sbin/fsck_msdosfs/dir.c	Thu Apr  4 23:34:03 2019	(r345897)
@@ -973,6 +973,7 @@ reconnect(int dosfs, struct bootblock *boot, struct fa
 		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



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