All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "ptikhomirov@virtuozzo.com" <ptikhomirov@virtuozzo.com>
Cc: "jthumshirn@suse.de" <jthumshirn@suse.de>,
	"hch@lst.de" <hch@lst.de>,
	"stuart.w.hayes@gmail.com" <stuart.w.hayes@gmail.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"hare@suse.com" <hare@suse.com>,
	"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
	"khorenko@virtuozzo.com" <khorenko@virtuozzo.com>
Subject: Re: [PATCH v3 1/2] Ensure that the SCSI error handler gets woken up
Date: Tue, 5 Dec 2017 16:19:50 +0000	[thread overview]
Message-ID: <1512490788.2660.16.camel@wdc.com> (raw)
In-Reply-To: <8514bfc3-4d11-be94-eef4-82f48d436656@virtuozzo.com>

On Tue, 2017-12-05 at 13:18 +0300, Pavel Tikhomirov wrote:
> On 12/04/2017 09:06 PM, Bart Van Assche wrote:
> > +static void scsi_eh_inc_host_failed(struct rcu_head *head)
> > +{
> > +	struct Scsi_Host *shost = container_of(head, typeof(*shost), rcu);
> > +	unsigned long flags;
> > +
> > +	spin_lock_irqsave(shost->host_lock, flags);
> > +	shost->host_failed++;
> 
> May be we need to increment host_failed before call_rcu(), so that all 
> rcu protected readers already see a change at these point?

Sorry but I don't think that would work. If host_failed would be changed first
then it can happen that scsi_dec_host_busy() encounters that the host state is
"running" and hence that it skips the host_failed check. That can result in a
missed error handler wakeup, which is what we want to avoid.

Bart.

  reply	other threads:[~2017-12-05 16:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 18:06 [PATCH v3 0/2] Ensure that the SCSI error handler gets woken up Bart Van Assche
2017-12-04 18:06 ` [PATCH v3 1/2] " Bart Van Assche
2017-12-05 10:18   ` Pavel Tikhomirov
2017-12-05 16:19     ` Bart Van Assche [this message]
     [not found]       ` <sr4inbsihn7krboba8euqqp1.1512508675214@email.android.com>
2017-12-05 21:46         ` Bart Van Assche
2017-12-05 22:49           ` Pavel Tikhomirov
2017-12-05 22:59             ` Bart Van Assche
2017-12-06  7:20               ` Pavel Tikhomirov
2017-12-07  5:12                 ` Stuart Hayes
2017-12-04 18:06 ` [PATCH v3 2/2] Convert a source code comment into a runtime check Bart Van Assche
2017-12-07  1:55 ` [PATCH v3 0/2] Ensure that the SCSI error handler gets woken up Martin K. Petersen
2017-12-07 12:02   ` John Garry
2017-12-07 16:50     ` Bart Van Assche

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512490788.2660.16.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=hare@suse.com \
    --cc=hch@lst.de \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jthumshirn@suse.de \
    --cc=khorenko@virtuozzo.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ptikhomirov@virtuozzo.com \
    --cc=stable@vger.kernel.org \
    --cc=stuart.w.hayes@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.