Module Name: src
Committed By: mlelstv
Date: Sun Nov 11 10:21:11 UTC 2018
Modified Files:
src/sys/dev/dm: dm_ioctl.c
Log Message:
Only _if_ an inactive table has been loaded, make it active when resuming.
Fixes lvrename operation.
To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/dm/dm_ioctl.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/dev/dm/dm_ioctl.c
diff -u src/sys/dev/dm/dm_ioctl.c:1.32 src/sys/dev/dm/dm_ioctl.c:1.33
--- src/sys/dev/dm/dm_ioctl.c:1.32 Fri Jan 5 14:22:05 2018
+++ src/sys/dev/dm/dm_ioctl.c Sun Nov 11 10:21:11 2018
@@ -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_dev_resume_ioctl(prop_dictionary_t dm
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);