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
This commit is contained in:
Konstantin Belousov 2014-11-14 11:31:10 +00:00
parent 7fe2e170e4
commit 5fab60a071

View File

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