Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp386640imm; Mon, 9 Jul 2018 03:45:27 -0700 (PDT) X-Google-Smtp-Source: AAOMgpenwaoqPCqY+bIxfZcZk4Q6Qdr9XtBs/95fromzK98zXOquTQNPnkwGrLhZj+r8ICShQN0f X-Received: by 2002:a17:902:768a:: with SMTP id m10-v6mr20118538pll.293.1531133127054; Mon, 09 Jul 2018 03:45:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531133127; cv=none; d=google.com; s=arc-20160816; b=sYEiqbp47fSAkd5KSmXND1tR7qZ0QY0tQaUrtzGJPjlNd4olmmlgwa5h5hvw0b3Pj9 9zMixNJgsDOllEEf6gXhBnBLDIy5NVV5Ft8PKYMdSqJL3i0MwjHkNuM75YH/nA5xWQvr Bl2h+9Y+zwxl7v6+q1ZKHK3yQx86/XfcT+Hds0aS231y+W1TmKcvYC0arGQYz4a/RA8h HnHrTfn4QDC4PFx8+wwz/yuXLZyOClRJUiyNwaBAmmn2+USyGiW2YRKgTCvElsRZaCiU UF4NtbXcX/YORf3tQb7tNfNq+dtyNoxohYkan7Y5c/BSYWY3MllZYI7mF9+r7ZMKY8Av V1Aw== 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:from:references:cc:to:subject:arc-authentication-results; bh=VZzOktQqOL9ABPbHHMfgxnBCc0Q/6GORFdxrgkZpZpo=; b=SpaiUExbqq9uQioh4bt+m2EVcAeGMK9O3kDYOPDfjbMbO3RxO91MwPN5KHx6gNOR4P oSwqP9CXf0pha5sREmegOYd4ECPKnNzlNhdxRPCmTZ+VVHxNi3WR6t2cwpsBPDYbxq5g +OqJiTM24l10lIcqjgqH3hOFFxP8dZBXpRrbEayjta6WqzCdC+JmpMr+R4zkxAs4SEY1 EKFLjdUiXobvFUWArurJJYmXr1MKQUOb9z04KS/ZevmSW0xHb6DewD8Ags8oDWoOXeKG cgyFwdyrUacbYYaz2Eku9yXLzLMSX6fa+w0ZWo2udFT4SWERJZC3Ehz9ashQ+9jtH7P8 T2Bg== 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 t5-v6si13158136pgu.305.2018.07.09.03.45.11; Mon, 09 Jul 2018 03:45:27 -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 S932466AbeGIKnT (ORCPT + 99 others); Mon, 9 Jul 2018 06:43:19 -0400 Received: from smtp03.citrix.com ([162.221.156.55]:20411 "EHLO SMTP03.CITRIX.COM" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754432AbeGIKnS (ORCPT ); Mon, 9 Jul 2018 06:43:18 -0400 X-IronPort-AV: E=Sophos;i="5.51,330,1526342400"; d="scan'208";a="59715270" Subject: Re: [RFC 1/1] libiscsi: Fix race between iscsi_xmit_task and iscsi_complete_task To: , , , , CC: , References: <1530543624-130587-1-git-send-email-anoob.soman@citrix.com> From: Anoob Soman Message-ID: <5cc14ea6-2586-ce2b-f8c4-c46222280df7@citrix.com> Date: Mon, 9 Jul 2018 11:43:14 +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: <1530543624-130587-1-git-send-email-anoob.soman@citrix.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.