summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zfs/zfs_main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 84073435e..83f02666d 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -5641,6 +5641,7 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
char mountpoint[ZFS_MAXPROPLEN];
char shareopts[ZFS_MAXPROPLEN];
char smbshareopts[ZFS_MAXPROPLEN];
+ char overlay[ZFS_MAXPROPLEN];
const char *cmdname = op == OP_SHARE ? "share" : "mount";
struct mnttab mnt;
uint64_t zoned, canmount;
@@ -5748,6 +5749,19 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
}
/*
+ * Overlay mounts are disabled by default but may be enabled
+ * via the 'overlay' property or the 'zfs mount -O' option.
+ */
+ if (!(flags & MS_OVERLAY)) {
+ if (zfs_prop_get(zhp, ZFS_PROP_OVERLAY, overlay,
+ sizeof (overlay), NULL, NULL, 0, B_FALSE) == 0) {
+ if (strcmp(overlay, "on") == 0) {
+ flags |= MS_OVERLAY;
+ }
+ }
+ }
+
+ /*
* At this point, we have verified that the mountpoint and/or
* shareopts are appropriate for auto management. If the
* filesystem is already mounted or shared, return (failing