lvmdevices: return error if writing device ids fail for --delldev
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 21 Jul 2025 11:41:32 +0000 (13:41 +0200)
committerMarian Csontos <mcsontos@redhat.com>
Mon, 29 Sep 2025 16:07:44 +0000 (18:07 +0200)
(cherry picked from commit 1cd2f35655e79d880d28914998b738baa0be5c07)

tools/lvmdevices.c

index fd766e1025187a719bb86aaaa629fa92ef9d2ea4..d7d3af59b17e6310da41ac020f3a4b764621fe24 100644 (file)
@@ -925,7 +925,8 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
  dev_del:
                dm_list_del(&du->list);
                free_du(du);
-               device_ids_write(cmd);
+               if (!device_ids_write(cmd))
+                       goto_bad;
                goto out;
        }
 
@@ -967,7 +968,8 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
 
                dm_list_del(&du->list);
                free_du(du);
-               device_ids_write(cmd);
+               if (!device_ids_write(cmd))
+                       goto_bad;
                goto out;
        }
 
@@ -1008,7 +1010,8 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
                }
 
                free_du(du);
-               device_ids_write(cmd);
+               if (!device_ids_write(cmd))
+                       goto_bad;
                goto out;
        }
 
This page took 0.100959 seconds and 5 git commands to generate.