Skip to content

Added a more descriptive error message due the destroy failure #17234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions lib/libzfs/libzfs_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -4028,6 +4028,26 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
dgettext(TEXT_DOMAIN, "snapshot is cloned"));
ret = zfs_error(hdl, EZFS_EXISTS, errbuf);
break;
case EBUSY: {
nvlist_t *existing_holds;
int err = lzc_get_holds(nvpair_name(pair),
&existing_holds);

/* check the presence of holders */
if (err == 0 && !nvlist_empty(existing_holds)) {
zfs_error_aux(hdl,
dgettext(TEXT_DOMAIN, "it's being held. "
"Run 'zfs holds -r %s' to see holders."),
nvpair_name(pair));
ret = zfs_error(hdl, EBUSY, errbuf);
} else {
ret = zfs_standard_error(hdl, errno, errbuf);
}

if (err == 0)
nvlist_free(existing_holds);
break;
}
default:
ret = zfs_standard_error(hdl, errno, errbuf);
break;
Expand Down
Loading