Module Name: src
Committed By: jakllsch
Date: Tue Aug 7 19:30:42 UTC 2012
Modified Files:
src/sbin/fsck_msdos: fat.c
Log Message:
The free space value in the FSInfo block is merely unitialized when it is
0xffffffff. Fixes first part of bin/46743
To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sbin/fsck_msdos/fat.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/fsck_msdos/fat.c
diff -u src/sbin/fsck_msdos/fat.c:1.22 src/sbin/fsck_msdos/fat.c:1.23
--- src/sbin/fsck_msdos/fat.c:1.22 Sat Apr 11 07:14:50 2009
+++ src/sbin/fsck_msdos/fat.c Tue Aug 7 19:30:41 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: fat.c,v 1.22 2009/04/11 07:14:50 lukem Exp $ */
+/* $NetBSD: fat.c,v 1.23 2012/08/07 19:30:41 jakllsch Exp $ */
/*
* Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: fat.c,v 1.22 2009/04/11 07:14:50 lukem Exp $");
+__RCSID("$NetBSD: fat.c,v 1.23 2012/08/07 19:30:41 jakllsch Exp $");
#endif /* not lint */
#include <stdlib.h>
@@ -596,8 +596,9 @@ checklost(int dosfs, struct bootblock *b
if (boot->FSInfo) {
ret = 0;
- if (boot->FSFree != boot->NumFree) {
- pwarn("Free space in FSInfo block (%d) not correct (%d)\n",
+ if (boot->FSFree != 0xffffffffU &&
+ boot->FSFree != boot->NumFree) {
+ pwarn("Free space in FSInfo block (%u) not correct (%u)\n",
boot->FSFree, boot->NumFree);
if (ask(1, "fix")) {
boot->FSFree = boot->NumFree;