Date: Wed, 24 Mar 2010 14:43:19 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r205595 - stable/8/sys/fs/msdosfs Message-ID: <201003241443.o2OEhJQl027066@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Wed Mar 24 14:43:19 2010 New Revision: 205595 URL: http://svn.freebsd.org/changeset/base/205595 Log: MFC r204472: Add assertions for FAT bitmap state. Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_fat.c Wed Mar 24 14:37:17 2010 (r205594) +++ stable/8/sys/fs/msdosfs/msdosfs_fat.c Wed Mar 24 14:43:19 2010 (r205595) @@ -413,7 +413,12 @@ usemap_alloc(pmp, cn) { MSDOSFS_ASSERT_MP_LOCKED(pmp); + + KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) + == 0, ("Allocating used sector %ld %ld %x", cn, cn % N_INUSEBITS, + (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); pmp->pm_inusemap[cn / N_INUSEBITS] |= 1 << (cn % N_INUSEBITS); + KASSERT(pmp->pm_freeclustercount > 0, ("usemap_alloc: too little")); pmp->pm_freeclustercount--; } @@ -425,6 +430,9 @@ usemap_free(pmp, cn) MSDOSFS_ASSERT_MP_LOCKED(pmp); pmp->pm_freeclustercount++; + KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) + != 0, ("Freeing unused sector %ld %ld %x", cn, cn % N_INUSEBITS, + (unsigned)pmp->pm_inusemap[cn / N_INUSEBITS])); pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1 << (cn % N_INUSEBITS)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003241443.o2OEhJQl027066>