Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp296031pxu; Wed, 14 Oct 2020 01:16:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb8F962ro81Ej0ZR+0yVvVTqCOcbbKljCvFaCHxUzWvqDsl/m8O9E93mF9OdShAfysP19D X-Received: by 2002:a17:906:cca9:: with SMTP id or9mr3941048ejb.451.1602663370262; Wed, 14 Oct 2020 01:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602663370; cv=none; d=google.com; s=arc-20160816; b=gkdEgxD8Se5WTUWTKrKb6obtUcl4p2ePmbFM6iIPaZ9sHA/HT8rRfbZFJh68zqICbj e864mpc/9lsAaa1x/11bF2RCuffQQmts6l583JSzXq6/nboO4Kp2AdXY+nQ7TEdk9P5z bfYtCq/CPdJeWPdxvVl2R3PFpxrpoEQMLlEssMfnerO/7AZIorHhdNFq1lY65WegQq31 55MscC7v+82igPCQwmPKQWxz1VGkcApyUuG8WsnQGgZnz1DQ6IPQqq0Si25LTW1N7fTl 9EsIKI00ubf7TXtkW5OhHvNVCcjACE5wEzrzAYoN3l55Lpil0sdbTZ6lWxFE8uNSKv2F 6Ofg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=kBgYnEnmIEB0WsZbA8P5f3/GBoVDNkzwvdNe/z8Tbvc=; b=RARQSDgk+f87bQqUe1mD+pXpCM9IGuGuFHxeN2T6hTu2QoiHFI66j7hcxPv7Pu0rt3 MCws+YGFNlcwbLmXRTqmmYkboUHv9DZVeCUFccI7iMcAM2VP/bYzzGzaN9VJcf90oJEe ARfdZPcjCgxGkCiFnsJvlIw3nlREMY986ntcoKpVawMTE9mkSla6uifltea7CREKOFXM pqZAUFdTt/RiruB3fPejIsr/ILKL4skj4aXPO0bFvptqvpC/TL5QloTUPj6T9uWzWHyn QaowJZs02VVqSywJvMieG4JOigsd1PvRKcJ3Tbp7/AhgxOnKtw5VXXX8uJiDLwgSpGZe Qx4A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h19si1625852edv.197.2020.10.14.01.15.48; Wed, 14 Oct 2020 01:16:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729001AbgJNA5H (ORCPT + 99 others); Tue, 13 Oct 2020 20:57:07 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:53370 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbgJNA5H (ORCPT ); Tue, 13 Oct 2020 20:57:07 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by kvm5.telegraphics.com.au (Postfix) with ESMTP id 84BB023D26; Tue, 13 Oct 2020 20:57:04 -0400 (EDT) Date: Wed, 14 Oct 2020 11:57:04 +1100 (AEDT) From: Finn Thain To: Daniel Wagner cc: Nilesh Javali , Arun Easi , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] qla2xxx: Return EBUSY on fcport deletion In-Reply-To: <20201013065232.hdyjdkurkmowkf2f@beryllium.lan> Message-ID: References: <20201012173524.46544-1-dwagner@suse.de> <20201013065232.hdyjdkurkmowkf2f@beryllium.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Oct 2020, Daniel Wagner wrote: > On Tue, Oct 13, 2020 at 10:59:18AM +1100, Finn Thain wrote: > > > > On Mon, 12 Oct 2020, Daniel Wagner wrote: > > > > > When the fcport is about to be deleted we should return EBUSY > > > instead of ENODEV. Only for EBUSY the request will be requeued in a > > > multipath setup. > > > > > > Also in case we have a valid qpair but the firmware has not yet > > > started return EBUSY to avoid dropping the request. > > > > > > Signed-off-by: Daniel Wagner > > > --- > > > > > > v3: simplify test logic as suggested by Arun. > > > > Not exactly a "simplification": there was a change of behaviour > > between v2 and v3. It seems the commit log no longer reflects the > > code. > > How so? I am struggling to see how it could be a change in behavior. But > then I sometimes fail at simple logic ;) > Me too, so I confirmed the result by executing the code snippets. > v2 and v3 will return ENODEV if qpair or fcport are invalid and for > EBUSY one of the other condition needs be true. The difference between > v2 and v3 should only be the order how tests are executed. The outcome > should be the same. > Here's a truth table for v2: qpair fw_started fcport deleted result --------------------------------------- F X F X -ENODEV F F T F -ENODEV F F T T -EBUSY * F T T F -ENODEV F T T T -EBUSY * T F F X -EBUSY * T F T X -EBUSY T T F X -ENODEV T T T F neither T T T T -EBUSY Here's a truth table for v3: qpair fw_started fcport deleted result --------------------------------------- F X F X -ENODEV F F T F -ENODEV F F T T -ENODEV * F T T F -ENODEV F T T T -ENODEV * T F F X -ENODEV * T F T X -EBUSY T T F X -ENODEV T T T F neither T T T T -EBUSY The asterisks mark the changed rows. I don't know whether the changes in v3 are desirable or not, I was just pointing out that the commit log ("valid qpair but the firmware has not yet started return EBUSY") now seems to disagree with the code.