Closed sempervictus closed 3 years ago
The backing volume for the vdev does "exist" though - there's a DM volume still in-kernel, so while the physical device backing DM is gone, ZFS has no way to know that. Its a good illustration for why ZFS is both an FS and a vol manager - blockdev jenga can get confusing.
This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.
System information
Describe the problem you're observing
When calling zpool export on a pool which has lost its backing media (in this case a thumb drive with a dm-crypt volume on it, with the volume being the sole backing VDEV for the pool), the command blocks, subsequently blocking all invocations of zpool systemwide and producing this stack trace:
From a naive reading of the stack trace, looks like spa_export_common doesn't deal with this sort of failure. If the ioctls are serialized, then hanging like this would logically block all further invocations.
The crypt volume which acts as the VDEV is still "logically present" in the system, and cannot be dropped while it has consumers (the reference held by the zpool vdev). Unless spa_export_common can be taught to deal with faulty but not failed disks (those accepting IOs but returning nothing), i'm not sure this can be addressed in the export code.
The use case will be legitimate for a while yet. While ZFS crypto can address this to a degree, it stores metadata in the clear, and isn't ready in terms of integration with init systems for decryption at boot, user managers for encrypted homes, crypttab, or grub. DM-crypt aside, i could see this happening with NFS-exported files backing pools (virtualization for instance), or with caching tiers losing their backing in all sorts of applications.
All that in mind, is there an alternate path by which we can permit the ioctl interface to accept commands to other zpools/functions while we have a hung pool? Can we "unhang" pools somehow once this sort of condition has been created?