panics in zfs_ioc_objset_stats_impl during zvol creation and destruction
There is a short race condition during which zvol_get_stats() can return EEXIST in zfs_ioc_objset_stats_impl(): after a zvol's znode gets created but before its zap gets created. Due to zfs_ioc_objset_stats_impl() not having a hold on the objset, it must simply ignore such errors.
Similarly, zvol_get_stats() can return ENOENT during zvol destruction. zfs_ioc_objset_stats_impl() must similarly ignore it.
Both of these errors will result in panics if ignored.
Both of these panics were revealed by running the ZFS test suite on FreeBSD while another process does frequent "zfs status" and "zpool status" commands.
Updated by Alan Somers about 4 years ago
ahrens said these panics were fixed in a different way by https://github.com/openzfs/openzfs/commit/3b2aab18808792cbd248a12f1edf139b89833c13 . This bug should therefore be closed.