diff options
author | kib <kib@FreeBSD.org> | 2015-04-12 07:03:26 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-04-12 07:03:26 +0000 |
commit | cf6596d5abb0225665ac229fc10a559b13450d6c (patch) | |
tree | a99db0d00b06c4f5bebedbde30cb12646cedd7e3 /sys/fs | |
parent | 6135eb62317f96be750cb274b537ebf41151b7a5 (diff) | |
download | FreeBSD-src-cf6596d5abb0225665ac229fc10a559b13450d6c.zip FreeBSD-src-cf6596d5abb0225665ac229fc10a559b13450d6c.tar.gz |
MFC r281120:
Assert that an msdosfs mount is not read-only when FAT modifications
are requested.
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/msdosfs/msdosfs_fat.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c index c660601..3c46c03 100644 --- a/sys/fs/msdosfs/msdosfs_fat.c +++ b/sys/fs/msdosfs/msdosfs_fat.c @@ -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, retcluster, got) 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++); |