From patchwork Tue Jun 23 19:55:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 223134 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 208EDC433E2 for ; Tue, 23 Jun 2020 21:29:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E490920781 for ; Tue, 23 Jun 2020 21:29:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592947744; bh=UspmksUqoXOIL+nAPinhkqVy33/sWDzn1uG6kgBkli4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=O8cE6Rx5vwP+PMlVjmL2kikQRi0kIg9CUENDHDvdDwp21d1LtKWkYBZoSHg7dnAyF Os6hPMguEhYr4AVdMk2UBZ3ruZhEGfzT0/7X1HAG6giif9CnLRtRNB6/o4estEavIa rY2ztd4JXtO4Q8p5exgaBzOi2DLvypKg/5jUt6ZI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387769AbgFWV3C (ORCPT ); Tue, 23 Jun 2020 17:29:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:58252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388197AbgFWUPT (ORCPT ); Tue, 23 Jun 2020 16:15:19 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 63D282064B; Tue, 23 Jun 2020 20:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592943318; bh=UspmksUqoXOIL+nAPinhkqVy33/sWDzn1uG6kgBkli4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LWPrqz8EwE08x5IqC0zdTZalGB3R5i9Mqq4FFvIqIWvXNDkN19ZFqyxaUnwXAaXDJ XLaI3ZeAiZ3fpf0VRjLGwV33AUFv8ZzsTGCCMpEetD+b1HRtNK0KiBShJGsGS3VG/9 yO7B3+ttxpFATj9c/J/ZZKSTJIyPjZVFvIH5Zhxw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Logan Gunthorpe , Allen Hubbe , Alexander Fomichev , Jon Mason , Sasha Levin Subject: [PATCH 5.7 346/477] NTB: ntb_test: Fix bug when counting remote files Date: Tue, 23 Jun 2020 21:55:43 +0200 Message-Id: <20200623195423.901056093@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200623195407.572062007@linuxfoundation.org> References: <20200623195407.572062007@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Logan Gunthorpe [ Upstream commit 2130c0ba69d69bb21f5c52787f2587db00d13d8a ] When remote files are counted in get_files_count, without using SSH, the code returns 0 because there is a colon prepended to $LOC. $VPATH should have been used instead of $LOC. Fixes: 06bd0407d06c ("NTB: ntb_test: Update ntb_tool Scratchpad tests") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason Signed-off-by: Sasha Levin --- tools/testing/selftests/ntb/ntb_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/ntb/ntb_test.sh b/tools/testing/selftests/ntb/ntb_test.sh index 9c60337317c60..020137b614079 100755 --- a/tools/testing/selftests/ntb/ntb_test.sh +++ b/tools/testing/selftests/ntb/ntb_test.sh @@ -241,7 +241,7 @@ function get_files_count() split_remote $LOC if [[ "$REMOTE" == "" ]]; then - echo $(ls -1 "$LOC"/${NAME}* 2>/dev/null | wc -l) + echo $(ls -1 "$VPATH"/${NAME}* 2>/dev/null | wc -l) else echo $(ssh "$REMOTE" "ls -1 \"$VPATH\"/${NAME}* | \ wc -l" 2> /dev/null)