Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5531737imb; Thu, 7 Mar 2019 18:38:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxWW4QeIhCWwewKUhXy4NoFCi0FDcfOTjSEzKko3ThhgHDjSgKEjKz0hk42iz/9gA/zSfxZ X-Received: by 2002:a17:902:7590:: with SMTP id j16mr16333154pll.304.1552012732494; Thu, 07 Mar 2019 18:38:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552012732; cv=none; d=google.com; s=arc-20160816; b=gg54CNbsctvANmbvnIUqCCiC0NqtC2Ph/HmmlB/fwAREfA6OBrjM8V9fXzpUWXXtjr kHL+OHegYiV5oV+N9xxQYOZeTzSqQLOhbKpv2V3GUa4A2doAFeL4EJ28t2bYvzZ8jC/y SBFBG4KCc8tW3fxgB3wU9CqwabWAckJwd16Y3m4v3zJlTr/x/bSq3ZiFXTmh4KEgt1nO Rc6aPJi0/GUs2UVh9s8JjC8cVbBIN4gLJK82O07fvStsvKYwcOdYrVbqVAazQBmicsgu S8YmwLergr/eBTvvFN/65y0t/OZhu7bF+sH2xIUbc1DVJ/H7KYU53oLxqlKKXHw2Dj0f QqxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature; bh=yjJeNulqjQnicY53u3NHSMKhyR0CtoETc41K/OaFVjI=; b=us39Y4emAMTbh+AhQUeBes+FcGx9zEBu3BtoGkxQRGRWP3BvJJOiIdA1JSnC6J9xdY iuVKyaAkQHic9mzSy0IccJj/AIKpB27GdMDVaOWpVCi1xQCPIox0i+Ez7wBoQ3i8fs5+ hHM3+5GhnvjITPcCnraapMnJbxIyQB2N60NL5JOzwIaVk/8FKGqrYSYFLVnXVgMsSk/e S3vXP9etepXhhWNiJhuPF/+X5vLlLt5jL/Odm0KQuu1GQ7kwS/+/gQ1CWaripWfkugYv 2wp7VsGaqv6C6fps685zHgVwxM9NqJ9GFu+Nc0eRTaXFpZFAUmFVt9YKFiRHjDZ5QTfW +Skw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=mBpQM0Vi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si5503036pgk.319.2019.03.07.18.38.36; Thu, 07 Mar 2019 18:38:52 -0800 (PST) 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; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=mBpQM0Vi; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726414AbfCHCiR (ORCPT + 99 others); Thu, 7 Mar 2019 21:38:17 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:57910 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726283AbfCHCiR (ORCPT ); Thu, 7 Mar 2019 21:38:17 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x282YKJQ038776; Fri, 8 Mar 2019 02:38:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2018-07-02; bh=yjJeNulqjQnicY53u3NHSMKhyR0CtoETc41K/OaFVjI=; b=mBpQM0Vi5MJMhPWDp1JtVnHCinVSQmjgVJjFgxgVVpi2xPRxdE3F8i4sI5Qk+4xhVUzG 36cz1Bd/GUKUCVc8LnXcQpj7kRq8R2+sFWTYZXpZM12lZjT/bXphi8OryD0LOebPUhkR seUbkRdOA0EJJwBJ6W92pzsIfHL4n7Vxf7u7hD3RKZbWEQholQDUZcYkyeLz8oMQ/zOO a/yiUloSOo7ylsdpJVKpikTX+BdUhijK027nYeI0X4b5AJRzV1HnEynppbysgnXk6wFo UKHgxeVR4PtNQVC2Kz+RzYO99U7MDOClAD/QlwLcWVtNrNQRw4oXUyq9Pv3NuICFxy8x 6Q== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2qyjfrwtvd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 08 Mar 2019 02:38:08 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x282c7NG024056 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 8 Mar 2019 02:38:08 GMT Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x282c7Ok030171; Fri, 8 Mar 2019 02:38:07 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 Mar 2019 18:38:07 -0800 To: Lee Duncan Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, cleech@redhat.com, hare@suse.de, Lee Duncan Subject: Re: [PATCH v2] scsi:libiscsi: Hold back_lock when calling iscsi_complete_task From: "Martin K. Petersen" Organization: Oracle Corporation References: <20190225174130.29496-1-leeman.duncan@gmail.com> Date: Thu, 07 Mar 2019 21:38:04 -0500 In-Reply-To: <20190225174130.29496-1-leeman.duncan@gmail.com> (Lee Duncan's message of "Mon, 25 Feb 2019 09:41:30 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9188 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903080016 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Lee, > If there is an error queueing an iscsi command in > iscsi_queuecommand(), for example if the transport fails to take the > command in sessuin->tt->xmit_task(), then the error path can call > iscsi_complete_task() without first aquiring the back_lock as > required. This can lead to things like ITT pool can get corrupt, > resulting in duplicate ITTs being sent out. > > The solution is to hold the back_lock around iscsi_complete_task() > calls, and to add a little commenting to help others understand when > back_lock must be held. Applied to 5.1/scsi-queue, thanks! -- Martin K. Petersen Oracle Linux Engineering