git: fd50bb3f7cd0 - main - vop_fsync_debugprepost(): take account of nullfs
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 04 Aug 2025 22:26:53 UTC
The branch main has been updated by kib:
URL: https://cgit.FreeBSD.org/src/commit/?id=fd50bb3f7cd0762755ba6bf12d506da2544d4756
commit fd50bb3f7cd0762755ba6bf12d506da2544d4756
Author: Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2025-08-04 20:12:28 +0000
Commit: Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2025-08-04 22:26:25 +0000
vop_fsync_debugprepost(): take account of nullfs
Reported by: netchild
Reviewed and tested by: markj
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D51730
---
sys/kern/vfs_subr.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 4eac8bb0c8bb..a6e38be89291 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -5897,6 +5897,8 @@ vop_fplookup_symlink_debugpost(void *ap __unused, int rc __unused)
static void
vop_fsync_debugprepost(struct vnode *vp, const char *name)
{
+ struct mount *mp;
+
if (vp->v_type == VCHR)
;
/*
@@ -5914,10 +5916,16 @@ vop_fsync_debugprepost(struct vnode *vp, const char *name)
* should still be caught when the stacked filesystem
* invokes VOP_FSYNC() on the underlying filesystem.
*/
- else if (MNT_SHARED_WRITES(vp->v_mount))
- ASSERT_VOP_LOCKED(vp, name);
- else
- ASSERT_VOP_ELOCKED(vp, name);
+ else {
+ mp = NULL;
+ VOP_GETWRITEMOUNT(vp, &mp);
+ if (vn_lktype_write(mp, vp) == LK_SHARED)
+ ASSERT_VOP_LOCKED(vp, name);
+ else
+ ASSERT_VOP_ELOCKED(vp, name);
+ if (mp != NULL)
+ vfs_rel(mp);
+ }
}
void