Skip to content

Take #2: Resurrect sdev during scanning

Hannes Reinecke linux-scsi 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest11 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11Add scsi_destroy_device()drivers/scsi/scsi_scan.c include/scsi/scsi_device.h+7 -20 replies
2/11Improve error messages in scsi_sysfs_add_sdev()drivers/scsi/scsi_sysfs.c+4 -20 replies
3/11Remove stale put_device() from scsi_sysfs_add_sdev()drivers/scsi/scsi_sysfs.c+0 -10 replies
4/11Implement SDEV_NEW statedrivers/scsi/scsi_lib.c drivers/scsi/scsi_scan.c drivers/scsi/scsi_sysfs.c +1 more+24 -60 replies
5/11Free sdev class device from release functiondrivers/scsi/scsi_scan.c drivers/scsi/scsi_sysfs.c+24 -260 replies
6/11Rename __scsi_remove_device() into scsi_sysfs_remove_sdev()drivers/scsi/scsi_priv.h drivers/scsi/scsi_scan.c drivers/scsi/scsi_sysfs.c+8 -80 replies
7/11Implement scsi_configure_device()drivers/scsi/scsi_scan.c+49 -180 replies
8/11Remove obsolete scsi_destroy_sdev() functiondrivers/scsi/scsi_scan.c+0 -80 replies
9/11Implement scsi_resurrect_device()drivers/scsi/scsi.c drivers/scsi/scsi_lib.c drivers/scsi/scsi_scan.c+58 -00 replies
10/11Fixup scsi_sysfs_add_sdev()drivers/scsi/scsi_sysfs.c+10 -140 replies
11/11State machine cleanupdrivers/scsi/scsi_scan.c+9 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/11] Take #2: Resurrect sdev during scanning

Hi James,

this is a rework of my earlier patchset to address the outstanding 'sdev oops during scanning' issue. Problem is that any sdev in state 'SDEV_DEL' is still visible to the host until the refcount drops to zero. When a scan occurs during this time we access a half-initialized sdev and all hell breaks loose.

To address this issue this patchset expands the sdev state-machine to allow a transition from SDEV_DEL back to SDEV_RUNNING. This is implemented in the function scsi_resurrect_device(). So during scan we only have to make sure to call scsi_resurrect_device() on all sdevs as this will guarantee us that the sdev is operational during scanning.

In order to do so I reworked the sdev allocation and removal so that we're more aligned with the sdev state machine and the driver core's device_initialize / device_add logic.

Additionally I have expanded the state machine even more by introducing a SDEV_NEW state, which will transition into SDEV_CREATED once slave_alloc() is run. This will allow us to detect from within the ->release function whether slave_destroy() should be called. With this we don't have to modify any LLDD, thus addressing the issue hch had with the earlier patchset.

Comments etc. welcome.

Otherwise, please apply.

Cheers,

Hannes

Signature · 8 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html