Skip to content

ZIO: ZIO_STAGE_DDT_WRITE is a blocking stage - #17981

Merged
amotin merged 1 commit into
openzfs:masterfrom
amotin:zio_deadlock
Dec 11, 2025
Merged

amotin merged 1 commit into
openzfs:masterfrom
amotin:zio_deadlock

Conversation

@amotin

@amotin amotin commented Nov 26, 2025

Copy link
Copy Markdown
Member

ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP read. Running it from interrupt taskq might lead to deadlock. Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should hopefully fix that, even though I am not sure how I got there.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Quality assurance (non-breaking change which makes the code more robust against bugs)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP
read.  Running it from interrupt taskq might lead to deadlock.
Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should
hopefully fix that, even though I am not sure how I got there.

Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
@amotin amotin added the Status: Code Review Needed Ready for review and testing label Nov 26, 2025

@behlendorf behlendorf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure enough, ZIO_STAGE_DDT_WRITE might require a synchronous read and that could deadlock under the right circumstances. It makes me wonder if there are any other pipeline stages with the same subtle issue. It didn't see anything obvious with a quick spot check. It'd be nice to somehow add some assertions to catch this kind of thing.

@behlendorf behlendorf added Status: Accepted Ready to integrate (reviewed, tested) and removed Status: Code Review Needed Ready for review and testing labels Dec 10, 2025
@amotin
amotin merged commit 20f09ea into openzfs:master Dec 11, 2025
23 of 26 checks passed
@amotin
amotin deleted the zio_deadlock branch December 11, 2025 00:51
kithrup pushed a commit to KlaraSystems/zfs that referenced this pull request Dec 17, 2025
ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP
read.  Running it from interrupt taskq might lead to deadlock.
Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should
hopefully fix that, even though I am not sure how I got there.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes openzfs#17981
amotin added a commit to amotin/zfs that referenced this pull request Jan 29, 2026
ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP
read.  Running it from interrupt taskq might lead to deadlock.
Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should
hopefully fix that, even though I am not sure how I got there.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes openzfs#17981
amotin added a commit to amotin/zfs that referenced this pull request Feb 3, 2026
ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP
read.  Running it from interrupt taskq might lead to deadlock.
Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should
hopefully fix that, even though I am not sure how I got there.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes openzfs#17981
lundman pushed a commit to openzfsonosx/openzfs-fork that referenced this pull request Feb 5, 2026
ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP
read.  Running it from interrupt taskq might lead to deadlock.
Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should
hopefully fix that, even though I am not sure how I got there.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes openzfs#17981
tonyhutter pushed a commit that referenced this pull request Feb 5, 2026
ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP
read.  Running it from interrupt taskq might lead to deadlock.
Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should
hopefully fix that, even though I am not sure how I got there.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes #17981
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Feb 23, 2026
ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP
read.  Running it from interrupt taskq might lead to deadlock.
Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should
hopefully fix that, even though I am not sure how I got there.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes openzfs#17981
lundman pushed a commit to openzfsonwindows/openzfs that referenced this pull request Feb 23, 2026
ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP
read.  Running it from interrupt taskq might lead to deadlock.
Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should
hopefully fix that, even though I am not sure how I got there.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes openzfs#17981
snajpa pushed a commit to vpsfreecz/zfs that referenced this pull request Aug 5, 2026
ddt_lookup() in zio_ddt_write() might require synchronous DDT ZAP
read.  Running it from interrupt taskq might lead to deadlock.
Inclusion of ZIO_STAGE_DDT_WRITE into ZIO_BLOCKING_STAGES should
hopefully fix that, even though I am not sure how I got there.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes openzfs#17981
Upstream: 20f09ea

Ported-by: Pavel Snajdr <snajpa@snajpa.net>

Porting-notes:

- Clean cherry-pick.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Accepted Ready to integrate (reviewed, tested)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants