提交 c50abeb3 编写于 作者: M Mike Anderson 提交者: Alasdair G Kergon

dm ioctl: forbid messages to devices being deleted

Once we begin deleting a device, prevent any further messages being sent
to targets of its table (to avoid races).
Signed-off-by: NMike Anderson <andmike@linux.vnet.ibm.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 432a212c
......@@ -1303,6 +1303,11 @@ static int target_message(struct dm_ioctl *param, size_t param_size)
if (!table)
goto out_argv;
if (dm_deleting_md(md)) {
r = -ENXIO;
goto out_table;
}
ti = dm_table_find_target(table, tmsg->sector);
if (!dm_target_is_valid(ti)) {
DMWARN("Target message sector outside device.");
......@@ -1314,6 +1319,7 @@ static int target_message(struct dm_ioctl *param, size_t param_size)
r = -EINVAL;
}
out_table:
dm_table_put(table);
out_argv:
kfree(argv);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册