Skip to content

Commit 457e323

Browse files
author
Mikulas Patocka
committed
dm-ioctl: report an error if a device has no table
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>
1 parent 5256a62 commit 457e323

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
@@ -1938,8 +1938,11 @@ static int target_message(struct file *filp, struct dm_ioctl *param, size_t para
19381938
goto out_argv;
19391939

19401940
table = dm_get_live_table(md, &srcu_idx);
1941-
if (!table)
1941+
if (!table) {
1942+
DMERR("The device has no table.");
1943+
r = -EINVAL;
19421944
goto out_table;
1945+
}
19431946

19441947
if (dm_deleting_md(md)) {
19451948
r = -ENXIO;

0 commit comments

Comments
 (0)