HomeFreeBSD

Check for RW_WRITE_HELD in zfs_inactive

Description

Check for RW_WRITE_HELD in zfs_inactive

Before read locking z_teardown_inactive_lock, we need to check if we have
already had write lock on it. Otherwise, we would deadlock on ourself when
doing rollback:

zfs_ioc_rollback
->zfs_suspend_fs (z_teardown_inactive_lock, RW_WRITER)
->zfs_resume_fs->zfs_rezget->zfs_iput_async->iput-> ...

->zfs_inactive (z_teardown_inactive_lock, RW_READER)

Signed-off-by: Chunwei Chen <tuxoko@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2869

Details

Provenance
tuxoko <tuxoko@gmail.com>Authored on Sep 1 2015, 12:02 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 1 2015, 5:17 PM
Parents
rG97771edaca2c: Remove blk_queue_io_opt() autotools check
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGcafbd2aca3fd: Check for RW_WRITE_HELD in zfs_inactive (authored by tuxoko <tuxoko@gmail.com>).Sep 1 2015, 5:17 PM