Date: Sun, 12 Apr 2015 07:03:27 +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-10@freebsd.org Subject: svn commit: r281456 - stable/10/sys/fs/msdosfs Message-ID: <201504120703.t3C73Rtg014614@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Apr 12 07:03:26 2015 New Revision: 281456 URL: https://svnweb.freebsd.org/changeset/base/281456 Log: MFC r281120: Assert that an msdosfs mount is not read-only when FAT modifications are requested. Modified: stable/10/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_fat.c Sun Apr 12 06:54:53 2015 (r281455) +++ stable/10/sys/fs/msdosfs/msdosfs_fat.c Sun Apr 12 07:03:26 2015 (r281456) @@ -399,6 +399,8 @@ usemap_alloc(pmp, cn) MSDOSFS_ASSERT_MP_LOCKED(pmp); + KASSERT((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0, + ("usemap_alloc on ro msdosfs mount")); 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])); @@ -415,6 +417,8 @@ usemap_free(pmp, cn) { MSDOSFS_ASSERT_MP_LOCKED(pmp); + KASSERT((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0, + ("usemap_free on ro msdosfs mount")); pmp->pm_freeclustercount++; pmp->pm_flags |= MSDOSFS_FSIMOD; KASSERT((pmp->pm_inusemap[cn / N_INUSEBITS] & (1 << (cn % N_INUSEBITS))) @@ -715,6 +719,8 @@ chainalloc(pmp, start, count, fillwith, u_long cl, n; MSDOSFS_ASSERT_MP_LOCKED(pmp); + KASSERT((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0, + ("chainalloc on ro msdosfs mount")); for (cl = start, n = count; n-- > 0;) usemap_alloc(pmp, cl++);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504120703.t3C73Rtg014614>