]> granicus.if.org Git - zfs/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)
committerTony Hutter <hutter2@llnl.gov>
Fri, 6 Jul 2018 09:46:51 +0000 (02:46 -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 3ff2c101b67b74808096b579a2c206138d5490dd..98897fe6e05419d0c1708e58a71a7285128cef3a 100644 (file)
@@ -1181,7 +1181,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;