Revision 6aa6caff30f5dcb9e55b03b9710c30b83750cae5 authored by Joe Lawrence on 22 May 2014, 21:30:54 UTC, committed by James Bottomley on 22 May 2014, 22:54:03 UTC
The recent change in sysfs, bcdde7e221a8750f9b62b6d0bd31b72ea4ad9309
"sysfs: make __sysfs_remove_dir() recursive" revealed an asymmetric
rphy device creation/deletion sequence in scsi_transport_sas:

  modprobe mpt2sas
    sas_rphy_add
      device_add A               rphy->dev
      device_add B               sas_device transport class
      device_add C               sas_end_device transport class
      device_add D               bsg class

  rmmod mpt2sas
    sas_rphy_delete
      sas_rphy_remove
        device_del B
        device_del C
        device_del A
          sysfs_remove_group     recursive sysfs dir removal
      sas_rphy_free
        device_del D             warning

  where device A is the parent of B, C, and D.

When sas_rphy_free tries to unregister the bsg request queue (device D
above), the ensuing sysfs cleanup discovers that its sysfs group has
already been removed and emits a warning, "sysfs group... not found for
kobject 'end_device-X:0'".

Since bsg creation is a side effect of sas_rphy_add, move its
complementary removal call into sas_rphy_remove. This imposes the
following tear-down order for the devices above: D, B, C, A.

Note the sas_device and sas_end_device transport class devices (B and C
above) are created and destroyed both via the list match traversal in
attribute_container_device_trigger, so the order in which they are
handled is fixed. This is fine as long as they are deleted before their
parent device.

Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
1 parent 0c8482a
History
File Mode Size
Makefile -rw-r--r-- 394 bytes
compat.c -rw-r--r-- 19.0 KB
compat_mq.c -rw-r--r-- 3.9 KB
ipc_sysctl.c -rw-r--r-- 7.0 KB
ipcns_notifier.c -rw-r--r-- 2.2 KB
mq_sysctl.c -rw-r--r-- 2.9 KB
mqueue.c -rw-r--r-- 35.3 KB
msg.c -rw-r--r-- 24.0 KB
msgutil.c -rw-r--r-- 3.6 KB
namespace.c -rw-r--r-- 4.7 KB
sem.c -rw-r--r-- 54.8 KB
shm.c -rw-r--r-- 31.9 KB
syscall.c -rw-r--r-- 2.3 KB
util.c -rw-r--r-- 22.3 KB
util.h -rw-r--r-- 6.4 KB

back to top