Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1215390

Re: [PATCH] scsi: fix scsi_error_handler vs. scsi_host_dev_release race

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH] scsi: fix scsi_error_handler vs. scsi_host_dev_release race
Date 2015-08-28 17:20 +0200
Message-ID <q2tBD-71T-1@gated-at.bofh.it> (permalink)
References <q29Wi-3Qj-29@gated-at.bofh.it> <q2tih-6pk-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri 28-08-15 07:56:13, James Bottomley wrote:
[...]
> > diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
> > index 6457a8a0db9c..2c0a817d5dbe 100644
> > --- a/drivers/scsi/scsi_error.c
> > +++ b/drivers/scsi/scsi_error.c
> > @@ -2169,8 +2169,11 @@ int scsi_error_handler(void *data)
> >  	 * We never actually get interrupted because kthread_run
> >  	 * disables signal delivery for the created thread.
> >  	 */
> > -	while (!kthread_should_stop()) {
> > +	while (true) {
> 
> Comment here, I think, please to avoid any other erroneous tidying
> attempts.  How about
> 
> /* 
>  * The sequence in kthread_stop() sets the stop flag first then 
>  * wakes the process.  To avoid missed wakeups, the task should always
>  * be in a non running state before the stop flag is checked
>  */
> 
> Otherwise this looks fine.

I do not have objections to the added comment.

-- 
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] scsi: fix scsi_error_handler vs. scsi_host_dev_release race mhocko@kernel.org - 2015-08-27 20:20 +0200
  Re: [PATCH] scsi: fix scsi_error_handler vs. scsi_host_dev_release race Dan Williams <dan.j.williams@intel.com> - 2015-08-27 20:30 +0200
  Re: [PATCH] scsi: fix scsi_error_handler vs. scsi_host_dev_release  race Hannes Reinecke <hare@suse.de> - 2015-08-28 08:50 +0200
  Re: [PATCH] scsi: fix scsi_error_handler vs. scsi_host_dev_release  race James Bottomley <James.Bottomley@HansenPartnership.com> - 2015-08-28 17:00 +0200
    Re: [PATCH] scsi: fix scsi_error_handler vs. scsi_host_dev_release  race Michal Hocko <mhocko@kernel.org> - 2015-08-28 17:20 +0200

csiph-web