Module Name: src
Committed By: hannken
Date: Sat Apr 16 08:00:55 UTC 2022
Modified Files:
src/sys/ufs/ffs: ffs_vfsops.c
Log Message:
Unlock vnode for VOP_IOCTL() and wapbl_flush().
To generate a diff of this commit:
cvs rdiff -u -r1.375 -r1.376 src/sys/ufs/ffs/ffs_vfsops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.375 src/sys/ufs/ffs/ffs_vfsops.c:1.376
--- src/sys/ufs/ffs/ffs_vfsops.c:1.375 Sat Mar 19 13:53:33 2022
+++ src/sys/ufs/ffs/ffs_vfsops.c Sat Apr 16 08:00:55 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs_vfsops.c,v 1.375 2022/03/19 13:53:33 hannken Exp $ */
+/* $NetBSD: ffs_vfsops.c,v 1.376 2022/04/16 08:00:55 hannken Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.375 2022/03/19 13:53:33 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.376 2022/04/16 08:00:55 hannken Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ffs.h"
@@ -2480,7 +2480,9 @@ ffs_vfs_fsync(vnode_t *vp, int flags)
* contains no dirty buffers that could be in the log.
*/
if (!LIST_EMPTY(&vp->v_dirtyblkhd)) {
+ VOP_UNLOCK(vp);
error = wapbl_flush(mp->mnt_wapbl, 0);
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
if (error)
return error;
}
@@ -2499,8 +2501,10 @@ ffs_vfs_fsync(vnode_t *vp, int flags)
error = vflushbuf(vp, flags);
if (error == 0 && (flags & FSYNC_CACHE) != 0) {
i = 1;
+ VOP_UNLOCK(vp);
(void)VOP_IOCTL(vp, DIOCCACHESYNC, &i, FWRITE,
kauth_cred_get());
+ vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
}
return error;