From nobody Fri Jun 28 18:53:55 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 4W9l2q6p95z5P6sR; Fri, 28 Jun 2024 18:53:55 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W9l2q6C2wz4vDF; Fri, 28 Jun 2024 18:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719600835; 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=FyLXDbEN0xi1TWMJN6pHkyRe7zFzXxkb+TgR4U2wuV0=; b=PIcyjchBUkfXp9YfdNyBSz3xu85+3SEKxcZVjVNRMV3oYkUn2svgoo7sUAXn9LSoKXaxnC 5om9WZbX2iUaNYFtm0jCHmwIMxznJbXZGQF2mGdcJfkyqROfWIdaM5ZQvbA6lHxPuoLtJP AAGKiIPDwSfg4vj9I4w+k+PWaXfYxIAML68bLzu3EN9RzeWudQKr20K+mLV6lLl243+14H 3YTv6076+AMV8GMXRgCQw3GiyQ0+3MsBUs4ibjLTAbgJ8MF8+rC3B7qsIBY8NI3nAiLGTL z3rBYEQdC5h/+DBNQFDutdAH6Z5+cMd6rLOEXCUgctOyptTi6ePb8O/07WvQvw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719600835; a=rsa-sha256; cv=none; b=OMfot7m+gtBYduWk7ohtoOqZ/W/uE1UyuGT222xBKz15aEvF3+SOUAPeV+uqYntaypKcpx NzqYrqTwzsJS3a07jn7uHWxabMCh6X6dtnUkl3SiUh4fy3E2lQ66Kjf0ZqThpYuuifR85z OptIj/N5pbyLmBh8ucwZhnA+Km7qiw9zTcANwOrGHxY85n5llLxK9gwtawZCo6QHv/WqkX vyrW0MRO5CIWRNY0omYoQZgMGlyQtWrcfNZcv/KKvZ7kEBefX3NYD0uBG/BP36CW5EjSui 8DUGGwXNLEbTyo8c9FLeopfw//x06RyNDMZoRTgAvuVfP5UR3zrZY/CQHF6B4A== 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=1719600835; 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=FyLXDbEN0xi1TWMJN6pHkyRe7zFzXxkb+TgR4U2wuV0=; b=hcZgmOx+bGjzObooS29PTTvhKWrUNwSCim8GZmn1b+DbC/9kEHF8AV3p9+xx0616dymlkd 8FYy4SA+g0nIPLyXRJtarN2a4Z+psLD3val6lNV5Y9Xab63KJSVNDqkh5vtkHcYe4xTGAv pF7ZXZtJUwt6JzeqV9wE+a4XZUmBIpWY5UURKIKpbOEIcu6RSlQ0GkmF1WN66PpFk+J3S0 IBwTOLmcx4FdHOiGRCJLEIxv9sRaSksVnC+GCsYV1CbbcNN2lsVoKsm9WHTgvPpnL0yMF2 XiA8vxVT9l03HDrDtS4uUGTrGVyOz9INFBN+5bDCQU33ADsCVfJReDV91BFthw== 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 4W9l2q5pWXz16mY; Fri, 28 Jun 2024 18:53:55 +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 45SIrt1w052532; Fri, 28 Jun 2024 18:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45SIrt2K052529; Fri, 28 Jun 2024 18:53:55 GMT (envelope-from git) Date: Fri, 28 Jun 2024 18:53:55 GMT Message-Id: <202406281853.45SIrt2K052529@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: 4052c952803f - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 4052c952803f2ba33bb26e13aeeaf9c0651e3702 Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=4052c952803f2ba33bb26e13aeeaf9c0651e3702 commit 4052c952803f2ba33bb26e13aeeaf9c0651e3702 Author: Gleb Smirnoff AuthorDate: 2024-05-06 19:03:20 +0000 Commit: Alan Somers CommitDate: 2024-06-28 18:52:07 +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 fae5aabee471..06342e7cc23b 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 90516a2f7c8a..df2ca2380f00 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 9412d68603de..9d152aeb0617 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)];