On a 7.1 or current- kernel with TMPFS enabled, the following panic occurs.

    # mount -t tmpfs swap /mnt
    # cd /mnt
    # echo test > testfile            # A new file can be created normally.
    # cat testfile
    test
                                      # Output redirection to an already
    # echo test2 > testfile           # existing file causes panic.
    panic: kernel diagnostic assertion "rw_write_held(uobj->vmobjlock)" failed: 
fil
    e "/usr/src/sys/uvm/uvm_aobj.c", line 876
    Stopped at  db_enter+0x10:  popq    %rbp
        TID        PID    UID     PRFLAGS     PFLAGS  CPU  COMMAND
    *184475      41532      0    0x100003          0    0  ksh
    db_enter() at db_enter+0x10
    panic(ffffffff81f10681) at panic+0xb8
    __assert(ffffffff81f83ea0,ffffffff81f05a10,36c,ffffffff81f1e964) at 
__assert+0x
    25
    uao_flush(fffffd803f12fe58,0,1000,8) at uao_flush+0x24e
    uao_shrink_array(fffffd803f12fe58,0) at uao_shrink_array+0x77
    tmpfs_reg_resize(fffffd800eabe4a0,0) at tmpfs_reg_resize+0x167
    tmpfs_chsize(fffffd800eabe4a0,0,fffffd803f7d9720,ffff8000ffff5ce8) at 
tmpfs_chs
    ize+0xd9
    tmpfs_setattr(ffff800014da7d48) at tmpfs_setattr+0xe6
    
VOP_SETATTR(fffffd800eabe4a0,ffff800014da7da0,fffffd803f7d9720,ffff8000ffff5ce8
    ) at VOP_SETATTR+0x4b
    vn_open(ffff800014da7f60,602,1a4) at vn_open+0x25a
    doopenat(ffff8000ffff5ce8,ffffff9c,73d81734350,601,1b6,ffff800014da8130) at 
doo
    penat+0x1cd
    syscall(ffff800014da81a0) at syscall+0x324
    Xsyscall() at Xsyscall+0x128
    endbofokernel
    endbtrace-frame: 0x7f7fffff3940, count: 2
    https://www.openbsd.org/ddb.html describes the minimum info required in bug
    reports.e-Insufficient info makes it difficult to find and fix bugs.
    ddb>

The kernel config files are as follows.

    # diff -u /usr/src/sys/conf/GENERIC /usr/src/sys/conf/GENERIC_TMPFS
    --- /usr/src/sys/conf/GENERIC       Wed Apr  6 00:14:59 2022
    +++ /usr/src/sys/conf/GENERIC_TMPFS Sat Apr 16 14:26:14 2022
    @@ -40,7 +40,7 @@
     option             UDF             # UDF (DVD) file system
     option             MSDOSFS         # MS-DOS file system
     option             FIFO            # FIFOs; RECOMMENDED
    -#option            TMPFS           # efficient memory file system
    +option             TMPFS           # efficient memory file system
     option             FUSE            # FUSE

     option             SOCKET_SPLICE   # Socket Splicing for TCP and UDP
    # diff -u /usr/src/sys/arch/amd64/conf/GENERIC 
/usr/src/sys/arch/amd64/conf/GENERIC_TMPFS
    --- /usr/src/sys/arch/amd64/conf/GENERIC    Wed Mar  9 00:08:01 2022
    +++ /usr/src/sys/arch/amd64/conf/GENERIC_TMPFS      Sat Apr 16 14:25:37 2022
    @@ -10,7 +10,7 @@
     # device.

     machine            amd64
    -include            "../../../conf/GENERIC"
    +include            "../../../conf/GENERIC_TMPFS"
     maxusers   80                      # estimated number of users

     option             USER_PCICONF    # user-space PCI configuration

Reply via email to