Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad67536d authored by Logan Gunthorpe's avatar Logan Gunthorpe Committed by Greg Kroah-Hartman
Browse files

NTB: ntb_test: Fix bug when counting remote files



[ 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: 06bd0407 ("NTB: ntb_test: Update ntb_tool Scratchpad tests")
Signed-off-by: default avatarLogan Gunthorpe <logang@deltatee.com>
Acked-by: default avatarAllen Hubbe <allenbh@gmail.com>
Tested-by: default avatarAlexander Fomichev <fomichev.ru@gmail.com>
Signed-off-by: default avatarJon Mason <jdmason@kudzu.us>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent abf91823
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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)