mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
dm-ioctl: report an error if a device has no table
commit 457e32348d upstream.
When we send a message to a device that has no table, the return code was
not set. The code would return "2", which is not considered a valid return value.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2d72613509
commit
031fce098b
@@ -1742,8 +1742,11 @@ static int target_message(struct file *filp, struct dm_ioctl *param, size_t para
|
||||
goto out_argv;
|
||||
|
||||
table = dm_get_live_table(md, &srcu_idx);
|
||||
if (!table)
|
||||
if (!table) {
|
||||
DMERR("The device has no table.");
|
||||
r = -EINVAL;
|
||||
goto out_table;
|
||||
}
|
||||
|
||||
if (dm_deleting_md(md)) {
|
||||
r = -ENXIO;
|
||||
|
||||
Reference in New Issue
Block a user