git: 9bdaaaaa3221 - stable/13 - UFSSUSPEND: unbusy mp in EDADLK case

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Fri, 20 Jan 2023 03:23:53 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=9bdaaaaa3221f410f20d19d785d27487094d0fd9

commit 9bdaaaaa3221f410f20d19d785d27487094d0fd9
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2022-12-29 22:09:57 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-01-20 03:21:44 +0000

    UFSSUSPEND: unbusy mp in EDADLK case
    
    Tested by:      pho
    
    (cherry picked from commit a5ff86646ee4602a141a24eee95c1c60bb375030)
---
 sys/ufs/ffs/ffs_suspend.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sys/ufs/ffs/ffs_suspend.c b/sys/ufs/ffs/ffs_suspend.c
index a68f25d5eed2..5e3258089fd0 100644
--- a/sys/ufs/ffs/ffs_suspend.c
+++ b/sys/ufs/ffs/ffs_suspend.c
@@ -310,8 +310,10 @@ ffs_susp_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
 		 */
 		error = curproc->p_numthreads > 1 ? EDEADLK :
 		    descrip_check_write_mp(curproc->p_fd, mp);
-		if (error != 0)
+		if (error != 0) {
+			vfs_unbusy(mp);
 			break;
+		}
 
 		error = ffs_susp_suspend(mp);
 		if (error != 0) {