Public bug reported:

We observed a kernel panic followed by a ZFS pool hang caused by a race
between dirty mmap page writeback and VFS inode eviction.

The workload is QuestDB, which uses memory-mapped files for its Write-
Ahead Log (WAL). After processing a WAL segment, QuestDB unlinks the
file as part of normal cleanup. In this case, the file was unlinked
while ZFS was still flushing dirty pages belonging to it.

wal-apply_2 was evicting the unlinked inode while the ZFS writeback
thread (flush-zfs-1) was still processing the file. The inode entered
I_FREEING, causing igrab() in zfs_xattr_owner_unlinked() to return NULL
and trigger this assertion:

VERIFY3(igrab(ZTOI((zp))) != NULL)
PANIC at zfs_log.c:257:zfs_xattr_owner_unlinked()

The panic occurred while ZFS had an open DMU transaction, after which
the transaction group could not make progress and the pool hung. The
system required a reboot.

Relevant path:

wb_workfn()
 -> zfs_putpage()
 -> zfs_log_write()
 -> zfs_xattr_owner_unlinked()
 -> igrab()

We do not currently have a reliable reproducer.

Expected behaviour
ZFS should handle the inode becoming I_FREEING during this race without 
triggering a kernel panic or leaving the ZFS pool unable to make progress.

What happened instead
igrab() returned NULL, the ZFS VERIFY assertion triggered spl_panic(), and the 
subsequent failure left the ZFS pool hung until reboot.

#### Environment
Source package: zfs-linux
Ubuntu: 24.04 LTS
Kernel: 6.8.0-138-generic
OpenZFS: 2.2.2-0ubuntu9.4
Architecture: amd64

** Affects: zfs-linux (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: zfs-linux (Ubuntu Noble)
     Importance: Undecided
         Status: New

** Also affects: zfs-linux (Ubuntu Noble)
   Importance: Undecided
       Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2169003

Title:
  Panic in zfs_xattr_owner_unlinked() via zhold() on I_FREEING inode
  during concurrent mmap writeback

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/2169003/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to