ublk-org / ublksrv

ublk: userspace block device driver
MIT License
147 stars 50 forks source link

ublk del --all always returns failure #61

Closed vt-alt closed 9 months ago

vt-alt commented 1 year ago

I did simple smoke test for our CI and found that ublk del --all always exits with a failure (exitcode=237).

Looking at the code I think this is the casue:

cmd_dev_del iterates over MAX_NR_UBLK_DEVS number of devices:

        for (i = 0; i < MAX_NR_UBLK_DEVS; i++)
                ret = __cmd_dev_del(i, true);
  1. This overrides exit status (of intermediate dels), and
  2. Always reporting exit for last (128th) device (which is usually non-existent), which is -19 (that becomes exitcode 237).
ming1 commented 1 year ago

Fixed in bac8d72 ("ublksrv_tgt: don't return error if trying to delete unexisted device").

Thanks for the report.

vt-alt commented 9 months ago

Thanks!