mbox series

[0/3] Fix a race condition in the target driver

Message ID 20200313161253.5507-1-mlombard@redhat.com (mailing list archive)
Headers show
Series Fix a race condition in the target driver | expand

Message

Maurizio Lombardi March 13, 2020, 4:12 p.m. UTC
Multiple threads may try to destroy the same iscsi session
structure by calling iscsit_close_session() and then end
up hanging.

This patchset modifies the driver so the session
structure is destroyed by iscsit_close_connection() when
the last connection gets closed, thus preventing
the race condition.

Maurizio Lombardi (3):
  target: remove boilerplate code
  target: fix target hang when multiple threads try to destroy the same
    iscsi session.
  iscsi target: calling iscsit_stop_session() inside
    iscsit_close_session() has no effect

 drivers/target/iscsi/iscsi_target.c          | 82 ++++++--------------
 drivers/target/iscsi/iscsi_target.h          |  1 -
 drivers/target/iscsi/iscsi_target_configfs.c |  5 +-
 drivers/target/iscsi/iscsi_target_login.c    |  5 +-
 include/target/iscsi/iscsi_target_core.h     |  2 +-
 5 files changed, 32 insertions(+), 63 deletions(-)

Comments

Bart Van Assche March 13, 2020, 5:39 p.m. UTC | #1
On 3/13/20 9:12 AM, Maurizio Lombardi wrote:
> Multiple threads may try to destroy the same iscsi session
> structure by calling iscsit_close_session() and then end
> up hanging.
> 
> This patchset modifies the driver so the session
> structure is destroyed by iscsit_close_connection() when
> the last connection gets closed, thus preventing
> the race condition.
> 
> Maurizio Lombardi (3):
>    target: remove boilerplate code
>    target: fix target hang when multiple threads try to destroy the same
>      iscsi session.
>    iscsi target: calling iscsit_stop_session() inside
>      iscsit_close_session() has no effect
> 
>   drivers/target/iscsi/iscsi_target.c          | 82 ++++++--------------
>   drivers/target/iscsi/iscsi_target.h          |  1 -
>   drivers/target/iscsi/iscsi_target_configfs.c |  5 +-
>   drivers/target/iscsi/iscsi_target_login.c    |  5 +-
>   include/target/iscsi/iscsi_target_core.h     |  2 +-
>   5 files changed, 32 insertions(+), 63 deletions(-)
> 

Hi Mike, Varun and Rahul,

This patch series may affect the iSER target driver so you may want to 
verify this patch series on your test setups.

Thanks,

Bart.
Rahul Kundu March 18, 2020, 4:15 a.m. UTC | #2
Hi Bart,

Patch series is tested good.

Thanks,
Rahul Kundu.

-----Original Message-----
From: Bart Van Assche <bvanassche@acm.org> 
Sent: Friday, March 13, 2020 11:09 PM
To: Maurizio Lombardi <mlombard@redhat.com>; target-devel@vger.kernel.org
Cc: martin.petersen@oracle.com; ddiss@suse.de; mcoleman@datto.com; Varun Prakash <varun@chelsio.com>; Rahul Kundu <rahul.kundu@chelsio.com>; Mike Marciniszyn <mike.marciniszyn@intel.com>
Subject: Re: [PATCH 0/3] Fix a race condition in the target driver

On 3/13/20 9:12 AM, Maurizio Lombardi wrote:
> Multiple threads may try to destroy the same iscsi session structure 
> by calling iscsit_close_session() and then end up hanging.
> 
> This patchset modifies the driver so the session structure is 
> destroyed by iscsit_close_connection() when the last connection gets 
> closed, thus preventing the race condition.
> 
> Maurizio Lombardi (3):
>    target: remove boilerplate code
>    target: fix target hang when multiple threads try to destroy the same
>      iscsi session.
>    iscsi target: calling iscsit_stop_session() inside
>      iscsit_close_session() has no effect
> 
>   drivers/target/iscsi/iscsi_target.c          | 82 ++++++--------------
>   drivers/target/iscsi/iscsi_target.h          |  1 -
>   drivers/target/iscsi/iscsi_target_configfs.c |  5 +-
>   drivers/target/iscsi/iscsi_target_login.c    |  5 +-
>   include/target/iscsi/iscsi_target_core.h     |  2 +-
>   5 files changed, 32 insertions(+), 63 deletions(-)
> 

Hi Mike, Varun and Rahul,

This patch series may affect the iSER target driver so you may want to verify this patch series on your test setups.

Thanks,

Bart.
Marciniszyn, Mike March 18, 2020, 1:02 p.m. UTC | #3
> Hi Mike, Varun and Rahul,
> 
> This patch series may affect the iSER target driver so you may want to verify
> this patch series on your test setups.
> 
> Thanks,
> 
> Bart.

What is the base for this series.

I can easily test.

Mike