From: Mike Christie <michael.christie@oracle.com>
To: Khazhismel Kumykov <khazhy@chromium.org>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Gabriel Krisman Bertazi <krisman@collabora.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Khazhismel Kumykov <khazhy@google.com>
Subject: Re: [PATCH] scsi: fix crash in scsi_remove_host after alloc failure
Date: Tue, 18 Oct 2022 11:47:50 -0500 [thread overview]
Message-ID: <833d4fff-7fb9-31c5-3ed8-ed9a7753a5db@oracle.com> (raw)
In-Reply-To: <20221017171147.3300575-1-khazhy@google.com>
On 10/17/22 12:11 PM, Khazhismel Kumykov wrote:
> If transport_register_device returns error, shost_gendev has already
> been cleaned up - however since we ignore the error device setup
> continues happily. We will eventually call transport_unregister_device,
> attempting to delete shost_gendev again, resulting in a crash.
>
> It looks like when this cleanup behavior was added, iscsi was updated,
> but scsi was missed.
>
> Fixes: cd7ea70bb00a ("scsi: drivers: base: Propagate errors through the transport component")
>
Where do you crash? Do we need to handle the cases transport_add_device
is called directly and we don't handle the failure then later call
transport_remove_device directly?
The thing is that transport device addition success was
supposed to be optional where we were supposed to be able to
still at least setup the device, boot and use it. Tools might
be missing some attrs but we were still supposed to run.
I think that's why we didn't propagate errors originally.
We were also supposed to also be able to call transport_configure_device
even if the transport_add_device call failed (see comment in
that function for info). Does that still work?
prev parent reply other threads:[~2022-10-18 16:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 17:11 Khazhismel Kumykov
2022-10-18 16:47 ` Mike Christie [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=833d4fff-7fb9-31c5-3ed8-ed9a7753a5db@oracle.com \
--to=michael.christie@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=jejb@linux.ibm.com \
--cc=khazhy@chromium.org \
--cc=khazhy@google.com \
--cc=krisman@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®