zfsonlinux/zfs — pull request #1477 by ryao (2013-05-28 03:40:58+00:00)
Title: Do zvol initialization at pool import

There is an extremely odd sporadic bug that causes zvols to fail to
appear on some systems, but not others. I recently was able to
consistently reproduce this issue over a period of 1 month. After
applying this patch, the issue disappeared.

The changes made to spa.c are taken from FreeBSD's ZFS code. The changes
to zvol.c are my own. The zvol.c changes fix a few additional issues
that I spotted. Specifically, the fact that we attempt to initialize
zvols before any pools are imported and the manner in which we handle
failures in zvol_init(). No longer attempting to initialize zvols before
any pools are imported has the side effect that we no longer try to take
the zvol_state_lock before it is initialized.

Signed-off-by: Richard Yao