From owner-svn-src-stable@FreeBSD.ORG Mon Jul 14 20:07:23 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F23EEE5; Mon, 14 Jul 2014 20:07:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8BDD32DC3; Mon, 14 Jul 2014 20:07:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6EK7NWN066141; Mon, 14 Jul 2014 20:07:23 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6EK7N75066136; Mon, 14 Jul 2014 20:07:23 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407142007.s6EK7N75066136@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Mon, 14 Jul 2014 20:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268629 - stable/10/sbin/fsck_msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jul 2014 20:07:23 -0000 Author: pfg Date: Mon Jul 14 20:07:23 2014 New Revision: 268629 URL: http://svnweb.freebsd.org/changeset/base/268629 Log: fsck_msdosfs: be a bit more permissive The free space value in the FSInfo block is merely unitialized when it is 0xffffffff. This fixes a bug found in NetBSD. It must be noted that we never supported all the checks that NetBSD does as some of them would cause failures with a freshly created FAT32 from MS-Windows. While here, bring some space fixes. Obtained from: NetBSD (rev. 1.22) Modified: stable/10/sbin/fsck_msdosfs/fat.c Modified: stable/10/sbin/fsck_msdosfs/fat.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/fat.c Mon Jul 14 19:16:49 2014 (r268628) +++ stable/10/sbin/fsck_msdosfs/fat.c Mon Jul 14 20:07:23 2014 (r268629) @@ -242,7 +242,7 @@ readfat(int fs, struct bootblock *boot, ret |= FSDIRTY; else { /* just some odd byte sequence in FAT */ - + switch (boot->ClustMask) { case CLUST32_MASK: pwarn("%s (%02x%02x%02x%02x%02x%02x%02x%02x)\n", @@ -262,7 +262,7 @@ readfat(int fs, struct bootblock *boot, break; } - + if (ask(1, "Correct")) ret |= FSFIXFAT; } @@ -653,7 +653,7 @@ checklost(int dosfs, struct bootblock *b cl_t head; int mod = FSOK; int ret; - + for (head = CLUST_FIRST; head < boot->NumClusters; head++) { /* find next untravelled chain */ if (fat[head].head != head @@ -677,8 +677,9 @@ checklost(int dosfs, struct bootblock *b if (boot->bpbFSInfo) { 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;