From nobody Fri Jun 28 18:59:41 2024 X-Original-To: dev-commits-src-branches@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 4W9l9T2cjqz5P7b3; Fri, 28 Jun 2024 18:59:41 +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 4W9l9T22Czz4vT5; Fri, 28 Jun 2024 18:59:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719601181; 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=ZZjxaS8kAgmgHgshhFQeE/O/0g3GxeoFQq1pdSchZII=; b=iYyu7q8Gr5ebzQvHvNd/gglJkkFhvjBI5lnAFjocxkW5Zj4gTF8R/gwEFvND+6GSVp5NiS WcJxIfS1TioxcDer/MkTVZpqsQM3aNoIbjsld7sBY+AKI0qDa4Eh5SrDjKN7PDq/kZUN4o glhf6xBneSvujD+h9b6BYIduozJ1brtyD/Xjh6fRUToW0aj5gmcz8mzxTP+hMxKFqREHsE DAbgaAD5mRqw5BDfS8rPnovm7PD8Mj3rzrDXLP965YmTArsI8UEZcOm5W/amCkuhv7byOd LoTsnTXillLCaPeTTYfJxSeQxTSCgEZ3F/9bjEmLExR0xKWYyXixmU1ekDHutQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719601181; a=rsa-sha256; cv=none; b=K+9BG5bo2EuQn8ZoLvCiPSc65YAPZii3uiiDHzEXU3WtUnizsHcaBr7hEfk5cxffmP4Rm3 Q3wG2HMYb6vy6K+Yy9uyqdzhpNxkbcOFO+YUnWJn37ixTb57s9kE1FjMz/dGyL0x8LwGYG UN0x4xvOBGCXkb472ARJbNdXRW6CFQLRkYSbADSKy67On8DrPbBS9y60hKjccXqLwENvTe 9Tyjt3SJlPrZwf/Gkhuhn7WfFIO5Bqn3zHTcrryKKoAoT+Cm1K3p2+2apJy1w5Qe0ouE3u 2wGB9fq5wzr+eTwePE/JkKuSMqs1ydXeNu792RxAUfw1VEnrSE4HkwzOD/OZCA== 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=1719601181; 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=ZZjxaS8kAgmgHgshhFQeE/O/0g3GxeoFQq1pdSchZII=; b=N76xOGN4fYLvCCNoRGsA5olagYomwBKDNWT3SPOnfOENb51tA3/3eF/8Qo6oOiIBRx2SMp atL/H6fDSG23RJ5kLyiK98wT7LPEZyyaNuEJRbrZghV7SKV3BM16c80tDr1ZLK+uwo7Upc XPf9G9LJYo2S2yQB+AT5+5p9ep8d35NKOy48dpgTK7PwQo7HTEbpv+/CNMJphSSxNDDZsV G4K2RzUAHngULXRy+kP9uHsUyNJaJzJv+mK1bTf0BN3xoC4qzjH5StzXCfCe/5HBbOiM6n NsoSlDkf8AmroAL8pjTDz3rJhVfuhp5dFCGIB35PnJCBlSFfC1Bgc4MJhlgFNg== 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 4W9l9T1Bg0z16xh; Fri, 28 Jun 2024 18:59:41 +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 45SIxfcq053482; Fri, 28 Jun 2024 18:59:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45SIxfMl053479; Fri, 28 Jun 2024 18:59:41 GMT (envelope-from git) Date: Fri, 28 Jun 2024 18:59:41 GMT Message-Id: <202406281859.45SIxfMl053479@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: af64741bba63 - stable/13 - fusefs: make the tests more robust to changes to maxphys List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: af64741bba6391a765294a41fe43030d4f242e4b Auto-Submitted: auto-generated The branch stable/13 has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=af64741bba6391a765294a41fe43030d4f242e4b commit af64741bba6391a765294a41fe43030d4f242e4b Author: Alan Somers AuthorDate: 2024-05-09 14:40:21 +0000 Commit: Alan Somers CommitDate: 2024-06-28 18:54:00 +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 06342e7cc23b..8e9268058e96 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 9d152aeb0617..0b93369ad66d 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"