Best effort for minor device removal.

We should just make a best effort when removing zvol minors
from the system during destroy.  Failure here should never
prevent the pool from being destroyed.  For example, if a
pool is so heavily damaged it cannot be opened (part of the
minor removal) we still want to be able to destroy it.  The
worst case here is we may orphan a few minors but even that
is unlikely and not particularly harmful.
This commit is contained in:
Brian Behlendorf 2010-07-21 14:20:56 -07:00
parent 20479b4392
commit 0e533b7459
1 changed files with 2 additions and 3 deletions

View File

@ -1112,9 +1112,8 @@ zfs_ioc_pool_destroy(zfs_cmd_t *zc)
{
int error;
zfs_log_history(zc);
error = zvol_remove_minors(zc->zc_name);
if (error == 0)
error = spa_destroy(zc->zc_name);
(void) zvol_remove_minors(zc->zc_name);
error = spa_destroy(zc->zc_name);
return (error);
}