diff options
author | Mike Anderson <andmike@linux.vnet.ibm.com> | 2009-12-10 23:52:20 +0000 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-12-10 23:52:20 +0000 |
commit | c50abeb38026ea721a812cf8a9b2fac5d3b7684b (patch) | |
tree | 755a412a2aa8bacf35a278f1009229c64424b03c /drivers/md | |
parent | 432a212c0dd0f4ca386cf37c5b740ac9dbda4479 (diff) | |
download | kernel_samsung_smdk4412-c50abeb38026ea721a812cf8a9b2fac5d3b7684b.zip kernel_samsung_smdk4412-c50abeb38026ea721a812cf8a9b2fac5d3b7684b.tar.gz kernel_samsung_smdk4412-c50abeb38026ea721a812cf8a9b2fac5d3b7684b.tar.bz2 |
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: Mike Anderson <andmike@linux.vnet.ibm.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-ioctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index bf3d19a..d06dd39 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -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); |