]> granicus.if.org Git - zfs/commit
Check for RW_WRITE_HELD in zfs_inactive
authortuxoko <tuxoko@gmail.com>
Tue, 1 Sep 2015 12:02:48 +0000 (20:02 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 1 Sep 2015 17:17:57 +0000 (10:17 -0700)
commitcafbd2aca3fd17be78577348d9661f4142d1eb70
treea9f9784844d3c5d2cfbafb97e541b6b0aa57a26f
parent97771edaca2cac5905571f1355dd2b6256a306b4
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
module/zfs/zfs_vnops.c