"-t", MNTTYPE_ZFS,
"-o", opts,
(char *)src,
- (char *)mntpt,
+ (char *)mntpt,
(char *)NULL };
int rc;
rc = libzfs_run_process(argv[0], argv, STDOUT_VERBOSE|STDERR_VERBOSE);
if (rc) {
if (rc & MOUNT_FILEIO)
- return EIO;
+ return (EIO);
if (rc & MOUNT_USER)
- return EINTR;
+ return (EINTR);
if (rc & MOUNT_SOFTWARE)
- return EPIPE;
+ return (EPIPE);
+ if (rc & MOUNT_BUSY)
+ return (EBUSY);
if (rc & MOUNT_SYSERR)
- return EAGAIN;
+ return (EAGAIN);
if (rc & MOUNT_USAGE)
- return EINVAL;
+ return (EINVAL);
- return ENXIO; /* Generic error */
+ return (ENXIO); /* Generic error */
}
- return 0;
+ return (0);
}
static int
/*
* 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,
/*
* 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)
char *mntpt = NULL;
/* check to see if need to unmount the filesystem */
- rewind(zhp->zfs_hdl->libzfs_mnttab);
if (mountpoint != NULL)
mountpoint = mntpt = zfs_strdup(hdl, mountpoint);
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);