Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/dm Only _if_ an inactive table has been loaded, make...



details:   https://anonhg.NetBSD.org/src/rev/e142a789a360
branches:  trunk
changeset: 445743:e142a789a360
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Nov 11 10:21:11 2018 +0000

description:
Only _if_ an inactive table has been loaded, make it active when resuming.
Fixes lvrename operation.

diffstat:

 sys/dev/dm/dm_ioctl.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r fe8584e57f6a -r e142a789a360 sys/dev/dm/dm_ioctl.c
--- a/sys/dev/dm/dm_ioctl.c     Sun Nov 11 10:14:14 2018 +0000
+++ b/sys/dev/dm/dm_ioctl.c     Sun Nov 11 10:21:11 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.32 2018/01/05 14:22:05 christos Exp $      */
+/* $NetBSD: dm_ioctl.c,v 1.33 2018/11/11 10:21:11 mlelstv Exp $      */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.32 2018/01/05 14:22:05 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.33 2018/11/11 10:21:11 mlelstv Exp $");
 
 /*
  * Locking is used to synchronise between ioctl calls and between dm_table's
@@ -542,11 +542,14 @@
                DM_REMOVE_FLAG(flags, DM_EXISTS_FLAG);
                return ENOENT;
        }
+
+       /* Make inactive table active, if it exists */
+       if (dmv->flags & DM_INACTIVE_PRESENT_FLAG)
+               dm_table_switch_tables(&dmv->table_head);
+
        atomic_and_32(&dmv->flags, ~(DM_SUSPEND_FLAG | DM_INACTIVE_PRESENT_FLAG));
        atomic_or_32(&dmv->flags, DM_ACTIVE_PRESENT_FLAG);
 
-       dm_table_switch_tables(&dmv->table_head);
-
        DM_ADD_FLAG(flags, DM_EXISTS_FLAG);
 
        dmgetproperties(dmv->diskp, &dmv->table_head);



Home | Main Index | Thread Index | Old Index