Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3703171imm; Tue, 17 Jul 2018 08:58:58 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd8FY3YYnXU+clPwuDqwa4BObjo79W4LkQC/Z+rS0jGqk/vxGIqxsYYK7rAhcBsDTLlVRBz X-Received: by 2002:a63:7a43:: with SMTP id j3-v6mr2103324pgn.363.1531843138619; Tue, 17 Jul 2018 08:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531843138; cv=none; d=google.com; s=arc-20160816; b=BHwkOB8pBhbEmwskyl/gSCAj2knbCsFuXU+7+3ZveDgWH+PeFRwSu+4qKGi1Nv8pfs WkJAJu9vOb992cOOiVv0clSn4i034brVf4FDy75BGtvoMVqjGiXBx7PcjLfd9hz8mtjO /bqwzA9GjuaFOPqC4m6a8RwgDnhL8pC7vDCdQ4Lwk1SvpaEEd8EEDt2i1AeeKzgf2tGQ 7NciSTjS1rLl68hSk8xhWTQjdUV8D/p/3eCtr6u5zKQGMeMBxz88AbuP5KoFwMVreboU dEI4UJ7zkAJ8BDZvbMM9LQ6fYTjlpRkERQqRVNCc12kKyWqhns8D5c9oLgILwckq1bqE l6ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:arc-authentication-results; bh=kGc7iU1eNH7fSrgVmp99ITK0D3t03amhSPHfzgBK6Qo=; b=P4XDf5qfRYBbeP8QGXnmk31MSXZuUBMCrNEI2uICtnDVQKH/Vy4jYnE6Y5la02Qasy 8OmZAqUvE+UHpBNPwcYcJwcDhpSV1v9wc1VLe1ypKqEPaF/jOuyD5GSSBhlsUAbqDa7W UJE7UUz+4bDcOXE6q0qVC1DTU06fBjnvs9urdJ6U0N1Kr/tVoxQIHPAZl7xQj4tv1bJs 65YpXua1No6kfAl2eRXnxV8sOEd86Wb3yPf2BE7GQNjQ22DhNArOMT6iVWGxhDVTzrr9 I2R8RvanK+LY47w/3jVuFhv8gYm+Ku0hbYPefzqrdY2YebQY6NTXstgM//UsihnG1bcw ejnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a2-v6si1155891pgh.396.2018.07.17.08.58.43; Tue, 17 Jul 2018 08:58:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730301AbeGQQaI (ORCPT + 99 others); Tue, 17 Jul 2018 12:30:08 -0400 Received: from smtp03.citrix.com ([162.221.156.55]:60343 "EHLO SMTP03.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729805AbeGQQaI (ORCPT ); Tue, 17 Jul 2018 12:30:08 -0400 X-IronPort-AV: E=Sophos;i="5.51,366,1526342400"; d="scan'208";a="60430637" Subject: Re: [RFC 1/1] libiscsi: Fix race between iscsi_xmit_task and iscsi_complete_task From: Anoob Soman To: , , , , CC: , References: <1530543624-130587-1-git-send-email-anoob.soman@citrix.com> <5cc14ea6-2586-ce2b-f8c4-c46222280df7@citrix.com> Message-ID: <41949f23-794e-60c8-ce0f-fcb170b1db39@citrix.com> Date: Tue, 17 Jul 2018 16:56:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <5cc14ea6-2586-ce2b-f8c4-c46222280df7@citrix.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/07/18 11:43, Anoob Soman wrote: > On 02/07/18 16:00, Anoob Soman wrote: >> --- >>   drivers/scsi/libiscsi.c | 6 ++++++ >>   1 file changed, 6 insertions(+) >> >> diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c >> index d609383..aa3be6f 100644 >> --- a/drivers/scsi/libiscsi.c >> +++ b/drivers/scsi/libiscsi.c >> @@ -1449,7 +1449,13 @@ static int iscsi_xmit_task(struct iscsi_conn >> *conn) >>       if (test_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx)) >>           return -ENODATA; >>   +    spin_lock_bh(&conn->session->back_lock); >> +    if (conn->task == NULL) { >> +        spin_unlock_bh(&conn->session->back_lock); >> +        return -ENODATA; >> +    } >>       __iscsi_get_task(task); >> +    spin_unlock_bh(&conn->session->back_lock); >>       spin_unlock_bh(&conn->session->frwd_lock); >>       rc = conn->session->tt->xmit_task(task); >>       spin_lock_bh(&conn->session->frwd_lock); > > > Hi Chris, Lee. > > Could one of you look at this change and provide some comments ? > > Thanks, > > -Anoob. > Hi, Can someone look at this change ? Thanks, Anoob.