File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1084,9 +1084,7 @@ void __scsi_remove_device(struct scsi_device *sdev)
1084
1084
device_unregister (& sdev -> sdev_dev );
1085
1085
transport_remove_device (dev );
1086
1086
scsi_dh_remove_device (sdev );
1087
- device_del (dev );
1088
- } else
1089
- put_device (& sdev -> sdev_dev );
1087
+ }
1090
1088
1091
1089
/*
1092
1090
* Stop accepting new requests and wait until all queuecommand() and
@@ -1097,6 +1095,16 @@ void __scsi_remove_device(struct scsi_device *sdev)
1097
1095
blk_cleanup_queue (sdev -> request_queue );
1098
1096
cancel_work_sync (& sdev -> requeue_work );
1099
1097
1098
+ /*
1099
+ * Remove the device after blk_cleanup_queue() has been called such
1100
+ * a possible bdi_register() call with the same name occurs after
1101
+ * blk_cleanup_queue() has called bdi_destroy().
1102
+ */
1103
+ if (sdev -> is_visible )
1104
+ device_del (dev );
1105
+ else
1106
+ put_device (& sdev -> sdev_dev );
1107
+
1100
1108
if (sdev -> host -> hostt -> slave_destroy )
1101
1109
sdev -> host -> hostt -> slave_destroy (sdev );
1102
1110
transport_destroy_device (dev );
You can’t perform that action at this time.
0 commit comments