[PATCH v3 11/11] IB/srp: Fix a race condition triggered by destroying a queue pair

2014-10-30 Thread Bart Van Assche
At least LID reassignment can trigger a race condition in the SRP initiator driver, namely the receive completion handler trying to post a request on a QP during or after QP destruction and before the CQ's have been destroyed. Avoid this race by modifying a QP into the error state and by waiting

Re: [PATCH v3 11/11] IB/srp: Fix a race condition triggered by destroying a queue pair

2014-10-30 Thread Sagi Grimberg
On 10/30/2014 3:50 PM, Bart Van Assche wrote: At least LID reassignment can trigger a race condition in the SRP initiator driver, namely the receive completion handler trying to post a request on a QP during or after QP destruction and before the CQ's have been destroyed. Avoid this race by

Re: [PATCH v3 11/11] IB/srp: Fix a race condition triggered by destroying a queue pair

2014-10-30 Thread Bart Van Assche
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

Re: [PATCH v3 11/11] IB/srp: Fix a race condition triggered by destroying a queue pair

2014-10-30 Thread Sagi Grimberg
On 10/30/2014 4:53 PM, Bart Van Assche wrote: 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