Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2167577ybk; Sun, 17 May 2020 12:17:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRioNpgfrHBO0nKX7ePaNzhjyuD4wgwQ1HXmOr430td6jzL22Rkmu9SwUIhZw+jKSO8L1J X-Received: by 2002:a05:6402:4c6:: with SMTP id n6mr10578591edw.264.1589743067492; Sun, 17 May 2020 12:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589743067; cv=none; d=google.com; s=arc-20160816; b=FTuPjM8+iYX6HnJ4IukLcA8KxcqM31MJHjKbmQeedBwpu18SQOEQGcV2HVSp/i90GK SZlxAD3c6mSjDrhBmk37iEbJ06cIPvWudy0aEg7J9gU3sx7SEOXrhR3VtmaKq9aK0tdr /Vt/2T6EUrSAsYjImChHt2lw3EF/L4TS6ODo6ayXWoy1i6UfMCzpI6S0rWcJsCO3lYQa eLpaYsdXOnvpPeWgGevJlytAwsfA0+rKTowqmiVj38OQ+tkEDZ1PiQ2hc6ua033g3pFh 2rcvuTRMhqOlg+9mNiDck3b7UDCAwKMbT3Q0IJt0ZQ3I+jL39lARmkQidIZHQrE9627Q cSUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=U+w/3zmaHjfLCAsHS652uDQzylLJ6xD4X3mXeELm+dc=; b=A5D6tKg/E4yFUAzFMwAtVKd3wxlT6/ySjdpCsT2wIDqu5sKEW2q8kPDU7v4wd+xfXx 4UXkijcYMZpDbRxrBCbab+0NVT1wDtheIKeqZjj8YcgTY+BI69zaHu2B9vgJZb+17Bmb M9X1Pl6PTA6yIzBo1IVeDwXxHXgXbbWgkUdZ2YPU4QYqDMPyoICy1HfBIr+akkatW2ry SNnYPS5OHwqNHASjrSyree7rEA69fTWQd+u0jFRG3hwLIkm2rugzNMxb3jdPVmYerkyM m8vY+bSAu2gQpOL0lGr/Iioux/I8JCDgezYdmwEQOd4s+vgcUfpYKEPzBCKgR+xepuak j9Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZCkP13A7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p23si5376251edm.278.2020.05.17.12.17.23; Sun, 17 May 2020 12:17:47 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ZCkP13A7; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726399AbgEQTQG (ORCPT + 99 others); Sun, 17 May 2020 15:16:06 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:26156 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726269AbgEQTQG (ORCPT ); Sun, 17 May 2020 15:16:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589742964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=U+w/3zmaHjfLCAsHS652uDQzylLJ6xD4X3mXeELm+dc=; b=ZCkP13A71+DPx6MTb9jLOT4UlzFLHaOoXi67wcfvVtkZ1BvLWEp1fF+sSkQjVYZWkQKlR6 O8s7iGQdSxuAVRl4e59djgh0Gut1I41dmCmo3/wbRu+MLw+OFymW2tp1jSm7jUB4qDZ4oc rx+TFZaPGQvpz/NCJWzTzXGAku6Q7+U= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-N0Pb0_uqMOax4Nb0ao2KYw-1; Sun, 17 May 2020 15:16:02 -0400 X-MC-Unique: N0Pb0_uqMOax4Nb0ao2KYw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3013E1005512; Sun, 17 May 2020 19:16:01 +0000 (UTC) Received: from [10.10.112.55] (ovpn-112-55.rdu2.redhat.com [10.10.112.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 803735D9D7; Sun, 17 May 2020 19:16:00 +0000 (UTC) Subject: Re: [PATCH target] target: Add initiatorname to NON_EXISTENT_LUN error To: Lance Digby Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org References: <93c437ce-f881-9f54-5e39-afa8afd96141@redhat.com> From: Mike Christie Message-ID: Date: Sun, 17 May 2020 14:16:00 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/16/20 6:29 PM, Lance Digby wrote: > Mike, Thanks for the review! > The pr_err Detected NON_EXISTENT_LUN is the error messages issued > for the TCM_NON_EXISTENT_LUN retcode so I believe they are the same. > Simply scanning for the wrong lun on an initiator will generate this > error on the target but not generate an error on the initiator. And I > have seen installs, with a lot of initiators, automate the scanning of > such luns incorrectly deemed missing. > While this looks like a simple problem it can take days to get > access or the tcp traces to sort it out. > > Within the same routine there is another pr_err for > TCM_WRITE_PROTECTED that I did not add the initiatorname to as I > thought this would leave a heavy footprint on the initiator. If you I'm not sure what you mean by heavy footprint on the initiator part means. I would say do whatever is helpful to you to debug the problem. For TCM_WRITE_PROTECTED I'm not sure the initiatorname is helpful. I think the target name and tpg would be useful, because I think you sometimes set it at the tpg level then it gets inherited by the LU. But I think it's a pain to get to the target name from this code path, so I wouldn't worry about adding it now. > believe this should be changed for consistency please let me know and > I will add this and change to nacl->initiatorname. Just to make sure we are on the same page. I was just commenting about the other NON_EXISTENT_LUN instace in transport_lookup_tmr_lun. I just thought we would want/need the same info there. > > > > > > > > > > On Sat, May 16, 2020 at 9:50 AM Mike Christie wrote: >> >> On 5/13/20 11:01 PM, Lance Digby wrote: >>> The NON_EXISTENT_LUN error can be written without an error condition >>> on the initiator responsible. Adding the initiatorname to this message >>> will reduce the effort required to fix this when many initiators are >>> supported by a target. >>> >>> Signed-off-by: Lance Digby >>> --- >>> drivers/target/target_core_device.c | 5 +++-- >>> 1 file changed, 3 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c >>> index 4cee113..604dea0 100644 >>> --- a/drivers/target/target_core_device.c >>> +++ b/drivers/target/target_core_device.c >>> @@ -100,9 +100,10 @@ >>> */ >>> if (unpacked_lun != 0) { >>> pr_err("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN" >>> - " Access for 0x%08llx\n", >>> + " Access for 0x%08llx from %s\n", >>> se_cmd->se_tfo->fabric_name, >>> - unpacked_lun); >>> + unpacked_lun, >>> + se_sess->se_node_acl->initiatorname); >> >> You can do nacl->initiatorname. >> >> Do you also want add the name to the tmr case? It's probably not common, >> but the error message would be consistent. >> >>> return TCM_NON_EXISTENT_LUN; >>> } >>> >> >