From nobody Thu Jun 13 18:17:27 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W0Vxh0D2Lz5P6Dy; Thu, 13 Jun 2024 18:17:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W0Vxg6Rb8z4hRq; Thu, 13 Jun 2024 18:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718302647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fSHMcC3F2/Vy5rOeLQ7oFvHUXiN9XWcrBj8++Db7vbg=; b=D6/VKgmFNjNLjbD9LYCyzbsWGXsOt0/NxbNf7WxYGNHiIDzqeFlIymZxavaKiomcS+3eHs n/Fcbefisq3QahptZT1YL66rv9UYAgYR//92CeHvUFZCpcZ8BBO4Xk6hW5JA4x00gzfzsw wuA3O4LbOoN1GBzf25Cm+fVCLRs/FM9gMWn6JSsfM0Lz2QV2qil9wSTKvWN6A2BpC3UWRt 4uR5422M4nK3SBTFRR197N4KoQyoJ4lBCDuxU8M6y6p/iiEHP7uf+87+/JrMIBcoIVfdvw II3GIuovTTgIIorGkXf2/g4XzM8aFjXL1wCqnzqriB9Zzb+b+Badb1sLJjpaUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718302647; a=rsa-sha256; cv=none; b=aBavET773E2WADbxmZrj4UXnIr9+Y9cWorVVso91eCG7aZjJYNVoqC+bScYfmPbIBnczGC jExUOKrxNCGRTodsTic89PCNAjhRiK0UC+dd/qdV0faNu3uDNKNUCrEahvL6WgafjlF4GY V5JLnjf1vKleinD4nBU98JDsUXkMQCuhN4aAQRwsNm9kh1krL04E1FXeM3XP2w5MdNVXUP yJoTBvfnjsjpx/TPRloThTAyxFG+JQG8ybijXslRNvh9eDG6eVhG5pM7S0XqoFyMW9Z++l 2tZdqQiyT3Jj/4nPdaxhAH+qaP2iCvMEwh8jeTbMNm8EJmEVjgtCikiN6t93uw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718302647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fSHMcC3F2/Vy5rOeLQ7oFvHUXiN9XWcrBj8++Db7vbg=; b=ldCvesXszPo1ru1K0NO2yD5Go/YCUyPLzXMprNU1CdLS1S7wIlcY0ddskAlUCXmy3ZerfS cb96o2Du4mPEyfDkEapTXonR/zocIXmBtfiXF2gG5+cdaq1JCF/+j6HQct1zP5lsNOeN+I 31HbbB6Y2uPGdMdGHjbd5MKzHV9zyFHla6xp7R4MGUL6qNN14PRs0RQfvbwpSEy95LKX4b IoTtcQVYY0ByotzwwfN477D9rHuyIeFbunUdBV2dMNK1b9r+fi7SlbeRiHJEcahq4FdVTg 3HYaRFJ3XP7z3uUgDU62gammUUeGIZxELBO324c/E4baY+XBvLSdotql27a20Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W0Vxg62cgznTp; Thu, 13 Jun 2024 18:17:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45DIHRKD038099; Thu, 13 Jun 2024 18:17:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45DIHRLs038096; Thu, 13 Jun 2024 18:17:27 GMT (envelope-from git) Date: Thu, 13 Jun 2024 18:17:27 GMT Message-Id: <202406131817.45DIHRLs038096@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alan Somers Subject: git: 57a32d76f6bd - stable/14 - tests/fusefs: fix all tests that depend on kern.maxphys List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 57a32d76f6bdd67afb527b375b357d1310de69dc Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=57a32d76f6bdd67afb527b375b357d1310de69dc commit 57a32d76f6bdd67afb527b375b357d1310de69dc Author: Gleb Smirnoff AuthorDate: 2024-05-06 19:03:20 +0000 Commit: Alan Somers CommitDate: 2024-06-13 18:15:51 +0000 tests/fusefs: fix all tests that depend on kern.maxphys The tests try to read kern.maxphys sysctl into int value, while unsigned long is required. Not sure when this was broken, seems like since cd8537910406e. Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D45053 (cherry picked from commit e9b411d273336647e61704213964b995952a44fd) --- tests/sys/fs/fusefs/bmap.cc | 12 ++++++------ tests/sys/fs/fusefs/read.cc | 2 +- tests/sys/fs/fusefs/utils.cc | 13 ++++++------- tests/sys/fs/fusefs/utils.hh | 2 +- tests/sys/fs/fusefs/write.cc | 5 +++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/sys/fs/fusefs/bmap.cc b/tests/sys/fs/fusefs/bmap.cc index 4c9edac9360a..48c9c7d038ed 100644 --- a/tests/sys/fs/fusefs/bmap.cc +++ b/tests/sys/fs/fusefs/bmap.cc @@ -105,8 +105,8 @@ TEST_F(Bmap, bmap) arg.runb = -1; ASSERT_EQ(0, ioctl(fd, FIOBMAP2, &arg)) << strerror(errno); EXPECT_EQ(arg.bn, pbn); - EXPECT_EQ(arg.runp, m_maxphys / m_maxbcachebuf - 1); - EXPECT_EQ(arg.runb, m_maxphys / m_maxbcachebuf - 1); + EXPECT_EQ((unsigned long)arg.runp, m_maxphys / m_maxbcachebuf - 1); + EXPECT_EQ((unsigned long)arg.runb, m_maxphys / m_maxbcachebuf - 1); leak(fd); } @@ -142,7 +142,7 @@ TEST_F(Bmap, default_) arg.runb = -1; ASSERT_EQ(0, ioctl(fd, FIOBMAP2, &arg)) << strerror(errno); EXPECT_EQ(arg.bn, 0); - EXPECT_EQ(arg.runp, m_maxphys / m_maxbcachebuf - 1); + EXPECT_EQ((unsigned long )arg.runp, m_maxphys / m_maxbcachebuf - 1); EXPECT_EQ(arg.runb, 0); /* In the middle */ @@ -152,8 +152,8 @@ TEST_F(Bmap, default_) arg.runb = -1; ASSERT_EQ(0, ioctl(fd, FIOBMAP2, &arg)) << strerror(errno); EXPECT_EQ(arg.bn, lbn * m_maxbcachebuf / DEV_BSIZE); - EXPECT_EQ(arg.runp, m_maxphys / m_maxbcachebuf - 1); - EXPECT_EQ(arg.runb, m_maxphys / m_maxbcachebuf - 1); + EXPECT_EQ((unsigned long )arg.runp, m_maxphys / m_maxbcachebuf - 1); + EXPECT_EQ((unsigned long )arg.runb, m_maxphys / m_maxbcachebuf - 1); /* Last block */ lbn = filesize / m_maxbcachebuf - 1; @@ -163,7 +163,7 @@ TEST_F(Bmap, default_) ASSERT_EQ(0, ioctl(fd, FIOBMAP2, &arg)) << strerror(errno); EXPECT_EQ(arg.bn, lbn * m_maxbcachebuf / DEV_BSIZE); EXPECT_EQ(arg.runp, 0); - EXPECT_EQ(arg.runb, m_maxphys / m_maxbcachebuf - 1); + EXPECT_EQ((unsigned long )arg.runb, m_maxphys / m_maxbcachebuf - 1); leak(fd); } diff --git a/tests/sys/fs/fusefs/read.cc b/tests/sys/fs/fusefs/read.cc index 373f742d4fd3..9693428914e6 100644 --- a/tests/sys/fs/fusefs/read.cc +++ b/tests/sys/fs/fusefs/read.cc @@ -1339,7 +1339,7 @@ TEST_P(ReadAhead, readahead) { expect_open(ino, 0, 1); maxcontig = m_noclusterr ? m_maxbcachebuf : m_maxbcachebuf + m_maxreadahead; - clustersize = MIN(maxcontig, m_maxphys); + clustersize = MIN((unsigned long )maxcontig, m_maxphys); for (offs = 0; offs < bufsize; offs += clustersize) { len = std::min((size_t)clustersize, (size_t)(filesize - offs)); expect_read(ino, offs, len, len, contents + offs); diff --git a/tests/sys/fs/fusefs/utils.cc b/tests/sys/fs/fusefs/utils.cc index 55a552e28eeb..831ded0c0815 100644 --- a/tests/sys/fs/fusefs/utils.cc +++ b/tests/sys/fs/fusefs/utils.cc @@ -130,8 +130,7 @@ class FuseEnv: public Environment { void FuseTest::SetUp() { const char *maxbcachebuf_node = "vfs.maxbcachebuf"; const char *maxphys_node = "kern.maxphys"; - int val = 0; - size_t size = sizeof(val); + size_t size; /* * XXX check_environment should be called from FuseEnv::SetUp, but @@ -141,12 +140,12 @@ void FuseTest::SetUp() { if (IsSkipped()) return; - ASSERT_EQ(0, sysctlbyname(maxbcachebuf_node, &val, &size, NULL, 0)) - << strerror(errno); - m_maxbcachebuf = val; - ASSERT_EQ(0, sysctlbyname(maxphys_node, &val, &size, NULL, 0)) + size = sizeof(m_maxbcachebuf); + ASSERT_EQ(0, sysctlbyname(maxbcachebuf_node, &m_maxbcachebuf, &size, + NULL, 0)) << strerror(errno); + size = sizeof(m_maxphys); + ASSERT_EQ(0, sysctlbyname(maxphys_node, &m_maxphys, &size, NULL, 0)) << strerror(errno); - m_maxphys = val; /* * Set the default max_write to a distinct value from MAXPHYS to catch * bugs that confuse the two. diff --git a/tests/sys/fs/fusefs/utils.hh b/tests/sys/fs/fusefs/utils.hh index 383f01ea4bfe..506e8a985212 100644 --- a/tests/sys/fs/fusefs/utils.hh +++ b/tests/sys/fs/fusefs/utils.hh @@ -77,7 +77,7 @@ class FuseTest : public ::testing::Test { public: int m_maxbcachebuf; - int m_maxphys; + unsigned long m_maxphys; FuseTest(): m_maxreadahead(0), diff --git a/tests/sys/fs/fusefs/write.cc b/tests/sys/fs/fusefs/write.cc index f931f350a7c3..336ec79c8fec 100644 --- a/tests/sys/fs/fusefs/write.cc +++ b/tests/sys/fs/fusefs/write.cc @@ -184,7 +184,7 @@ virtual void SetUp() { if (m_maxphys < 2 * DFLTPHYS) GTEST_SKIP() << "MAXPHYS must be at least twice DFLTPHYS" << " for this test"; - if (m_maxphys < 2 * m_maxbcachebuf) + if (m_maxphys < 2 * (unsigned long )m_maxbcachebuf) GTEST_SKIP() << "MAXPHYS must be at least twice maxbcachebuf" << " for this test"; } @@ -860,7 +860,8 @@ TEST_F(WriteMaxWrite, write) ssize_t halfbufsize, bufsize; halfbufsize = m_mock->m_maxwrite; - if (halfbufsize >= m_maxbcachebuf || halfbufsize >= m_maxphys) + if (halfbufsize >= m_maxbcachebuf || + (unsigned long )halfbufsize >= m_maxphys) GTEST_SKIP() << "Must lower m_maxwrite for this test"; bufsize = halfbufsize * 2; contents = new int[bufsize / sizeof(int)];