diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 1a3e40be81c625294f9e14d6db18780dc9e46aac..7db47cd2663441be8b5aed8ac75d5fa52e62e56b 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1446,11 +1446,12 @@ static int table_clear(struct file *filp, struct dm_ioctl *param, size_t param_s hc->new_map = NULL; } - param->flags &= ~DM_INACTIVE_PRESENT_FLAG; - - __dev_status(hc->md, param); md = hc->md; up_write(&_hash_lock); + + param->flags &= ~DM_INACTIVE_PRESENT_FLAG; + __dev_status(md, param); + if (old_map) { dm_sync_table(md); dm_table_destroy(old_map);