Re: [PATCH v5 21/27] scsi-multipath: add delayed disk removal support
John Garry <[email protected]>
| Newsgroups | org.kernel.vger.linux-scsi,dev.linux.lists.sashiko-reviews |
|---|---|
| Organization | Oracle Corporation |
| Message-ID | <[email protected]> |
On 27/07/2026 16:23, [email protected] wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > - [High] The delayed_work struct for removing the multipath head is never initialized for SCSI. > -- > > --- Patch [21]: [PATCH v5 21/27] scsi-multipath: add delayed disk removal support --- > commit 75d6c7bf920e841ac7f62e67cc466430605858b8 > Author: John Garry <[email protected]> > > scsi-multipath: add delayed disk removal support > > Add support in core code for delayed disk removal support. In this, the > callback calls into the scsi_driver to do the necessary removal work. > >> diff --git a/drivers/scsi/scsi_multipath.c b/drivers/scsi/scsi_multipath.c >> index eae5864ce5826..ed9c83189942a 100644 >> --- a/drivers/scsi/scsi_multipath.c >> +++ b/drivers/scsi/scsi_multipath.c > [ ... ] >> @@ -360,7 +360,34 @@ static bool scsi_mpath_available_path(struct mpath_device *mpath_device) > [ ... ] >> static struct mpath_head_template smpdt = { >> + .remove_head = scsi_mpath_remove_head_work, > > [Severity: High] > Does enabling this feature lead to an uninitialized work struct regression? > > When delayed removal is triggered, it calls mod_delayed_work() on > mpath_head->remove_work. However, the initialization path for SCSI multipath > heads appears to omit INIT_DELAYED_WORK() for this work struct. it's done in mpath_alloc_head_disk() > > In drivers/scsi/scsi_multipath.c:scsi_mpath_alloc_head(): > > if (mpath_head_init(&scsi_mpath_head->mpath_head)) > goto out_free; > > mpath_head_init() zeroes the structure but does not initialize remove_work. > > Could this lead to a panic in the workqueue core when operating on an > uninitialized work struct? > >> .is_disabled = scsi_mpath_is_disabled, >> .is_optimized = scsi_mpath_is_optimized, >> .available_path = scsi_mpath_available_path, > > [ ... ] >