diff options
author | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2014-07-11 14:35:20 +0000 |
---|---|---|
committer | Tobias Stoeckmann <tobias@cvs.openbsd.org> | 2014-07-11 14:35:20 +0000 |
commit | 5125e4d7b8523964928e75745e89c0824cb3be27 (patch) | |
tree | d9f85b6b59e092a7b8f6210fb43ed1e04e5b20de /sbin/fsck_msdos/dir.c | |
parent | aa5bd678af160a573f826a59844d1c3726a98df4 (diff) |
Remove redundant check and wrong fix: fat.c checks already take care
about cluster chains. If the user didn't want to fix them at that time,
he asks for trouble -- and these checks didn't help in all cases either.
discussed with and ok krw@
Diffstat (limited to 'sbin/fsck_msdos/dir.c')
-rw-r--r-- | sbin/fsck_msdos/dir.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/sbin/fsck_msdos/dir.c b/sbin/fsck_msdos/dir.c index 63e76d2ca97..8961b969e22 100644 --- a/sbin/fsck_msdos/dir.c +++ b/sbin/fsck_msdos/dir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dir.c,v 1.25 2014/07/10 18:59:49 tobias Exp $ */ +/* $OpenBSD: dir.c,v 1.26 2014/07/11 14:35:19 tobias Exp $ */ /* $NetBSD: dir.c,v 1.11 1997/10/17 11:19:35 ws Exp $ */ /* @@ -213,7 +213,6 @@ int resetDosDirSection(struct bootblock *boot, struct fatEntry *fat) { int b1, b2; - cl_t cl; int ret = FSOK; b1 = boot->RootDirEnts * 32; @@ -232,24 +231,9 @@ resetDosDirSection(struct bootblock *boot, struct fatEntry *fat) boot->RootCl); goto fail; } - cl = fat[boot->RootCl].next; - if (cl < CLUST_FIRST - || (cl >= CLUST_RSRVD && cl< CLUST_EOFS) - || fat[boot->RootCl].head != boot->RootCl) { - 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\n"); - goto fail; - } - if (ask(1, "Fix")) { - fat[boot->RootCl].next = CLUST_FREE; - ret = FSFATMOD; - } else - ret = FSFATAL; + if (fat[boot->RootCl].head != boot->RootCl) { + pfatal("Root directory doesn't start a cluster chain\n"); + goto fail; } fat[boot->RootCl].flags |= FAT_USED; |