From patchwork Mon Oct 28 23:30:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13854263 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AC72D5B84D for ; Mon, 28 Oct 2024 23:31:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B3706B00AA; Mon, 28 Oct 2024 19:31:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 43A7E6B00AC; Mon, 28 Oct 2024 19:31:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28D696B00B6; Mon, 28 Oct 2024 19:31:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 040236B00AA for ; Mon, 28 Oct 2024 19:31:08 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A71BB120A07 for ; Mon, 28 Oct 2024 23:31:08 +0000 (UTC) X-FDA: 82724607420.20.062E999 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf03.hostedemail.com (Postfix) with ESMTP id EF39020016 for ; Mon, 28 Oct 2024 23:30:55 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sluuL5Qf; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730158138; a=rsa-sha256; cv=none; b=vzAlTwBbTNZttZdP4kO8b/rvAFJTEJWOQQ3SBhKgGCr20wbyHn08xCpgzCURgnKW8ihXlO YfHLIHUwPGDSLd2gvzgQq4YEuzgVPzlnDK2VyXTF3ep8BnAVjkZPhT+gFbPwVaGEA1//DI A2aYEqtkRMoEqh2rnXLGCp3DUy2m5Ic= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=sluuL5Qf; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf03.hostedemail.com: domain of sj@kernel.org designates 147.75.193.91 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730158138; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=VdAwnd/PkwM8I/gjAQ2V9Ac55qqW0oo2Z+A3Y8Mohlk=; b=3sq5AUE5YphC3a49XGa3FICAxUrTPJHRBHmx2ebWL0QLTjmlbOCDMOlZiH/60md9HSaNRR hyv23EoxAEy2ys+3A9loG3D54+nj5zlHUQJeUE+VjJ4GpLA3YMOfvThg5BEEGo/TFR/RoK mLN7j6wOYSWlfQXzZg5dvdkzpllJC74= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 66228A4007D; Mon, 28 Oct 2024 23:29:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1D40C4CEE7; Mon, 28 Oct 2024 23:31:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730158266; bh=xqdqcFrJAdIHqtvRzPwvhIaKJQv8dhV6x+KleToE+hw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sluuL5Qfuq8491dKARsQzWeCtUedCMTYGcyGjvxjlRv5WlaXuUh/5QlkYD9CgXlCZ QTkVugJy4hHJGuxbXmKHkCzJfV1HSeIeqOG+0I46pnvhANoxtU0z+fA91AQFi9bgAB hA2br121iIiFL/DihHj36y0zePO0y/8ewlDotbHHO7pnjTKFOKfsWAVXDkgyhsZV1a qP9y8Mrqymaf2EsCdsYQXPKdz8tf4JrFHyaHYLCl4w7tIwA5/UXkDwSrj7W48cX1Os Z1aPgduqXj62mbPP60QuPCviIf/QpxLDJC4vlqTscmP7uvdlzFuEyEa1ZldsyviNi1 zrY+2zZWJhBzg== From: SeongJae Park To: Andrew Morton Cc: Andrew Paniakin , SeongJae Park , Shuah Khan , damon@lists.linux.dev, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/6] selftests/damon/huge_count_read_write: provide sufficiently large buffer for DEPRECATED file read Date: Mon, 28 Oct 2024 16:30:53 -0700 Message-Id: <20241028233058.283381-2-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241028233058.283381-1-sj@kernel.org> References: <20241028233058.283381-1-sj@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: EF39020016 X-Stat-Signature: 8r94xomwu4jqf4ixt37kxr77hzdoqycp X-Rspam-User: X-HE-Tag: 1730158255-95293 X-HE-Meta: U2FsdGVkX19T4YzfqbwTSDpdWY0GlWIvCqzGC7VcJty2Wd349zuTG+ZI+dgnn9i62aixqJv8vW88z5tLk31E2ZsAdOSG5yWZ/XcuLacVMq/xGqdytA2O6KSPVPKnt2bnM61sEVAZZ3hoc8ad9Dmj2fKg51fOMwnKtZ0qssRIjmJQAJfCNhg8Kak4BzkqHak2p5coIoymFeM6eKpbQQVHZdDvVRhBuAXr4hEDuLPZNLJWN4bjBYtOKljXcTO/9BhT9CAkjQMvk5rU5lmA6jUZxHlkX9jKyWOlZ5sZdf2fp0j1l4bDQitwsxDldw/Fm7O4e7LgaQdnB4v9ENym0VbVQ4YKS4PFlLTWQhjtLAQmvvGYb6HJRnqoEGEBQUPXFGXxhviqGQkWN7WcrgSfQ97Ik5BKPZRii/qgu1ZyKRGbqt70TJexYLoxR/HuRtSV1TwvubjCNo6P3rlfiIoQPWZrnQ9DHpakMNlqZenACp0g30fQaGVRsFXub4o8w6ScOatEGrP803XieW9LoLuaMrGKGq+MmHvkeZ94o0y0GWaqJtNOuVDMBcgdGZzNFsm7WMXqGSM1e8jAUbWdADMkgH4otprPVV3bdEVQcATvnu8YgiK0t6QAbWMdLjWjwnyEnNih7LJjnIR57U8EWHpLPaZIV3zLxliS1pWcuzfKcY0k0O3vQGOu86pndSktuwyWwa0dHq9igduY6FzAgjapGH0eIrgB0b6bU8Wc4U0zYkFwl+YDyUbyfDz64GpMtAgn50qMXqbiSBid3mCrTic+iiPkLBFZeQ2SiSftMOdoHsH78ctAliRRYbKj+1JFPuRulW4ZUzEnwyTWokuWG0NrnaS4r66nbyaYmHm66hy5fn33bQmFWlHNW1xYclZBkzD1RFFoiNp7Wot7oY9HICBH//LzY6pR/D4sfOhknqOHYjBEgrpi5iFKQ0GCAg06zxILB7zwPZQlrjICEicZ8u1hbsL 3+7VaTS6 QEzLi+8ElPbxhbw1piMvUhAR98unhjNlEzy3xIEnriC4u+MpKPWBZZbbDvx9+dOtcganDsm9v7dinK/ArbvohR1w9Lpw6fJcs99T3+TEoGai6vwQn0wtLHExecJJMJ9Nmf4JxifuOvTTYGTRJNj0jA5Ru0uq1zGsDHfVIoWXfrni02XLydxRnwhGra2EZdgqxWmIHGLaCU79KN8QxLct5myC0uvwaqYL5fycUB7lSn6z/nSijk0NVtH3u3JiVz3yoeMl5Q6X+DLE+jlGYyK9kVxg39uQIm46Vt5Q1+1Gs7UV2/ptfhmVynVW8k1qpnz7JpZG/ X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: From: Andrew Paniakin 'huge_count_read_write' crashes with segmentation fault when reading DEPRECATED file of DAMON debugfs interface. This is not causing any problem for users or other tests because the purpose of the test is just ensuring the read is not causing kernel warning messages. Nonetheless, it makes the output unnecessarily noisy, and the DEPRECATED file is not properly being tested. It happens because the size of the content of the file is larger than the size of the buffer for the read. The file contains about 170 characters. Increase the buffer size to 256 characters. Fixes: b4a002889d24 ("selftests/damon: test debugfs file reads/writes with huge count") Signed-off-by: Andrew Paniakin Signed-off-by: SeongJae Park --- Note that this fix has originally wrote[1] by Andrew for the downstream version of the same test. Because the downstream version is hosted on GitHub, the original patch was posted via GitHub pull request, not to the mailing list. [1] https://github.com/damonitor/damon-tests/commit/fec6e1f4559a tools/testing/selftests/damon/huge_count_read_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/damon/huge_count_read_write.c b/tools/testing/selftests/damon/huge_count_read_write.c index a6fe0689f88d..f3c199dc8eba 100644 --- a/tools/testing/selftests/damon/huge_count_read_write.c +++ b/tools/testing/selftests/damon/huge_count_read_write.c @@ -18,7 +18,7 @@ void write_read_with_huge_count(char *file) { int filedesc = open(file, O_RDWR); - char buf[25]; + char buf[256]; int ret; printf("%s %s\n", __func__, file);