Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ffs Unlock vnode for VOP_IOCTL() and wapbl_flush().



details:   https://anonhg.NetBSD.org/src/rev/87554344b579
branches:  trunk
changeset: 365243:87554344b579
user:      hannken <hannken%NetBSD.org@localhost>
date:      Sat Apr 16 08:00:55 2022 +0000

description:
Unlock vnode for VOP_IOCTL() and wapbl_flush().

diffstat:

 sys/ufs/ffs/ffs_vfsops.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r b6f5c554cc34 -r 87554344b579 sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Sat Apr 16 07:59:46 2022 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Sat Apr 16 08:00:55 2022 +0000
@@ -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 @@
                 * 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 @@
        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;



Home | Main Index | Thread Index | Old Index