The free space value in the FSInfo block is merely unitialized when it is

0xffffffff.  Fixes first part of bin/46743
This commit is contained in:
jakllsch 2012-08-07 19:30:41 +00:00
parent bab9b33652
commit da6f244356
1 changed files with 5 additions and 4 deletions

View File

@ -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 *boot, struct fatEntry *fat)
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;