vfs: fix early termination of kern_getfsstat

The kernel would unlock already unlocked mutex if the buffer got filled up
before the mount list ended.

Reported by:	pho
Fixes:	r363069 ("vfs: depessimize getfsstat when only the count is requested")
This commit is contained in:
Mateusz Guzik 2020-07-10 09:24:27 +00:00
parent 422f38d8ea
commit 74f61caed5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363072

View File

@ -551,7 +551,7 @@ kern_getfsstat(struct thread *td, struct statfs **buf, size_t bufsize,
if (count == maxcount) {
vfs_unbusy(mp);
break;
goto out;
}
mtx_lock(&mountlist_mtx);