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

Fix zpool status deadlock when suspended #2890

Closed
wants to merge 2 commits into from

Conversation

behlendorf
Copy link
Contributor

No description provided.

The following deadlock was possible when a pool was suspended.

1) txg_sync() blockeded in zio_wait() to suspended pool
2) 'zpool export' holds spa_namespace block in txg_wait_synced()
3) 'zpool status/clear' all deadlock on spa_namespace lock

To resolve this the POOL_CHECK_SUSPENDED flag is specified when
registering the export and destroy handlers.  This causes the
'zpool export' command to cleanly fail when run against suspended
pool.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#1857
The spa_get_stats() function should never issue IO to the pool
when it's suspended.  When the pool is suspended the IO will never
complete by definition and the caller will block indefinitely.

TODO: A cleaner solution for this issue would be the cache the
features in the spa.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#1857
@behlendorf behlendorf added this to the 0.6.4 milestone Nov 12, 2014
@behlendorf behlendorf changed the title Issue 1857 Fix zpool status deadlock when suspended Nov 12, 2014
kernelOfTruth pushed a commit to kernelOfTruth/zfs that referenced this pull request Dec 26, 2014
openzfs#2890

openzfs#2878

Hi,

I am trying disk replacement from a single disk zpool and it results to suspended IO and does not allow me to destroy the zpool.

Steps to reproduce:

create a zpool with single disk (zpool create zp1 /dev/sda)
remove the disk
zpool status shows disk unavailable
insert a new disk
zpool replace zp1 /dev/sda /dev/sdb
it says "cannot replace /dev/sda with /dev/sdb : pool I/O is currently suspended"
The above steps holds good for zpool destroy as well.

Now the zpool is unusable and only option for me to destroy zpool is to reboot the system and destroy the old pool and create a new pool.

Is there any other option can I try so that I can replace the disk without rebooting the system ?

Thanks,
Kiran.
@behlendorf behlendorf modified the milestones: 0.6.5, 0.6.4 Feb 6, 2015
kernelOfTruth pushed a commit to kernelOfTruth/zfs that referenced this pull request Feb 14, 2015
kernelOfTruth pushed a commit to kernelOfTruth/zfs that referenced this pull request Feb 18, 2015
kernelOfTruth pushed a commit to kernelOfTruth/zfs that referenced this pull request Mar 1, 2015
@behlendorf
Copy link
Contributor Author

Closing obsolete

@behlendorf behlendorf closed this Mar 4, 2015
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.

1 participant