All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] Revert "scsi: Fix a bdi reregistration race"" failed to apply to 3.14-stable tree
@ 2016-02-24  0:32 gregkh
  2016-02-24  1:37 ` Bart Van Assche
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2016-02-24  0:32 UTC (permalink / raw)
  To: bart.vanassche, JBottomley, stable; +Cc: stable


The patch below does not apply to the 3.14-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

>From e619e6cbecb7fe97a924d625e848605333457b13 Mon Sep 17 00:00:00 2001
From: Bart Van Assche <bart.vanassche@sandisk.com>
Date: Fri, 20 Nov 2015 14:11:01 -0800
Subject: [PATCH] Revert "scsi: Fix a bdi reregistration race"

The SCSI sd driver probes SCSI devices asynchronously. The sd_remove()
function, called indirectly by device_del(), waits until asynchronous
probing has finished. Since the block layer queue must only be cleaned
up after probing has finished, device_del() has to be called before
blk_cleanup_queue(). Hence revert commit bf2cf3baa20b.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: James Bottomley <JBottomley@Odin.com>

diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 8d2312239ae0..f5ace2bfc6db 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1110,7 +1110,9 @@ void __scsi_remove_device(struct scsi_device *sdev)
 		device_unregister(&sdev->sdev_dev);
 		transport_remove_device(dev);
 		scsi_dh_remove_device(sdev);
-	}
+		device_del(dev);
+	} else
+		put_device(&sdev->sdev_dev);
 
 	/*
 	 * Stop accepting new requests and wait until all queuecommand() and
@@ -1121,16 +1123,6 @@ void __scsi_remove_device(struct scsi_device *sdev)
 	blk_cleanup_queue(sdev->request_queue);
 	cancel_work_sync(&sdev->requeue_work);
 
-	/*
-	 * Remove the device after blk_cleanup_queue() has been called such
-	 * a possible bdi_register() call with the same name occurs after
-	 * blk_cleanup_queue() has called bdi_destroy().
-	 */
-	if (sdev->is_visible)
-		device_del(dev);
-	else
-		put_device(&sdev->sdev_dev);
-
 	if (sdev->host->hostt->slave_destroy)
 		sdev->host->hostt->slave_destroy(sdev);
 	transport_destroy_device(dev);


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] Revert "scsi: Fix a bdi reregistration race"" failed to apply to 3.14-stable tree
  2016-02-24  0:32 FAILED: patch "[PATCH] Revert "scsi: Fix a bdi reregistration race"" failed to apply to 3.14-stable tree gregkh
@ 2016-02-24  1:37 ` Bart Van Assche
  2016-02-24  2:15   ` gregkh
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Van Assche @ 2016-02-24  1:37 UTC (permalink / raw)
  To: gregkh@linuxfoundation.org, JBottomley@Odin.com,
	stable@vger.kernel.org

Hi Greg,

The original patch ("scsi: Fix a bdi reregistration race"; commit ID 
bf2cf3baa20b0a6cd2d08707ef05dc0e992a8aa0) has a "Cc: stable" tag but it 
seems like that patch did not yet make it into the linux-3.14.y nor into 
the linux-3.10.y branch? This means that it is safe to skip the revert. 
But please make sure that the original patch does not get added to any 
of the stable trees later on ...

Thanks,

Bart.

On 02/23/2016 04:32 PM, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 3.14-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
>  From e619e6cbecb7fe97a924d625e848605333457b13 Mon Sep 17 00:00:00 2001
> From: Bart Van Assche <bart.vanassche@sandisk.com>
> Date: Fri, 20 Nov 2015 14:11:01 -0800
> Subject: [PATCH] Revert "scsi: Fix a bdi reregistration race"
>
> The SCSI sd driver probes SCSI devices asynchronously. The sd_remove()
> function, called indirectly by device_del(), waits until asynchronous
> probing has finished. Since the block layer queue must only be cleaned
> up after probing has finished, device_del() has to be called before
> blk_cleanup_queue(). Hence revert commit bf2cf3baa20b.
>
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: James Bottomley <JBottomley@Odin.com>
>
> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
> index 8d2312239ae0..f5ace2bfc6db 100644
> --- a/drivers/scsi/scsi_sysfs.c
> +++ b/drivers/scsi/scsi_sysfs.c
> @@ -1110,7 +1110,9 @@ void __scsi_remove_device(struct scsi_device *sdev)
>   		device_unregister(&sdev->sdev_dev);
>   		transport_remove_device(dev);
>   		scsi_dh_remove_device(sdev);
> -	}
> +		device_del(dev);
> +	} else
> +		put_device(&sdev->sdev_dev);
>
>   	/*
>   	 * Stop accepting new requests and wait until all queuecommand() and
> @@ -1121,16 +1123,6 @@ void __scsi_remove_device(struct scsi_device *sdev)
>   	blk_cleanup_queue(sdev->request_queue);
>   	cancel_work_sync(&sdev->requeue_work);
>
> -	/*
> -	 * Remove the device after blk_cleanup_queue() has been called such
> -	 * a possible bdi_register() call with the same name occurs after
> -	 * blk_cleanup_queue() has called bdi_destroy().
> -	 */
> -	if (sdev->is_visible)
> -		device_del(dev);
> -	else
> -		put_device(&sdev->sdev_dev);
> -
>   	if (sdev->host->hostt->slave_destroy)
>   		sdev->host->hostt->slave_destroy(sdev);
>   	transport_destroy_device(dev);
>
>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] Revert "scsi: Fix a bdi reregistration race"" failed to apply to 3.14-stable tree
  2016-02-24  1:37 ` Bart Van Assche
@ 2016-02-24  2:15   ` gregkh
  0 siblings, 0 replies; 3+ messages in thread
From: gregkh @ 2016-02-24  2:15 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: JBottomley@Odin.com, stable@vger.kernel.org

On Tue, Feb 23, 2016 at 05:37:26PM -0800, Bart Van Assche wrote:
> Hi Greg,
> 
> The original patch ("scsi: Fix a bdi reregistration race"; commit ID
> bf2cf3baa20b0a6cd2d08707ef05dc0e992a8aa0) has a "Cc: stable" tag but it
> seems like that patch did not yet make it into the linux-3.14.y nor into the
> linux-3.10.y branch? This means that it is safe to skip the revert. But
> please make sure that the original patch does not get added to any of the
> stable trees later on ...

It looks like it is not in my queue so all should be safe.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-24  2:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-24  0:32 FAILED: patch "[PATCH] Revert "scsi: Fix a bdi reregistration race"" failed to apply to 3.14-stable tree gregkh
2016-02-24  1:37 ` Bart Van Assche
2016-02-24  2:15   ` gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.