Message ID | 20230728231720.104751-3-yuxuan.luo@canonical.com |
---|---|
State | New |
Headers | show |
Series | [SRU,Jammy-OEM-6.0,1/1] dm ioctl: fix nested locking in table_clear() to remove deadlock concern | expand |
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 98976aaa9db9..9dbcfe21bc86 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -1532,11 +1532,12 @@ static int table_clear(struct file *filp, struct dm_ioctl *param, size_t param_s has_new_map = true; } - 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);