All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dm-ioctl: report an error if a device has no table
@ 2026-05-11 11:04 Mikulas Patocka
  2026-05-11 20:06 ` Benjamin Marzinski
  0 siblings, 1 reply; 2+ messages in thread
From: Mikulas Patocka @ 2026-05-11 11:04 UTC (permalink / raw)
  To: Alasdair Kergon, Mike Snitzer, Benjamin Marzinski; +Cc: dm-devel

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

---
 drivers/md/dm-ioctl.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/md/dm-ioctl.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-ioctl.c	2026-04-27 19:06:34.000000000 +0200
+++ linux-2.6/drivers/md/dm-ioctl.c	2026-05-06 22:10:09.000000000 +0200
@@ -1816,8 +1816,11 @@ static int target_message(struct file *f
 		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;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] dm-ioctl: report an error if a device has no table
  2026-05-11 11:04 [PATCH] dm-ioctl: report an error if a device has no table Mikulas Patocka
@ 2026-05-11 20:06 ` Benjamin Marzinski
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Marzinski @ 2026-05-11 20:06 UTC (permalink / raw)
  To: Mikulas Patocka; +Cc: Alasdair Kergon, Mike Snitzer, dm-devel

On Mon, May 11, 2026 at 01:04:16PM +0200, Mikulas Patocka wrote:
> 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>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-11 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 11:04 [PATCH] dm-ioctl: report an error if a device has no table Mikulas Patocka
2026-05-11 20:06 ` Benjamin Marzinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.