FreeBSD Bugzilla – Attachment 202370 Details for
Bug 236043
[patch] bectl can't destroy origin snapshot
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
don't check if a dataset is mounted when destroying a snapshot
libbe-destroy.diff (text/plain), 1.12 KB, created by
Robert Wing
on 2019-02-26 00:00:05 UTC
(
hide
)
Description:
don't check if a dataset is mounted when destroying a snapshot
Filename:
MIME Type:
Creator:
Robert Wing
Created:
2019-02-26 00:00:05 UTC
Size:
1.12 KB
patch
obsolete
>diff --git a/lib/libbe/be.c b/lib/libbe/be.c >index 13c1f66d3628..103ce2aa7ce7 100644 >--- a/lib/libbe/be.c >+++ b/lib/libbe/be.c >@@ -265,6 +265,16 @@ be_destroy(libbe_handle_t *lbh, const char *name, int options) > zfs_prop_get(fs, ZFS_PROP_ORIGIN, origin, sizeof(origin), > NULL, NULL, 0, 1) != 0) > return (set_error(lbh, BE_ERR_NOORIGIN)); >+ >+ /* Don't destroy a mounted dataset unless force is specified */ >+ if ((mounted = zfs_is_mounted(fs, NULL)) != 0) { >+ if (force) { >+ zfs_unmount(fs, NULL, 0); >+ } else { >+ free(bdd.snapname); >+ return (set_error(lbh, BE_ERR_DESTROYMNT)); >+ } >+ } > } else { > if (!zfs_dataset_exists(lbh->lzh, path, ZFS_TYPE_SNAPSHOT)) > return (set_error(lbh, BE_ERR_NOENT)); >@@ -280,16 +290,6 @@ be_destroy(libbe_handle_t *lbh, const char *name, int options) > } > } > >- /* Check if mounted, unmount if force is specified */ >- if ((mounted = zfs_is_mounted(fs, NULL)) != 0) { >- if (force) { >- zfs_unmount(fs, NULL, 0); >- } else { >- free(bdd.snapname); >- return (set_error(lbh, BE_ERR_DESTROYMNT)); >- } >- } >- > err = be_destroy_cb(fs, &bdd); > zfs_close(fs); > free(bdd.snapname);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 236043
: 202370
Working