Bug 281073 - fusefs tests failed after [c3d8a93126b9, e4d064e4a8e3]
Summary: fusefs tests failed after [c3d8a93126b9, e4d064e4a8e3]
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-testing (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-26 01:44 UTC by Li-Wen Hsu
Modified: 2024-08-28 15:21 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Li-Wen Hsu freebsd_committer freebsd_triage 2024-08-26 01:44:59 UTC
These tests under sys/fs/fusefs:

  CopyFileRange.mmap_write
  CopyFileRange.same_file:CopyFileRange.extend
  Io/IoCopyFileRange.copy_file_range_from_mapped_write/*
  LLM/LastLocalModify.lookup/1
  LLM/LastLocalModify.vfs_vget/1
  
start hanging since build of git hash [c3d8a93126b9dd05fcfed3685bc3817f3c1eccc9, e4d064e4a8e3818c5b1d059b40bd02bc7cede05c]

https://ci.freebsd.org/job/FreeBSD-main-amd64-test/25402/

Here are some cases have console output:

[ RUN      ] CopyFileRange.mmap_write
vnode_pager_putpages: I/O error 45
0xfffff80003df1dc0: type VREG state VSTATE_CONSTRUCTED op 0xffffffff82841898
    usecount 2, writecount 1, refcount 2 seqc users 0
    hold count flags ()
    flags (VMP_LAZYLIST)
    v_object 0xfffff80002c4d420 ref 0 pages 6 cleanbuf 0 dirtybuf 0
    lock type fuse: EXCL by thread 0xfffff80100903000 (pid 15, syncer, tid 100067)
nodeid: 42, parent nodeid: 0, nlookup: 1, flag: 0x1800


[ RUN      ] Io/IoCopyFileRange.copy_file_range_from_mapped_write/0
INIT        ino= 0
Test Parameters: init_flags=0x1 maxwrite=0x10000 noasync cache=Writethrough kernel_minor_version=27
ACCESS      ino= 1 mask=0x1
LOOKUP      ino= 1 some_file.txt
OPEN        ino=42 flags=0x2
SETATTR     ino=42 valid=0x48
READ        ino=42 offset=0 size=4096
WRITE       ino=42 fh=0xdeadbeef1a7ebabe offset=0 size=4096 write_flags=1
vnode_pager_putpages: I/O error 45
0xfffff80003e18898: type VREG state VSTATE_CONSTRUCTED op 0xffffffff82841898
    usecount 2, writecount 1, refcount 2 seqc users 0
    hold count flags ()
    flags (VMP_LAZYLIST)
    v_object 0xfffff80002c4fb58 ref 0 pages 1 cleanbuf 0 dirtybuf 0
    lock type fuse: EXCL by thread 0xfffff80004703000 (pid 15, syncer, tid 100065)
nodeid: 42, parent nodeid: 0, nlookup: 1, flag: 0x1900
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2024-08-26 01:46:47 UTC
Konstantin, this might be related to rangelock changes. Can you help to check?  Thanks!
Comment 2 Konstantin Belousov freebsd_committer freebsd_triage 2024-08-26 22:19:15 UTC
I am not sure how did this happen.  Could you please
1. check that it is still reproducible on HEAD (there were some important
rangelock fixes)
2. bisect to see exact revision that broke it if (1) is true.

That said, I do not quite see how rangelock changes cause error 45 EOPNOTSUPP
returned somewhere in io path.  I would expect, and did see, failures like
hangs or panics from these changes, but the issues are hopefully fixed.
Comment 3 Li-Wen Hsu freebsd_committer freebsd_triage 2024-08-27 17:18:16 UTC
(In reply to Konstantin Belousov from comment #2)
Yes this is still reproducible on e12b6aaf0d515dede86001c544024e791a968707 and I was testing on 5cbb98c8259c48ba22c8359f4c14f5438329ce58 both includes the later fixes.

Yes, all these test cases hang, and the two cases listed above show I/O error 45 on console after hanging few seconds.

I can reproduce this on my two -CURRENT laptop and in bhyve with https://artifact.ci.freebsd.org/snapshot/main/e12b6aaf0d515dede86001c544024e791a968707/amd64/amd64/disk-test.img.zst

I will do a bisect, but it would take some time. Will report back.
Comment 5 commit-hook freebsd_committer freebsd_triage 2024-08-27 20:38:39 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=fe66e4caf4561ee3349ad7a29cc9976108c3b04f

commit fe66e4caf4561ee3349ad7a29cc9976108c3b04f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-08-27 20:31:25 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-08-27 20:36:31 +0000

    rangelock: Disable cheat mode by default

    Cheat mode is incompatible with code which locks multiple ranges in the
    same vnode, with at least one range being write-locked.  This can arise
    in kern_copy_file_range().  Until that's handled somehow, avoid the
    problem to make the fusefs tests stable.

    PR:             281073
    Fixes:          9ef425e560a9 ("rangelocks: add fast cheating mode")
    Reviewed by:    kib
    Differential Revision:  https://reviews.freebsd.org/D46457

 sys/kern/kern_rangelock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-08-27 20:38:41 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=e6651546c2dd72e028b9422f1695c432dbf47d75

commit e6651546c2dd72e028b9422f1695c432dbf47d75
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-08-27 20:29:18 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-08-27 20:35:08 +0000

    rangelock: Fix an off-by-one error

    A rangelock entry covers the range [start, end), so entries e1 and e2
    with e1->end == e2->start do not overlap.

    PR:             281073
    Fixes:          5badbeeaf061 ("Re-implement rangelocks part 2")
    Reviewed by:    kib
    Differential Revision:  https://reviews.freebsd.org/D46458

 sys/kern/kern_rangelock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-08-28 14:50:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=4e1f29b92dc5fdc84d646eb3c16a4155b6ec688d

commit 4e1f29b92dc5fdc84d646eb3c16a4155b6ec688d
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-08-27 21:34:16 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-08-28 14:34:40 +0000

    kern_copy_file_range(): handle rangelock recursion

    PR:     281073
    Reviewed by:    markj
    Tested by:      lwhsu
    Sponsored by:   The FreeBSD Foundation
    Differential revision:  https://reviews.freebsd.org/D46465

 sys/kern/vfs_syscalls.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)