mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
'zfs share -a' should handle 'canmount=noauto'
The 'zfs share -a' currently skips any filesystems which have 'canmount=noauto' set. This behavior is unexpected since the one would expect 'zfs share -a' to share any mounted filesystem that has the 'sharenfs' property already set. This changes the behavior of 'zfs share -a' to allow the sharing of 'canmount=noauto' datasets if they are mounted. Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Don Brady <don.brady@delphix.com> Reviewed-by: Prakash Surya <prakash.surya@delphix.com> Signed-off-by: George Wilson <gwilson@delphix.com> External-issue: DLPX-71313 Closes #10688
This commit is contained in:
+9
-1
@@ -6627,7 +6627,15 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
|
||||
zfs_get_name(zhp));
|
||||
return (1);
|
||||
} else if (canmount == ZFS_CANMOUNT_NOAUTO && !explicit) {
|
||||
return (0);
|
||||
/*
|
||||
* When performing a 'zfs mount -a', we skip any mounts for
|
||||
* datasets that have 'noauto' set. Sharing a dataset with
|
||||
* 'noauto' set is only allowed if it's mounted.
|
||||
*/
|
||||
if (op == OP_MOUNT)
|
||||
return (0);
|
||||
if (op == OP_SHARE && !zfs_is_mounted(zhp, NULL))
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user