From mboxrd@z Thu Jan 1 00:00:00 1970 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.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 28FCEC433E0 for ; Thu, 18 Jun 2020 02:11:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0840520739 for ; Thu, 18 Jun 2020 02:11:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592446288; bh=7UP8d+aNwH4B+abjTH5Mp+3kA+gA4M7eqyVYX0XBBlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=YTZycj5mmHYpCsGOif1d74NcNzmM20XR455pSCI4CTlWKKtd8PVD0ZzyoO8zPqxOA wlcS50b+Dfw0sVA/sOnZYjMYjf4ntS1xnhPEOrmRsF1rIQiVqNu3JvcJfPuu+ZSiZD 4q9lWY2TQV9pRjH0XWpAvNATekQ2Nh2QCu3BePXU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731047AbgFRCLQ (ORCPT ); Wed, 17 Jun 2020 22:11:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:54230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730568AbgFRBVk (ORCPT ); Wed, 17 Jun 2020 21:21:40 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0439E20FC3; Thu, 18 Jun 2020 01:21:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592443299; bh=7UP8d+aNwH4B+abjTH5Mp+3kA+gA4M7eqyVYX0XBBlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b22rF2QTyjH28FWhFkLEQKd9CYVCvcuJaY9uIS6si8vbtiLroQXFIgye1Rt2ruKx8 M07lp823AiS65Cwg2UW00J+Jy04Is1TerMu9lr9Nxn2C/P/SxERAcj97e3+PZOn/9+ dbNJqrAwvO8IkNbdiq4X/VvM2Q3TZN1OMDJU/wNg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Logan Gunthorpe , Allen Hubbe , Alexander Fomichev , Jon Mason , Sasha Levin , linux-ntb@googlegroups.com Subject: [PATCH AUTOSEL 5.4 239/266] NTB: ntb_tool: reading the link file should not end in a NULL byte Date: Wed, 17 Jun 2020 21:16:04 -0400 Message-Id: <20200618011631.604574-239-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200618011631.604574-1-sashal@kernel.org> References: <20200618011631.604574-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Logan Gunthorpe [ Upstream commit 912e12813dd03c602e4922fc34709ec4d4380cf0 ] When running ntb_test this warning is issued: ./ntb_test.sh: line 200: warning: command substitution: ignored null byte in input This is caused by the kernel returning one more byte than is necessary when reading the link file. Reduce the number of bytes read back to 2 as it was before the commit that regressed this. Fixes: 7f46c8b3a552 ("NTB: ntb_tool: Add full multi-port NTB API support") Signed-off-by: Logan Gunthorpe Acked-by: Allen Hubbe Tested-by: Alexander Fomichev Signed-off-by: Jon Mason Signed-off-by: Sasha Levin --- drivers/ntb/test/ntb_tool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/ntb/test/ntb_tool.c b/drivers/ntb/test/ntb_tool.c index 025747c1568e..311d6ab8d016 100644 --- a/drivers/ntb/test/ntb_tool.c +++ b/drivers/ntb/test/ntb_tool.c @@ -504,7 +504,7 @@ static ssize_t tool_peer_link_read(struct file *filep, char __user *ubuf, buf[1] = '\n'; buf[2] = '\0'; - return simple_read_from_buffer(ubuf, size, offp, buf, 3); + return simple_read_from_buffer(ubuf, size, offp, buf, 2); } static TOOL_FOPS_RDWR(tool_peer_link_fops, @@ -1690,4 +1690,3 @@ static void __exit tool_exit(void) debugfs_remove_recursive(tool_dbgfs_topdir); } module_exit(tool_exit); - -- 2.25.1