From nobody Thu May 09 17:09:45 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 4VZz5j28WZz5K5ws; Thu, 09 May 2024 17:09:45 +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 4VZz5j1Vlwz4RmN; Thu, 9 May 2024 17:09:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715274585; 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=neYh4vzwq+ZlefrpOkW/Qbcqe1H2ODPeWoyn8vefmzY=; b=vm1JRh60eMySdUE56ABLtTn/CyEBit8jqUsuA3dnOlq88baqTphaVPSJlSJxFDPrlPBYFN ln58ULWONeIlmDmyZ4L4Vxlze2wbu7IvpsP2HhI8DauRm2RYWaUJ16bcmaT8ZXi/jDiYPj GV+rjyQgsEG02wH4o2m6ww43nQks/JL/bYcHTFHWywlpAZ+XojPiZ/F8YEvNCRpqZMCv4b m4It5lPAc9bb2MQIgmRSRuFcHl8s3oKORCbinQ4djC+msmNkaRgyG5uZO9/XJCXCa9bOmY Acc/kXQnIcMmpJcC4EiMGkB9TlQd3ElU+Q853c9uLuPq9dhPZ0li4YbyI4UDbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715274585; a=rsa-sha256; cv=none; b=lf1W/bG7W8P7P1P37vM6p3tWCRbr8AckCH12J0qX5ivv4C3opYCrubp1tgYn8yMw4KLKI4 3r2aHO8kWdphScPbQNKSoYkLzYfuZg9g9fpZTI/JOOX2KusP5KwviykgoxpahypZMzIyRC X3KXr8ItkLJ7zkNNx0T3TZk42RSDY0ghMqwjZ3GTYiPvN1ej/DDhMt3FOER99hmQKrjGE9 njpNdM3C7JXvgWfiyaxSkEYQPk8RaJIuBpQpli/THJdbVK2rGXuEOKsOm/VQHZpph9IGvM 9zo7J70sa/38fAn2OU/eM2tedxjmAkcJxxuekp2wqPWnyPBwlTGHXZsrKNrfZw== 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=1715274585; 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=neYh4vzwq+ZlefrpOkW/Qbcqe1H2ODPeWoyn8vefmzY=; b=iLw0IDeO+Zr6YcGgi8SBAzRxT62qZY6WhPyAx6fRDnhLL4SWlMgjwQixNL6qP3Q/FMq/QB t/dAgSnDkU32FVCxI58CxMBucT+V7raY+6eA7MS0s1337h8r7gyLChH/BI4/lGFtFcsgJ2 Q/UtSy//MlUjOltjeOqpygQzFthRi8cR6IJrjbSlhw+dqCpvErvNaFd06408atNqbrQzyG vwA5X0JyFthrclk4z2eIjxmLX5ZjPbFgVPHZsFooERzVfdZud+IhCJ6dgKHDq+zcktZaEw k+A3E25cGv+5E+SpKhgWAKXjN+rA6hAscyLk8wgHuawMULBkF7ncG9/QJyKP0w== 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 4VZz5j12bmz1Gbt; Thu, 9 May 2024 17:09:45 +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 449H9jjC022173; Thu, 9 May 2024 17:09:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449H9jj3022170; Thu, 9 May 2024 17:09:45 GMT (envelope-from git) Date: Thu, 9 May 2024 17:09:45 GMT Message-Id: <202405091709.449H9jj3022170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: b2792a300ddb - main - 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/main X-Git-Reftype: branch X-Git-Commit: b2792a300ddb8d8334b234fe7744f5141cc96103 Auto-Submitted: auto-generated The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=b2792a300ddb8d8334b234fe7744f5141cc96103 commit b2792a300ddb8d8334b234fe7744f5141cc96103 Author: Alan Somers AuthorDate: 2024-05-09 14:40:21 +0000 Commit: Alan Somers CommitDate: 2024-05-09 17:09:23 +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 MFC after: 2 weeks Sponsored by: Axcient --- 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"