FreeBSD Bugzilla – Attachment 247521 Details for
Bug 276191
fusefs: panic Assertion prev_offset < next_offset
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Test case demonstrating the bug
0001-Add-a-reproduction-script-for-276191.patch (text/plain), 3.75 KB, created by
Alan Somers
on 2024-01-08 01:14:33 UTC
(
hide
)
Description:
Test case demonstrating the bug
Filename:
MIME Type:
Creator:
Alan Somers
Created:
2024-01-08 01:14:33 UTC
Size:
3.75 KB
patch
obsolete
>From 46894c667e66e981b774855c806a3217a33af551 Mon Sep 17 00:00:00 2001 >From: Alan Somers <asomers@FreeBSD.org> >Date: Sun, 7 Jan 2024 18:03:40 -0700 >Subject: [PATCH] Add a reproduction script for 276191. > >PR: 276191 >--- > tests/sys/fs/fusefs/io.cc | 68 +++++++++++++++++++++++++++++++++++++-- > 1 file changed, 65 insertions(+), 3 deletions(-) > >diff --git a/tests/sys/fs/fusefs/io.cc b/tests/sys/fs/fusefs/io.cc >index b17d3857d327..08ae37d367bf 100644 >--- a/tests/sys/fs/fusefs/io.cc >+++ b/tests/sys/fs/fusefs/io.cc >@@ -73,7 +73,7 @@ static void compare(const void *tbuf, const void *controlbuf, off_t baseofs, > } > } > >-typedef tuple<bool, uint32_t, cache_mode> IoParam; >+typedef tuple<bool, uint32_t, cache_mode, uint32_t> IoParam; > > class Io: public FuseTest, public WithParamInterface<IoParam> { > public: >@@ -112,6 +112,7 @@ void SetUp() > default: > FAIL() << "Unknown cache mode"; > } >+ m_kernel_minor_version = get<3>(GetParam()); > m_noatime = true; // To prevent SETATTR for atime on close > > FuseTest::SetUp(); >@@ -195,6 +196,25 @@ void SetUp() > }, Eq(true)), > _) > ).WillRepeatedly(Invoke(ReturnErrno(0))); >+ EXPECT_CALL(*m_mock, process( >+ ResultOf([=](auto in) { >+ return (in.header.opcode == FUSE_FALLOCATE && >+ in.body.fallocate.mode == (FUSE_FALLOC_FL_PUNCH_HOLE | FUSE_FALLOC_FL_KEEP_SIZE)); >+ }, Eq(true)), >+ _) >+ ).WillRepeatedly(Invoke(ReturnImmediate([=](auto in, auto& out) { >+ const struct spacectl_range rqsr = { >+ .r_offset = (off_t)in.body.fallocate.offset, >+ .r_len = (off_t)in.body.fallocate.length >+ }; >+ struct spacectl_range rmsr; >+ int r; >+ >+ r = fspacectl(m_backing_fd, SPACECTL_DEALLOC, &rqsr, 0, &rmsr); >+ ASSERT_EQ(0, r); >+ ASSERT_EQ(0, rmsr.r_len); >+ out.header.len = sizeof(out.header); >+ }))); > > m_test_fd = open(FULLPATH, O_RDWR ); > EXPECT_LE(0, m_test_fd) << strerror(errno); >@@ -223,6 +243,19 @@ void do_closeopen() > ASSERT_LE(0, m_control_fd) << strerror(errno); > } > >+void do_fspacectl(off_t offs, off_t len) >+{ >+ struct spacectl_range rqsr, test_rmsr, control_rmsr; >+ int r; >+ >+ rqsr.r_offset = offs; >+ rqsr.r_len = len; >+ r = fspacectl(m_test_fd, SPACECTL_DEALLOC, &rqsr, 0, &test_rmsr); >+ ASSERT_EQ(0, r) << strerror(errno); >+ r = fspacectl(m_control_fd, SPACECTL_DEALLOC, &rqsr, 0, &control_rmsr); >+ ASSERT_EQ(0, r) << strerror(errno); >+} >+ > void do_ftruncate(off_t offs) > { > ASSERT_EQ(0, ftruncate(m_test_fd, offs)) << strerror(errno); >@@ -345,6 +378,13 @@ virtual void SetUp() { > } > }; > >+class IoFspaceCtl: public Io { >+public: >+virtual void SetUp() { >+ Io::SetUp(); >+} >+}; >+ > /* > * Extend a file with dirty data in the last page of the last block. > * >@@ -507,16 +547,38 @@ TEST_P(Io, resize_a_valid_buffer_while_extending) > close(m_test_fd); > } > >+/* >+ * fspacectl that overlaps with mmap write and normal read. Regression test for >+ * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=276191 >+ */ >+TEST_P(IoFspaceCtl, fspacectl_after_mmap_write) >+{ >+ do_mapwrite(0x1c6e5, 0x61d4); >+ do_fspacectl(0x4f40c, 0x7c97); >+ do_read(0x10afc, 0x4108); >+ close(m_test_fd); >+} >+ > INSTANTIATE_TEST_SUITE_P(Io, Io, > Combine(Bool(), /* async read */ > Values(0x1000, 0x10000, 0x20000), /* m_maxwrite */ >- Values(Uncached, Writethrough, Writeback, WritebackAsync) >+ Values(Uncached, Writethrough, Writeback, WritebackAsync), >+ Values(28) > ) > ); > > INSTANTIATE_TEST_SUITE_P(Io, IoCacheable, > Combine(Bool(), /* async read */ > Values(0x1000, 0x10000, 0x20000), /* m_maxwrite */ >- Values(Writethrough, Writeback, WritebackAsync) >+ Values(Writethrough, Writeback, WritebackAsync), >+ Values(28) >+ ) >+); >+ >+INSTANTIATE_TEST_SUITE_P(Io, IoFspaceCtl, >+ Combine(Values(true), /* async read */ >+ Values(0x10000), /* m_maxwrite */ >+ Values(Uncached, Writethrough, Writeback, WritebackAsync), >+ Values(18, 28) /* kernel_minor_vers */ > ) > ); >-- >2.42.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 276191
: 247521