Skip to content

Conversation

@amotin
Copy link
Member

@amotin amotin commented Nov 26, 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.

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
Copy link
Contributor

@behlendorf behlendorf left a comment

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
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