Go to file
Ameer Hamza 74bbdda1ef Fix snapshot automount expiry cancellation deadlock
A deadlock occurs when snapshot expiry tasks are cancelled while holding
locks. The snapshot expiry task (snapentry_expire) spawns an umount
process and waits for it to complete. Concurrently, ARC memory pressure
triggers arc_prune which calls zfs_exit_fs(), attempting to cancel the
expiry task while holding locks. The umount process spawned by the
expiry task blocks trying to acquire locks held by arc_prune, which is
blocked waiting for the expiry task to complete. This creates a circular
dependency: expiry task waits for umount, umount waits for arc_prune,
arc_prune waits for expiry task.

Fix by adding non-blocking cancellation support to taskq_cancel_id().
The zfs_exit_fs() path calls zfsctl_snapshot_unmount_delay() to
reschedule the unmount, which needs to cancel any existing expiry task.
It now uses non-blocking cancellation to avoid waiting while holding
locks, breaking the deadlock by returning immediately when the task is
already running.

The per-entry se_taskqid_lock has been removed, with all taskqid
operations now protected by the global zfs_snapshot_lock held as
WRITER. Additionally, an se_in_umount flag prevents recursive waits when
zfsctl_destroy() is called during unmount. The taskqid is now only
cleared by the caller on successful cancellation; running tasks clear
their own taskqid upon completion.

Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #17941
2025-12-10 10:21:29 -08:00
.github During CI, use nproc instead of sysctl -n hw.ncpu 2025-12-10 10:21:29 -08:00
cmd raidz_test: Restore rand_data protection 2025-12-10 10:21:29 -08:00
config Linux: work around use of GPL-only symbol kasan_flag_enabled 2025-12-10 10:21:29 -08:00
contrib Bump SONAME of libzfs and libzpool 2025-11-12 13:07:28 -08:00
etc docs: fix a few small typos (#17804) 2025-10-21 09:50:43 -07:00
include Fix snapshot automount expiry cancellation deadlock 2025-12-10 10:21:29 -08:00
lib Fix snapshot automount expiry cancellation deadlock 2025-12-10 10:21:29 -08:00
man Add knob to disable slow io notifications 2025-11-12 13:07:14 -08:00
module Fix snapshot automount expiry cancellation deadlock 2025-12-10 10:21:29 -08:00
rpm Bump SONAME of libzfs and libzpool 2025-11-12 13:07:28 -08:00
scripts CI: exclude signed-off-by/reviewed-by from 72 char limit 2025-12-10 10:21:29 -08:00
tests Fix ddtprune causing space leak 2025-12-10 10:21:29 -08:00
udev zvol_id: make array length properly known at compile time 2025-12-10 10:21:29 -08:00
.editorconfig Add an .editorconfig; document git whitespace settings 2020-01-27 13:32:52 -08:00
.gitignore Packaging: Auto-generate changelog during configure (#15528) 2023-11-16 08:58:47 -08:00
.gitmodules .gitmodules: link to openzfs github repository 2021-04-12 09:37:23 -07:00
.mailmap mailmap/AUTHORS: update with recent new contributors 2025-11-12 13:04:35 -08:00
AUTHORS mailmap/AUTHORS: update with recent new contributors 2025-11-12 13:04:35 -08:00
autogen.sh autogen.sh: remove workaround for automake <1.14, needed for EL <=7 2025-11-12 13:05:16 -08:00
CODE_OF_CONDUCT.md Documentation corrections 2022-12-22 11:34:28 -08:00
configure.ac Linux build: handle CONFIG_OBJTOOL_WERROR=y 2025-06-16 08:12:09 -07:00
copy-builtin copy-builtin: add hooks with sed/>> 2022-05-10 10:17:43 -07:00
COPYRIGHT Fix typos 2020-06-09 21:24:09 -07:00
LICENSE Update build system and packaging 2018-05-29 16:00:33 -07:00
Makefile.am Install zarcstat and zarcsummary symlinks in Makefile 2025-09-09 17:05:30 -07:00
META Linux 6.18 compat: META (#18039) 2025-12-10 10:21:29 -08:00
NEWS Fix NEWS file 2020-08-26 21:44:41 -07:00
NOTICE Update build system and packaging 2018-05-29 16:00:33 -07:00
README.md Fix capitalization typo in README.md 2025-11-12 13:05:35 -08:00
RELEASES.md Update RELEASES.md LTS release to 2.2 2025-01-17 11:04:36 -05:00
TEST Remove CI builder customization from TEST 2020-03-16 10:46:03 -07:00
zfs.release.in Move zfs.release generation to configure step 2012-07-12 12:22:51 -07:00

img

OpenZFS is an advanced file system and volume manager which was originally developed for Solaris and is now maintained by the OpenZFS community. This repository contains the code for running OpenZFS on Linux and FreeBSD.

codecov coverity

Official Resources

Installation

Full documentation for installing OpenZFS on your favorite operating system can be found at the Getting Started Page.

Contribute & Develop

We have a separate document with contribution guidelines.

We have a Code of Conduct.

Release

OpenZFS is released under a CDDL license. For more details see the NOTICE, LICENSE and COPYRIGHT files; UCRL-CODE-235197

Supported Kernels

  • The META file contains the officially recognized supported Linux kernel versions.
  • Supported FreeBSD versions are any supported branches and releases starting from 13.0-RELEASE.