• James Bottomley's avatar
    SCSI: enclosure: fix WARN_ON in dual path device removing · e891b8e3
    James Bottomley authored
    commit a1470c7bf3a4676e62e4c0fb204e339399eb5c59 upstream.
    Bug report from: wenxiong@linux.vnet.ibm.com
    The issue is happened in dual controller configuration. We got the
    sysfs warnings when rmmod the ipr module.
    enclosure_unregister() in drivers/msic/enclosure.c, call device_unregister()
    for each componment deivce, device_unregister() ->device_del()->kobject_del()
    ->sysfs_remove_dir(). In sysfs_remove_dir(), set kobj->sd = NULL.
    For each componment device,
    in which checking kobj->sd again, it has been set as NULL when doing
    device_unregister. So we saw all these sysfs WARNING.
    Tested-by: wenxiong@linux.vnet.ibm.com
    Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
enclosure.c 15.6 KB