Improve 'zpool import' EBUSY error message
When a device is already open O_EXCL by another process the `zpool import` will correctly fail. However, the default failure message isn't very helpful. It may in fact be harmful if you take its advise and destroy your pool. cannot import 'tank': pool is busy Destroy and re-create the pool from a backup source. Improve the error message in the EBUSY case to simply print a message indicating that the devices are current in use. The user will need to manually identify which process has the device open exclusively and why. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
parent
b04c9fc009
commit
abe5b8fb66
|
@ -1585,6 +1585,12 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
|
||||||
(void) zpool_standard_error(hdl, error, desc);
|
(void) zpool_standard_error(hdl, error, desc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EBUSY:
|
||||||
|
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||||
|
"one or more devices are already in use\n"));
|
||||||
|
(void) zfs_error(hdl, EZFS_BADDEV, desc);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
(void) zpool_standard_error(hdl, error, desc);
|
(void) zpool_standard_error(hdl, error, desc);
|
||||||
zpool_explain_recover(hdl,
|
zpool_explain_recover(hdl,
|
||||||
|
|
Loading…
Reference in New Issue