diff options
| author | mlelstv <mlelstv@NetBSD.org> | 2018-11-11 10:21:11 +0000 |
|---|---|---|
| committer | mlelstv <mlelstv@NetBSD.org> | 2018-11-11 10:21:11 +0000 |
| commit | cd149d673922a8f377cf41d57575e7a47e996197 (patch) | |
| tree | e33f5a1903ef8204bc782b70c0d0b059f4a57b3e /sys/dev/dm/dm_ioctl.c | |
| parent | 2af5ae8e448b88aa37277cdfaba49ba33716477f (diff) | |
Only _if_ an inactive table has been loaded, make it active when resuming.
Fixes lvrename operation.
Diffstat (limited to 'sys/dev/dm/dm_ioctl.c')
| -rw-r--r-- | sys/dev/dm/dm_ioctl.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/dm/dm_ioctl.c b/sys/dev/dm/dm_ioctl.c index 36078ec2c04..81d451850a1 100644 --- a/sys/dev/dm/dm_ioctl.c +++ b/sys/dev/dm/dm_ioctl.c @@ -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_dict) 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); |
