From 462ee8e3f3f1e48c857d070fa5abaf4a72246344 Mon Sep 17 00:00:00 2001 From: Will Rouesnel Date: Fri, 28 Dec 2012 01:44:16 +1100 Subject: [PATCH] Allow fake mounts to succeed on non-legacy filesystems. mountall in Debian depends on being able to pass the -f parameter to mount, which specifies a fake mount and just updates the mtab. Currently mount.zfs will fail such a request if it is not passed with -o zfsutil. This patch allows a fake mount on a non-legacy filesystem to succeed in the same manner as a -o remount does, thus enabling mountall to work correctly. Signed-off-by: Brian Behlendorf Closes #1167 --- cmd/mount_zfs/mount_zfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/mount_zfs/mount_zfs.c b/cmd/mount_zfs/mount_zfs.c index 6dd831d..9a82a2b 100644 --- a/cmd/mount_zfs/mount_zfs.c +++ b/cmd/mount_zfs/mount_zfs.c @@ -474,7 +474,8 @@ main(int argc, char **argv) return (MOUNT_USAGE); } - if (!zfsutil && strcmp(legacy, ZFS_MOUNTPOINT_LEGACY) && !remount) { + if (!zfsutil && !(remount || fake) && + strcmp(legacy, ZFS_MOUNTPOINT_LEGACY)) { (void) fprintf(stderr, gettext( "filesystem '%s' cannot be mounted using 'mount'.\n" "Use 'zfs set mountpoint=%s' or 'zfs mount %s'.\n" -- 1.8.3.1