freebsd-dev/sbin/fsck_msdosfs
Xin LI d14a599d69 Tighten FAT checks and fix off-by-one error in corner case.
sbin/fsck_msdosfs/fat.c:
 - readfat:
    * Only truncate out-of-range cluster pointers (1, or greater than
      NumClusters but smaller than CLUST_RSRVD), as the current cluster
      may contain some data. We can't fix reserved cluster pointers at
      this pass, because we do no know the potential cluster preceding
      it.
    * Accept valid cluster for head bitmap. This is a no-op, and mainly
      to improve code readability, because the 1 is already handled in
      the previous else if block.
 - truncate_at: absorbed into checkchain.
 - checkchain: save the previous node we have traversed in case that we
   have a chain that ends with a special (>= CLUST_RSRVD) cluster, or is
   free. In these cases, we need to truncate at the cluster preceding the
   current cluster, as the current cluster contains a marker instead of
   a next pointer and can not be changed to CLUST_EOF (the else case can
   happen if the user answered "no" at some point in readfat()).
 - clearchain: correct the iterator for next cluster so that we don't
   stop after clearing the first cluster.
 - checklost: If checkchain() thinks the chain have no cluster, it
   doesn't make sense to reconnect it, so don't bother asking.

Reviewed by:	kevlo
MFC after:	24 days
X-MFC-With:	r356313
Differential Revision:	https://reviews.freebsd.org/D23065
2020-01-12 06:13:52 +00:00
..
boot.c Correct off-by-two issue when determining FAT type. 2020-01-11 17:41:20 +00:00
check.c Reduce memory footprint of fsck_msdosfs. 2020-01-03 00:31:48 +00:00
dir.c Reduce memory footprint of fsck_msdosfs. 2020-01-03 00:31:48 +00:00
dosfs.h Reduce memory footprint of fsck_msdosfs. 2020-01-03 00:31:48 +00:00
ext.h Reduce memory footprint of fsck_msdosfs. 2020-01-03 00:31:48 +00:00
fat.c Tighten FAT checks and fix off-by-one error in corner case. 2020-01-12 06:13:52 +00:00
fsck_msdosfs.8 fsck_msdosfs.8: document -M. 2020-01-07 04:33:14 +00:00
main.c Reduce memory footprint of fsck_msdosfs. 2020-01-03 00:31:48 +00:00
Makefile Revert Makefile@335696 that sneaked into the commit. 2018-06-27 06:50:24 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2017-10-31 00:07:04 +00:00