Skip to content

Commit ee4465a

Browse files
Mikulas Patockagregkh
authored andcommitted
dm-ioctl: report an error if a device has no table
commit 457e323 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>
1 parent 93dfe94 commit ee4465a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/md/dm-ioctl.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1806,8 +1806,11 @@ static int target_message(struct file *filp, struct dm_ioctl *param, size_t para
18061806
goto out_argv;
18071807

18081808
table = dm_get_live_table(md, &srcu_idx);
1809-
if (!table)
1809+
if (!table) {
1810+
DMERR("The device has no table.");
1811+
r = -EINVAL;
18101812
goto out_table;
1813+
}
18111814

18121815
if (dm_deleting_md(md)) {
18131816
r = -ENXIO;

0 commit comments

Comments
 (0)