]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: do not canonicalize ZFS source dataset
authorKarel Zak <kzak@redhat.com>
Thu, 14 Jan 2021 11:45:28 +0000 (12:45 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 14 Jan 2021 12:45:20 +0000 (13:45 +0100)
Fixes: https://github.com/karelzak/util-linux/issues/1231
Addresses: https://github.com/systemd/systemd/issues/18188
Addresses: https://github.com/openzfs/zfs/pull/11295
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c

index 71d8939b087c044d50656f9e8de4f0306fb8102a..81503f36e1ea015ee2f9b42d2cf2289c069d4eb6 100644 (file)
@@ -1764,7 +1764,7 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt)
 {
        const char *path = NULL;
        struct libmnt_cache *cache;
-       const char *t, *v, *src;
+       const char *t, *v, *src, *type;
        int rc = 0;
        struct libmnt_ns *ns_old;
 
@@ -1786,6 +1786,11 @@ int mnt_context_prepare_srcpath(struct libmnt_context *cxt)
        if (!src || mnt_fs_is_netfs(cxt->fs))
                return 0;
 
+       /* ZFS source is always "dataset", not a real path */
+       type = mnt_fs_get_fstype(cxt->fs);
+       if (type && strcmp(type, "zfs") == 0)
+               return 0;
+
        DBG(CXT, ul_debugobj(cxt, "srcpath '%s'", src));
 
        ns_old = mnt_context_switch_target_ns(cxt);