All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Zhou Zhengping <johnzzpcrystal@gmail.com>
Cc: linux-scsi@vger.kernel.org, hare@suse.de,
	James.Bottomley@hansenpartnership.com
Subject: Re: [PATCH]scsi: megaraid_sas: fix raid card hotswap failure
Date: Mon, 08 May 2017 21:38:45 -0400	[thread overview]
Message-ID: <yq1d1biu7ve.fsf@oracle.com> (raw)
In-Reply-To: <1493489471-4848-1-git-send-email-johnzzpcrystal@gmail.com> (Zhou Zhengping's message of "Sun, 30 Apr 2017 02:11:11 +0800")


Zhou,

> When a scsi_device is unpluged from scsi controller, if the
> scsi_device is still be used by application layer,it won't be released
> until users release it. In this case, scsi_device_remove just set the
> scsi_device's state to be SDEV_DEL. But if you plug the disk just
> before the old scsi_device is released, then there will be two
> scsi_device structures in scsi_host->__devices. when the next
> unpluging event happens,some low-level drivers will check whether the
> scsi_device has been added to host (for example, the megaraid sas
> series controller) by calling scsi_device_lookup(call
> __scsi_device_lookup) in function
> megasas_aen_polling.__scsi_device_lookup will return the first
> scsi_device.  Because its state is SDEV_DEL, the scsi_device_lookup
> will return NULL finally, making the low-level driver assume that the
> scsi_device has been removed,and won't call scsi_device_remove,which
> will lead the failure of hot swap.

Applied to 4.12/scsi-fixes. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

      reply	other threads:[~2017-05-09  1:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-28  9:43 [PATCH] MegaRAID SAS: Raidcard hotswap wouldn't work if the device's fd is held in userspace Zhou Zhengping
2017-04-28 13:34 ` Hannes Reinecke
2017-04-29 18:11 ` [PATCH]scsi: megaraid_sas: fix raid card hotswap failure Zhou Zhengping
2017-05-09  1:38   ` Martin K. Petersen [this message]

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=yq1d1biu7ve.fsf@oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=hare@suse.de \
    --cc=johnzzpcrystal@gmail.com \
    --cc=linux-scsi@vger.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.