Skip to content

Commit

Permalink
Best effort for minor device removal.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
behlendorf committed Jul 21, 2010
1 parent 20479b4 commit 0e533b7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions module/zfs/zfs_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 0e533b7

Please sign in to comment.