From nobody Thu Jun 13 18:17:28 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 4W0Vxj10wsz5P6Px; Thu, 13 Jun 2024 18:17:29 +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 4W0Vxj0NGSz4hFx; Thu, 13 Jun 2024 18:17:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718302649; 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=kbsfPdj0dA0R/M48LTAd1DoAbcYDmhCRZKj0AnrSlvk=; b=NIHwS1BJWjai04nylKfCtWHAJjSu2Nme//pYtJF7HMj6FxkUWyLYkXbuoZwbsstUyWDChX M7AdNI26EpT1Zs7tDtA7Ph9JFwqS5t7MYjU55r/geiCwF6KUl4+rJBUGD0SGLi509pcvet YAl7afjv9brEDAJjFTNjDhK9CHNsAaG8dsFG6Man9tiKa3HKmGnNsxs95DMvntn3DBTN+5 MxGIFDvM7INdoAKUpSY93787/9UeDPrbrHIXcKUJ8Rj8VkURhjQMNPB4RlA5eFzhVaZ7z5 OqMfeCYg+KJLV0vxAJlfPDSlRu80e0uZQkwVaeIsKQ6Vfj55qNAsNANAdomdAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718302649; a=rsa-sha256; cv=none; b=gTqvPgRV7jPzqIDwBV6h/++CMYYrJS5+OtZ4K2e0B7bXY4KWVNO7FZLzQaCJ3kkb1xtDVv ObeD13Z2o+IbXZUtYCkt4qQHpbomS+TDlJQaYRjeWbdlSBF6PTwUuLZm59ihdMuP+HXB2d +AFO9nyHBmhJa7NApebx985ctnsKy1bxiXy8mmxieqphlhNBzZCciMXzq4MWtosHQicTpI o7Yy5kjHtd2USM8NdGQoAx4ScWkJMzVzH+mHt8XJRhHBN13SxjwakzpqwKh+jXLqZXFbWT 3p9NqBYT8RD6evC75UBniRs25m5kBXHv+4hc8xni8t1tw2fRi+uUiTi+DqOwMA== 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=1718302649; 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=kbsfPdj0dA0R/M48LTAd1DoAbcYDmhCRZKj0AnrSlvk=; b=GcAhNHmehQ+ZQMnbiX509eM/TkHRLNRks+b1OSQRPm0bAn4OXYHcGdBc2KMZ+RDL6Mq4z5 eRVaPhzZ//AQurHPaCi3JtHkmDDcfBOiBaHarZxPALB6QSPVzuOo3mE1jVG2YTAxdDtPn/ xSIEKBEXeKEDHPwIAtOOMWDtvUTUKmgakf/JYd2hui8sP3f4Y/VvOeGSaEjr7p+zjtAHCn clDHTozzOeW4PoIIg8AJJUk8y5wXhYVHLUtIXJOP5y8yilGG3uZGoRHRIRPXntM/M9c5gf WUHV6NPveTjCMjAe/saMCGl4PFxwZYR1WOd3QjfkHqojdqhiKzSNb9d4SG1XQw== 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 4W0Vxh74Y8znZB; Thu, 13 Jun 2024 18:17:28 +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 45DIHSVJ038156; Thu, 13 Jun 2024 18:17:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45DIHSFo038153; Thu, 13 Jun 2024 18:17:28 GMT (envelope-from git) Date: Thu, 13 Jun 2024 18:17:28 GMT Message-Id: <202406131817.45DIHSFo038153@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: 27b195425080 - stable/14 - fusefs: make the tests more robust to changes to 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: 27b1954250802b8f2db4328c962bc6587a4ee3a9 Auto-Submitted: auto-generated The branch stable/14 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=27b1954250802b8f2db4328c962bc6587a4ee3a9 commit 27b1954250802b8f2db4328c962bc6587a4ee3a9 Author: Alan Somers AuthorDate: 2024-05-09 14:40:21 +0000 Commit: Alan Somers CommitDate: 2024-06-13 18:15:58 +0000 fusefs: make the tests more robust to changes to maxphys Remove assumptions in two test cases that maxphys won't be huge. Reported by: kib Sponsored by: Axcient (cherry picked from commit b2792a300ddb8d8334b234fe7744f5141cc96103) --- tests/sys/fs/fusefs/bmap.cc | 17 +++++++++++++---- tests/sys/fs/fusefs/write.cc | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/sys/fs/fusefs/bmap.cc b/tests/sys/fs/fusefs/bmap.cc index 48c9c7d038ed..30612079657d 100644 --- a/tests/sys/fs/fusefs/bmap.cc +++ b/tests/sys/fs/fusefs/bmap.cc @@ -77,8 +77,6 @@ class BmapEof: public Bmap, public WithParamInterface {}; /* * Test FUSE_BMAP - * XXX The FUSE protocol does not include the runp and runb variables, so those - * must be guessed in-kernel. */ TEST_F(Bmap, bmap) { @@ -105,8 +103,19 @@ TEST_F(Bmap, bmap) arg.runb = -1; ASSERT_EQ(0, ioctl(fd, FIOBMAP2, &arg)) << strerror(errno); EXPECT_EQ(arg.bn, pbn); - EXPECT_EQ((unsigned long)arg.runp, m_maxphys / m_maxbcachebuf - 1); - EXPECT_EQ((unsigned long)arg.runb, m_maxphys / m_maxbcachebuf - 1); + /* + * XXX The FUSE protocol does not include the runp and runb variables, + * so those must be guessed in-kernel. There's no "right" answer, so + * just check that they're within reasonable limits. + */ + EXPECT_LE(arg.runb, lbn); + EXPECT_LE((unsigned long)arg.runb, m_maxreadahead / m_maxbcachebuf); + EXPECT_LE((unsigned long)arg.runb, m_maxphys / m_maxbcachebuf); + EXPECT_GT(arg.runb, 0); + EXPECT_LE(arg.runp, filesize / m_maxbcachebuf - lbn); + EXPECT_LE((unsigned long)arg.runp, m_maxreadahead / m_maxbcachebuf); + EXPECT_LE((unsigned long)arg.runp, m_maxphys / m_maxbcachebuf); + EXPECT_GT(arg.runp, 0); leak(fd); } diff --git a/tests/sys/fs/fusefs/write.cc b/tests/sys/fs/fusefs/write.cc index 336ec79c8fec..1fe2e3cc522d 100644 --- a/tests/sys/fs/fusefs/write.cc +++ b/tests/sys/fs/fusefs/write.cc @@ -179,7 +179,7 @@ class WriteCluster: public WriteBack { public: virtual void SetUp() { m_async = true; - m_maxwrite = 1 << 25; // Anything larger than MAXPHYS will suffice + m_maxwrite = UINT32_MAX; // Anything larger than MAXPHYS will suffice WriteBack::SetUp(); if (m_maxphys < 2 * DFLTPHYS) GTEST_SKIP() << "MAXPHYS must be at least twice DFLTPHYS"