From patchwork Thu Oct 25 08:49:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 10655605 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DC67617DE for ; Thu, 25 Oct 2018 08:49:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C15C62AFCF for ; Thu, 25 Oct 2018 08:49:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4BA32AFD8; Thu, 25 Oct 2018 08:49:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 556722AFCF for ; Thu, 25 Oct 2018 08:49:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbeJYRVQ (ORCPT ); Thu, 25 Oct 2018 13:21:16 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:51675 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726473AbeJYRVQ (ORCPT ); Thu, 25 Oct 2018 13:21:16 -0400 Received: from apollon.suse.de.de (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by smtp2.provo.novell.com with ESMTP (TLS encrypted); Thu, 25 Oct 2018 02:49:26 -0600 From: Martin Wilck To: Douglas Gilbert , Hannes Reinecke Cc: linux-scsi@vger.kernel.org Subject: [PATCH] rescan-scsi-bus.sh: use LUN wildcard in idlist Date: Thu, 25 Oct 2018 10:49:11 +0200 Message-Id: <20181025084911.19958-1-mwilck@suse.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP By scanning for LUN 0 only, we may encounter a device that the kernel won't add (e.g. peripheral device type 31) and which may thus never appear in sysfs for us to use for REPORT LUNS. That causes LUN additions for such devices to be missed by "rescan-iscsi-bus.sh -a". Signed-off-by: Martin Wilck --- scripts/rescan-scsi-bus.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh index 6989208..a2aa8d8 100755 --- a/scripts/rescan-scsi-bus.sh +++ b/scripts/rescan-scsi-bus.sh @@ -376,7 +376,7 @@ idlist () oldlist=$(ls /sys/class/scsi_device/ | sed -n "s/${host}:${channel}:\([0-9]*:[0-9]*\)/\1/p" | uniq) # Rescan LUN 0 to check if we found new targets - echo "${channel} - 0" > /sys/class/scsi_host/host${host}/scan + echo "${channel} - -" > /sys/class/scsi_host/host${host}/scan newlist=$(ls /sys/class/scsi_device/ | sed -n "s/${host}:${channel}:\([0-9]*:[0-9]*\)/\1/p" | uniq) for newid in $newlist ; do oldid=$newid