All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Wei Fang <fangwei1@huawei.com>
Cc: tj@kernel.org, jejb@linux.vnet.ibm.com,
	martin.petersen@oracle.com, linux-ide@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi: fix race between simultaneous decrements of ->host_failed
Date: Sat, 28 May 2016 23:54:52 -0700	[thread overview]
Message-ID: <20160529065452.GA21677@infradead.org> (raw)
In-Reply-To: <1464407471-3712-1-git-send-email-fangwei1@huawei.com>

On Sat, May 28, 2016 at 11:51:11AM +0800, Wei Fang wrote:
> async_sas_ata_eh(), which will call scsi_eh_finish_cmd() in some case,
> would be performed simultaneously in sas_ata_strategy_handler(). In this
> case, ->host_failed may be decreased simultaneously in
> scsi_eh_finish_cmd() on different CPUs, and become abnormal.
> 
> It will lead to permanently inequal between ->host_failed and
>  ->host_busy. Then SCSI error handler thread won't become running,
> SCSI errors after that won't be handled forever.
> 
> Use atomic type for ->host_failed to fix this race.

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

But please also update Documentation/scsi/scsi_eh.txt for this
change.

  reply	other threads:[~2016-05-29  6:54 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-28  3:51 [PATCH] scsi: fix race between simultaneous decrements of ->host_failed Wei Fang
2016-05-29  6:54 ` Christoph Hellwig [this message]
2016-05-29 15:41   ` James Bottomley
2016-05-29 18:06     ` Christoph Hellwig
2016-05-29 19:15       ` James Bottomley
2016-05-30  7:27     ` Wei Fang
2016-05-30 16:04       ` James Bottomley
2016-05-30  7:43   ` Wei Fang
2016-05-30 19:10     ` Christoph Hellwig

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=20160529065452.GA21677@infradead.org \
    --to=hch@infradead.org \
    --cc=fangwei1@huawei.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tj@kernel.org \
    /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.