]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Correctly handle errors from kern_path
authorChris Siebenmann <cks.github@cs.toronto.edu>
Wed, 5 Sep 2018 05:26:56 +0000 (01:26 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 5 Sep 2018 05:26:56 +0000 (22:26 -0700)
As a regular kernel function, kern_path() returns errors as negative
errnos, such as -ELOOP. zfsctl_snapdir_vget() must convert these into
the positive errnos used throughout the ZFS code when it returns them
to other ZFS functions so that the ZFS code properly sees them as
errors.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chris Siebenmann <cks.git01@cs.toronto.edu>
Closes #7764
Closes #7864

module/zfs/zfs_ctldir.c

index 8a35c99471c57ef0fab7af3ab0167bf3a71622e1..f5cfdb55d7970a729011183e5b359a8b54c587b4 100644 (file)
@@ -1177,7 +1177,7 @@ zfsctl_snapdir_vget(struct super_block *sb, uint64_t objsetid, int gen,
                goto out;
 
        /* Trigger automount */
-       error = kern_path(mnt, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &path);
+       error = -kern_path(mnt, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &path);
        if (error)
                goto out;