aboutsummaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2019-08-19 04:28:12 +0000
committerXin LI <delphij@FreeBSD.org>2019-08-19 04:28:12 +0000
commitb9919ec96021f96fdda751009e81ce222be45ed3 (patch)
tree20ec2c642c08fad80a7d0a578dde60f1059fd569 /sbin
parent9809df467bd894f29f901029929ce8248a50c3d0 (diff)
downloadsrc-b9919ec96021f96fdda751009e81ce222be45ed3.tar.gz
src-b9919ec96021f96fdda751009e81ce222be45ed3.zip
Remove redundant check and wrong fix: fat.c checks already take care
about cluster chains. Obtained from: OpenBSD MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=351204
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck_msdosfs/dir.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c
index e56bbf80c6bf..191ff49ccd81 100644
--- a/sbin/fsck_msdosfs/dir.c
+++ b/sbin/fsck_msdosfs/dir.c
@@ -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 fatEntry *fat)
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;