Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/fsck_msdos The free space value in the FSInfo block is ...



details:   https://anonhg.NetBSD.org/src/rev/128d53f86861
branches:  trunk
changeset: 780809:128d53f86861
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Tue Aug 07 19:30:41 2012 +0000

description:
The free space value in the FSInfo block is merely unitialized when it is
0xffffffff.  Fixes first part of bin/46743

diffstat:

 sbin/fsck_msdos/fat.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 1806bbaee3e9 -r 128d53f86861 sbin/fsck_msdos/fat.c
--- a/sbin/fsck_msdos/fat.c     Tue Aug 07 19:27:19 2012 +0000
+++ b/sbin/fsck_msdos/fat.c     Tue Aug 07 19:30:41 2012 +0000
@@ -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 @@
 
        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;



Home | Main Index | Thread Index | Old Index