Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/msdosfs Take vnode lock for VOP_FSYNC().



details:   https://anonhg.NetBSD.org/src/rev/d2689aecf2a6
branches:  trunk
changeset: 821784:d2689aecf2a6
user:      hannken <hannken%NetBSD.org@localhost>
date:      Fri Feb 17 08:27:20 2017 +0000

description:
Take vnode lock for VOP_FSYNC().

diffstat:

 sys/fs/msdosfs/msdosfs_vfsops.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 24e3e9f19098 -r d2689aecf2a6 sys/fs/msdosfs/msdosfs_vfsops.c
--- a/sys/fs/msdosfs/msdosfs_vfsops.c   Fri Feb 17 08:26:41 2017 +0000
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c   Fri Feb 17 08:27:20 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_vfsops.c,v 1.119 2016/12/14 15:48:54 hannken Exp $     */
+/*     $NetBSD: msdosfs_vfsops.c,v 1.120 2017/02/17 08:27:20 hannken Exp $     */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.119 2016/12/14 15:48:54 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.120 2017/02/17 08:27:20 hannken Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -1032,9 +1032,11 @@
        /*
         * Force stale file system control information to be flushed.
         */
+       vn_lock(pmp->pm_devvp, LK_EXCLUSIVE | LK_RETRY);
        if ((error = VOP_FSYNC(pmp->pm_devvp, cred,
            waitfor == MNT_WAIT ? FSYNC_WAIT : 0, 0, 0)) != 0)
                allerror = error;
+       VOP_UNLOCK(pmp->pm_devvp);
        fstrans_done(mp);
        return (allerror);
 }



Home | Main Index | Thread Index | Old Index