X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=lib%2Flibzfs%2Flibzfs_mount.c;h=9a57ad98f050c13eaff6a5610436b398e70f5a1e;hb=5e6320cd1262de6eada39751807c31c059517d01;hp=6758f6a0946e5d60a199ddfd2fe09b401cc141a6;hpb=52e7c3a2e503f78a44fbe5fd9299b11c3aa98651;p=zfs.git diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index 6758f6a..9a57ad9 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -440,9 +440,11 @@ zfs_mount(zfs_handle_t *zhp, const char *options, int flags) /* * Determine if the mountpoint is empty. If so, refuse to perform the - * mount. We don't perform this check if 'remount' is specified. + * mount. We don't perform this check if 'remount' is + * specified or if overlay option(-O) is given */ - if (!remount && !dir_is_empty(mountpoint)) { + if ((flags & MS_OVERLAY) == 0 && !remount && + !dir_is_empty(mountpoint)) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "directory is not empty")); return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED, @@ -710,7 +712,7 @@ zfs_parse_options(char *options, zfs_share_proto_t proto) /* * Share the given filesystem according to the options in the specified * protocol specific properties (sharenfs, sharesmb). We rely - * on "libshare" to the dirty work for us. + * on "libshare" to do the dirty work for us. */ static int zfs_share_proto(zfs_handle_t *zhp, zfs_share_proto_t *proto) @@ -887,11 +889,11 @@ zfs_unshare_proto(zfs_handle_t *zhp, const char *mountpoint, mntpt = zfs_strdup(zhp->zfs_hdl, entry.mnt_mountp); for (curr_proto = proto; *curr_proto != PROTO_END; - curr_proto++) { + curr_proto++) { if (is_shared(hdl, mntpt, *curr_proto) && unshare_one(hdl, zhp->zfs_name, - mntpt, *curr_proto) != 0) { + mntpt, *curr_proto) != 0) { if (mntpt != NULL) free(mntpt); return (-1);