mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zpool import should honor overlay property
Make the 'zpool import' command honor the overlay property to allow filesystems to be mounted on a non-empty directory. As it stands now this property is only checked by the 'zfs mount' command. Move the check into 'zfs_mount()` in libzpool so the property is honored for all callers. Signed-off-by: Ned Bass <bass6@llnl.gov> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3227
This commit is contained in:
committed by
Brian Behlendorf
parent
95a6990d9a
commit
9540be9b23
@@ -5641,7 +5641,6 @@ 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,19 +5747,6 @@ share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
Reference in New Issue
Block a user