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:
Konstantin Belousov 2021-01-05 20:53:45 +02:00
parent 42bebbda9e
commit 9f200bc47b

View File

@ -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);