diff options
-rw-r--r-- | lib/libzfs/libzfs_mount.c | 3 | ||||
-rw-r--r-- | lib/libzfs/os/linux/libzfs_mount_os.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/libzfs/libzfs_mount.c b/lib/libzfs/libzfs_mount.c index 552fddea7..b257b6511 100644 --- a/lib/libzfs/libzfs_mount.c +++ b/lib/libzfs/libzfs_mount.c @@ -466,7 +466,8 @@ zfs_mount_at(zfs_handle_t *zhp, const char *options, int flags, if (lstat(mountpoint, &buf) != 0) { if (mkdirp(mountpoint, 0755) != 0) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "failed to create mountpoint")); + "failed to create mountpoint: %s"), + strerror(errno)); return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED, dgettext(TEXT_DOMAIN, "cannot mount '%s'"), mountpoint)); diff --git a/lib/libzfs/os/linux/libzfs_mount_os.c b/lib/libzfs/os/linux/libzfs_mount_os.c index 04252e421..7be85097d 100644 --- a/lib/libzfs/os/linux/libzfs_mount_os.c +++ b/lib/libzfs/os/linux/libzfs_mount_os.c @@ -569,7 +569,9 @@ do_mount(zfs_handle_t *zhp, const char *mntpt, char *opts, int flags) } strlcat(myopts, opts, MNT_LINE_MAX); zfs_adjust_mount_options(zhp, mntpt, myopts, NULL); - error = mount(src, mntpt, MNTTYPE_ZFS, mntflags, myopts); + if (mount(src, mntpt, MNTTYPE_ZFS, mntflags, myopts)) { + return (errno); + } } else { char *argv[9] = { "/bin/mount", |