git: aad9b8f78c31 - stable/13 - sync_vnode(): add assert to check vn_start_write() correctness
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 25 Apr 2023 00:38:19 UTC
The branch stable/13 has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=aad9b8f78c311c0ed6182234fe0c441e70f76613
commit aad9b8f78c311c0ed6182234fe0c441e70f76613
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2023-04-15 19:41:44 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2023-04-25 00:27:27 +0000
sync_vnode(): add assert to check vn_start_write() correctness
(cherry picked from commit d8a096621bcf4539d0920eb0711d19fcb30c0576)
---
sys/kern/vfs_subr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 7ebd63447caa..672000ded079 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -2651,6 +2651,9 @@ sync_vnode(struct synclist *slp, struct bufobj **bo, struct thread *td)
mtx_lock(&sync_mtx);
return (*bo == LIST_FIRST(slp));
}
+ MPASSERT(mp == NULL || (curthread->td_pflags & TDP_IGNSUSP) != 0 ||
+ (mp->mnt_kern_flag & MNTK_SUSPENDED) == 0, mp,
+ ("suspended mp syncing vp %p", vp));
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
(void) VOP_FSYNC(vp, MNT_LAZY, td);
VOP_UNLOCK(vp);