From 2ffd89fcb90969bd9e3a118cfe373dd356d1519a Mon Sep 17 00:00:00 2001 From: Paul Zuchowski <31706010+PaulZ-98@users.noreply.github.com> Date: Thu, 7 Jun 2018 21:07:29 -0400 Subject: Wrong error message when removing log device In the case where the pool is loaded without the crypto keys necessary to playback the intent log, and log device removal is attempted, a generic busy message is received. Change the message to inform the user that the datasets must be mounted. Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Reviewed-by: Tom Caputi Signed-off-by: Paul Zuchowski Closes #7518 --- lib/libzfs/libzfs_pool.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/libzfs/libzfs_pool.c b/lib/libzfs/libzfs_pool.c index 16b30d177..ef98b25bc 100644 --- a/lib/libzfs/libzfs_pool.c +++ b/lib/libzfs/libzfs_pool.c @@ -24,7 +24,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2018 by Delphix. All rights reserved. * Copyright 2016 Igor Kozhukhov - * Copyright (c) 2017 Datto Inc. + * Copyright (c) 2018 Datto Inc. * Copyright (c) 2017 Open-E, Inc. All Rights Reserved. */ @@ -3293,11 +3293,26 @@ zpool_vdev_remove(zpool_handle_t *zhp, const char *path) break; case EBUSY: - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "Pool busy; removal may already be in progress")); + if (islog) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "Mount encrypted datasets to replay logs.")); + } else { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "Pool busy; removal may already be in progress")); + } (void) zfs_error(hdl, EZFS_BUSY, msg); break; + case EACCES: + if (islog) { + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "Mount encrypted datasets to replay logs.")); + (void) zfs_error(hdl, EZFS_BUSY, msg); + } else { + (void) zpool_standard_error(hdl, errno, msg); + } + break; + default: (void) zpool_standard_error(hdl, errno, msg); } -- cgit v1.2.3