Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Mark disklabel only invalid on the last close. Exist...



details:   https://anonhg.NetBSD.org/src/rev/e0380d141e15
branches:  trunk
changeset: 339299:e0380d141e15
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Jul 11 09:45:16 2015 +0000

description:
Mark disklabel only invalid on the last close. Existing openers might see
temporarily invalid data while it is re-read.

diffstat:

 sys/dev/dksubr.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (32 lines):

diff -r 09eadd2857df -r e0380d141e15 sys/dev/dksubr.c
--- a/sys/dev/dksubr.c  Sat Jul 11 09:21:22 2015 +0000
+++ b/sys/dev/dksubr.c  Sat Jul 11 09:45:16 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dksubr.c,v 1.63 2015/05/09 13:07:20 christos Exp $ */
+/* $NetBSD: dksubr.c,v 1.64 2015/07/11 09:45:16 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 1999, 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.63 2015/05/09 13:07:20 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dksubr.c,v 1.64 2015/07/11 09:45:16 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -194,11 +194,10 @@
        if (dk->dk_openmask == 0) {
                if (dkd->d_lastclose != NULL)
                        (*dkd->d_lastclose)(dksc->sc_dev);
+               if ((dksc->sc_flags & DKF_KLABEL) == 0)
+                       dksc->sc_flags &= ~DKF_VLABEL;
        }
 
-       if ((dksc->sc_flags & DKF_KLABEL) == 0)
-               dksc->sc_flags &= ~DKF_VLABEL;
-
        mutex_exit(&dk->dk_openlock);
        return 0;
 }



Home | Main Index | Thread Index | Old Index