Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109244511
D19650.id55251.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D19650.id55251.diff
View Options
Index: lib/libbe/be.c
===================================================================
--- lib/libbe/be.c
+++ lib/libbe/be.c
@@ -265,6 +265,16 @@
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 @@
}
}
- /* 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);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 3, 1:19 PM (20 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16434635
Default Alt Text
D19650.id55251.diff (1 KB)
Attached To
Mode
D19650: Don't check if the dataset is mounted when destroying a snapshot (libbe)
Attached
Detach File
Event Timeline
Log In to Comment