tmpfs_free_tmp(): explicitly assert that tmp is locked
Despite TMPFS_UNLOCK() is done in both paths later, unlocking not locked mutex provides different failure mode. MFC after: 1 week Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
42bebbda9e
commit
9f200bc47b
@ -544,8 +544,9 @@ tmpfs_unmount(struct mount *mp, int mntflags)
|
||||
void
|
||||
tmpfs_free_tmp(struct tmpfs_mount *tmp)
|
||||
{
|
||||
|
||||
TMPFS_MP_ASSERT_LOCKED(tmp);
|
||||
MPASS(tmp->tm_refcount > 0);
|
||||
|
||||
tmp->tm_refcount--;
|
||||
if (tmp->tm_refcount > 0) {
|
||||
TMPFS_UNLOCK(tmp);
|
||||
|
Loading…
x
Reference in New Issue
Block a user