From 5fab60a07128991587da7d4fcafdd1763a0df689 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 14 Nov 2014 11:31:10 +0000 Subject: [PATCH] In vfs_write_suspend_umnt(), if suspension cannot be established, do not forget to restore write ops count when returning the error. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/kern/vfs_vnops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index b3e1c3bf45cf..ee45e01aecfe 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -1881,8 +1881,10 @@ vfs_write_suspend_umnt(struct mount *mp) for (;;) { vn_finished_write(mp); error = vfs_write_suspend(mp, 0); - if (error != 0) + if (error != 0) { + vn_start_write(NULL, &mp, V_WAIT); return (error); + } MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_SUSPENDED) != 0) break;