Alexander Wetzel d4e655c49f scsi: sg: Avoid race in error handling & drop bogus warn
Commit 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race") introduced
an incorrect WARN_ON_ONCE() and missed a sequence where sg_device_destroy()
was used after scsi_device_put().

sg_device_destroy() is accessing the parent scsi_device request_queue which
will already be set to NULL when the preceding call to scsi_device_put()
removed the last reference to the parent scsi_device.

Drop the incorrect WARN_ON_ONCE() - allowing more than one concurrent
access to the sg device - and make sure sg_device_destroy() is not used
after scsi_device_put() in the error handling.

Link: https://lore.kernel.org/all/5375B275-D137-4D5F-BE25-6AF8ACAE41EF@linux.ibm.com
Fixes: 27f58c04a8f4 ("scsi: sg: Avoid sg device teardown race")
Cc: stable@vger.kernel.org
Signed-off-by: Alexander Wetzel <Alexander@wetzel-home.de>
Link: https://lore.kernel.org/r/20240401191038.18359-1-Alexander@wetzel-home.de
Tested-by: Sachin Sant <sachinp@linux.ibm.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2024-04-04 18:22:12 -04:00
..
2024-03-13 18:34:05 -07:00
2024-03-21 13:34:15 -07:00
2024-03-22 12:46:07 -07:00
2024-03-07 21:52:03 +00:00
2024-03-19 11:57:26 -07:00
2024-03-18 15:11:44 -07:00
2024-03-15 11:58:32 -07:00
2024-03-07 20:37:04 +00:00
2024-03-15 12:25:13 -07:00
2024-03-24 13:54:06 -07:00
2024-03-21 19:04:31 -07:00
2024-03-14 09:56:15 -07:00
2024-03-21 10:01:02 -07:00
2024-03-18 15:34:03 -07:00
2024-03-06 14:03:31 +00:00
2024-03-24 10:45:31 -07:00
2024-03-07 20:32:47 +00:00
2024-03-07 20:26:24 -08:00
2024-03-15 17:53:48 -07:00
2024-03-18 17:30:46 +00:00
2024-03-13 10:59:28 -07:00
2024-03-21 12:44:10 -07:00
2024-03-23 08:43:21 -07:00
2024-03-18 17:30:46 +00:00
2024-03-07 20:32:38 +00:00
2024-03-23 08:43:21 -07:00
2024-03-15 11:58:32 -07:00
2024-03-21 13:23:07 -06:00
2024-03-21 13:34:15 -07:00
2024-03-14 10:58:27 -07:00
2024-03-21 12:35:20 -07:00
2024-03-16 11:24:51 -07:00
2024-03-13 11:33:10 -07:00
2024-03-12 17:44:08 -07:00
2024-03-22 09:52:37 -07:00
2024-03-21 10:37:39 -07:00
2024-03-21 17:16:46 -07:00
2024-03-21 15:18:18 -07:00
2024-03-15 12:22:52 -07:00
2024-03-22 09:57:00 -07:00
2024-03-12 10:35:24 -07:00
2024-03-21 12:44:10 -07:00
2024-03-21 12:35:20 -07:00
2024-03-15 13:21:13 -07:00
2024-03-19 08:57:39 -07:00
2024-03-17 12:06:10 -07:00
2024-03-19 08:48:09 -07:00