Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drain iput taskq inside z_teardown_lock #3282

Closed
wants to merge 1 commit into from

Conversation

chrisrd
Copy link
Contributor

@chrisrd chrisrd commented Apr 13, 2015

We need to hold the z_teardown_lock as a writer whilst draining the iput
taskq so the taskq isn't being filled up again behind us.

These changes revert commit @fd23720 and address the deadlock raised in
issue #1988 by removing ZFS_ENTER from zfs_putpage and zpl_writepages.

Also remove a redundant zil_commit from zpl_writepages.

Signed-off-by: Chris Dunlop chris@onthe.net.au

Closes #3281

@behlendorf
Copy link
Contributor

@chrisrd has this patch resolved the issue for you in practice? It's not 100% clear to me why pulling the task_waitq() under the teardown lock would solve this. Exactly what other process is adding entries to the iput taskq? It sounds like there is one, but what is it?

@chrisrd
Copy link
Contributor Author

chrisrd commented Apr 13, 2015

Followed up in #3281 (comment)

By the time we're tearing down our superblock the VFS has started releasing
all our inodes/znodes. Some of this work may have been handed off to our
iput taskq so we need to wait for that work to complete. However the iput
from the taskq can itself result in additional work being added to the
taskq:

dsl_pool_iput_taskq
 iput
  iput_final
   evict
    destroy_inode
     zpl_inode_destroy
      zfs_inode_destroy
       zfs_iput_async(ZTOI(zp->z_xattr_parent))
        taskq_dispatch(dsl_pool_iput_taskq..., iput, ...)

Let's wait until all our znodes have been released.

Signed-off-by: Chris Dunlop <chris@onthe.net.au>
Closes openzfs#3281
@chrisrd chrisrd closed this Apr 15, 2015
@chrisrd chrisrd deleted the zol-3281 branch April 15, 2015 01:06
@chrisrd chrisrd restored the zol-3281 branch April 15, 2015 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PANIC on umount due to iput taskq
2 participants