linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
To: Sagi Grimberg
	<sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>,
	Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Cc: Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>,
	Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Sebastian Parschauer
	<sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>,
	"Martin K. Petersen"
	<martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>,
	Robert Elliott <Elliott-VXdhtT5mjnY@public.gmane.org>,
	Ming Lei <ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>,
	"linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v3 11/11] IB/srp: Fix a race condition triggered by destroying a queue pair
Date: Thu, 30 Oct 2014 15:53:46 +0100	[thread overview]
Message-ID: <545250FA.1090908@acm.org> (raw)
In-Reply-To: <54524A7B.3060708-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

On 10/30/14 15:26, Sagi Grimberg wrote:
> On 10/30/2014 3:50 PM, Bart Van Assche wrote:
>> +    /* Destroying a QP and reusing ch->done is only safe if not
>> connected */
>> +    WARN_ON_ONCE(target->connected);
>
> I thought we agreed that cannot happen. I guess I don't mind keeping
> it... BTW, were you able to reproduce this race as well?

Hello Sagi,

Agreed that it is possible to conclude from the ib_srp source code that 
the above "WARN_ON_ONCE(target->connected)" statement will never be 
triggered. The reason I added that statement is to have an explicit 
check of that condition. Such statements can be helpful in case anyone 
would like to modify the SRP initiator driver.

I have not yet been able to reproduce the crash addressed by this patch. 
But the code added via this patch has been triggered in my tests. Since 
this code is e.g. called from srp_free_ch_ib(), unloading the ib_srp 
kernel module after login succeeded is sufficient to trigger this code.

Bart.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-10-30 14:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 13:44 [PATCH v3 0/11] IB/srp: Add multichannel support Bart Van Assche
2014-10-30 13:45 ` [PATCH v3 02/11] scsi-mq: Add support for multiple hardware queues Bart Van Assche
2014-10-30 13:46 ` [PATCH v3 03/11] scsi_tcq.h: " Bart Van Assche
2014-10-30 13:46 ` [PATCH v3 04/11] IB/srp: Move ib_destroy_cm_id() call into srp_free_ch_ib() Bart Van Assche
2014-10-30 13:46 ` [PATCH v3 05/11] IB/srp: Remove stale connection retry mechanism Bart Van Assche
2014-10-30 13:47 ` [PATCH v3 06/11] IB/srp: Avoid that I/O hangs due to a cable pull during LUN scanning Bart Van Assche
     [not found]   ` <5452416A.1010403-HInyCGIudOg@public.gmane.org>
2014-10-30 14:28     ` Sagi Grimberg
     [not found] ` <545240AE.6060009-HInyCGIudOg@public.gmane.org>
2014-10-30 13:45   ` [PATCH v3 01/11] blk-mq: Add blk_mq_unique_tag() Bart Van Assche
2014-11-04 14:14     ` Christoph Hellwig
     [not found]       ` <20141104141432.GA446-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-11-05 12:37         ` Bart Van Assche
     [not found]           ` <545A19FA.40706-HInyCGIudOg@public.gmane.org>
2014-11-05 18:54             ` Christoph Hellwig
2014-11-06 14:22               ` Bart Van Assche
2014-10-30 13:48   ` [PATCH v3 07/11] IB/srp: Introduce two new srp_target_port member variables Bart Van Assche
2014-10-30 13:48   ` [PATCH v3 09/11] IB/srp: Use block layer tags Bart Van Assche
2014-10-30 14:30     ` Sagi Grimberg
     [not found]     ` <545241C7.5010707-HInyCGIudOg@public.gmane.org>
2014-11-12 10:45       ` Christoph Hellwig
     [not found]         ` <20141112104537.GA13223-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
2014-11-24 15:43           ` Bart Van Assche
2014-10-30 13:49   ` [PATCH v3 10/11] IB/srp: Add multichannel support Bart Van Assche
2014-10-30 13:48 ` [PATCH v3 08/11] IB/srp: Separate target and channel variables Bart Van Assche
2014-10-30 13:50 ` [PATCH v3 11/11] IB/srp: Fix a race condition triggered by destroying a queue pair Bart Van Assche
     [not found]   ` <5452420B.2070206-HInyCGIudOg@public.gmane.org>
2014-10-30 14:26     ` Sagi Grimberg
     [not found]       ` <54524A7B.3060708-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-10-30 14:53         ` Bart Van Assche [this message]
2014-10-30 15:10           ` Sagi Grimberg

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=545250FA.1090908@acm.org \
    --to=bvanassche-hinycgiudog@public.gmane.org \
    --cc=Elliott-VXdhtT5mjnY@public.gmane.org \
    --cc=axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org \
    --cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-scsi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=martin.petersen-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=ming.lei-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org \
    --cc=sagig-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=sagig-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).