Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5504228imb; Thu, 7 Mar 2019 17:50:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzHIFl1qzDyAyKhRYY50Eqq1bgH8Zr5Q2Kmp2ig97CwwM/D+9uXdj/9vzuugXiqgvtsFSPT X-Received: by 2002:a63:fd12:: with SMTP id d18mr13789339pgh.88.1552009821081; Thu, 07 Mar 2019 17:50:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552009821; cv=none; d=google.com; s=arc-20160816; b=HLWrbeT4IoDar2Z7LmBRtYgp0PkEZJPETGM6+FjD0vw5YwlQTrIcWDOSbcYLPPUYIm oWG9SUcjphsh6bmQTHT/TL1qN9nWSUhhTKxL8i3BE+G77PYFs+YsyxR4NQbwQIFfF6hE xuxZzVprmE3EjzMnph/rmrGYVvuMg7IVRANqrho0WwBxjB1jQrDI2+a6NpQfk0G9TCtr Kgh6kr9LxxM0/qX/jt+QxKrq2mjfdqpk2gYDOjyjXZMdnADwxrjZYl6PnVpx/hKLnHgw l3lizgMXYdXKhd5ah1gXBuUwNVujQtmkXM4NIxNR1hwxeb+v7rp4roFw56hX/IkeOMJ/ flrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date; bh=JIefLpl5zKugjkAK4gWGnE+2UIOpf/LZkNigVqlrsjE=; b=FDtXp4/K1vuSFwU0oHSURjY+y93Y8ZdjkAUmk1eRtW7Un+C77eUbBrtF0KTVN7aVEd QI2FzI+nEvH6fiFgTqmWRa/XB0K03asoWxvZm6Q/b518G+aOtAGbsTFFBU9syVuU8spW QP9gUmj/ydB4siT3V6kglGS+5Ie0kxAcIW3X2wXCIGjEKM35GTc4OISAEG5COfnLqz/r RXy0/jZa0FUlWd6+AHQknj/52XKR3oZc1GL5vdiC+TxZWL5Mhr9gxLIExlJRrcski9vM VwWwgHTdTvwi8XGqWm6JPejbCFjtuo5TdAl/4856DRJipGbLuwz7wvwdu4TcOE4iEN2p UxFw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cs19si5861205plb.431.2019.03.07.17.50.03; Thu, 07 Mar 2019 17:50:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726293AbfCHBse (ORCPT + 99 others); Thu, 7 Mar 2019 20:48:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57478 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726243AbfCHBsd (ORCPT ); Thu, 7 Mar 2019 20:48:33 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A0F93003D2A; Fri, 8 Mar 2019 01:48:33 +0000 (UTC) Received: from straylight.hirudinean.org (ovpn-123-76.rdu2.redhat.com [10.10.123.76]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4442819C65; Fri, 8 Mar 2019 01:48:32 +0000 (UTC) Date: Thu, 7 Mar 2019 17:48:29 -0800 From: Chris Leech To: Lee Duncan Cc: Lee Duncan , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, hare@suse.de Subject: Re: [PATCH v2] scsi:libiscsi: Hold back_lock when calling iscsi_complete_task Message-ID: <20190308014829.GD68002@straylight.hirudinean.org> Mail-Followup-To: Chris Leech , Lee Duncan , Lee Duncan , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, hare@suse.de References: <20190225174130.29496-1-leeman.duncan@gmail.com> <20190306182349.GB68002@straylight.hirudinean.org> <88c1457c-7831-3341-1c63-11eb82244c4b@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <88c1457c-7831-3341-1c63-11eb82244c4b@suse.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Fri, 08 Mar 2019 01:48:33 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 07, 2019 at 05:37:50PM -0800, Lee Duncan wrote: > On 3/6/19 10:23 AM, Chris Leech wrote: > > On Mon, Feb 25, 2019 at 09:41:30AM -0800, Lee Duncan wrote: > >> From: Lee Duncan > >> > >> 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. > >> > >> Signed-off-by: Lee Duncan > >> --- > > > > Lee, > > > > Quick question, can you confirm that you tested this with lockdep? > > > > It seems right to me, it's just that we've been hit with lockdep > > problems dealing with these locks before. > > > > - Chris > > I'm glad you asked, to keep me honest -- I had not done it yet, because > it seemed obvious to me. > > But I did check today, and did not find any deadlock nor leaks. I was > testing on a 5.0.0-1 kernel. Thanks! Acked-by: Chris Leech