From d564dc4d72c37ebf87e3717a51d4da94b8f5eda0 Mon Sep 17 00:00:00 2001 From: Chris Siebenmann Date: Tue, 4 Sep 2018 13:55:22 -0400 Subject: [PATCH] Correctly handle errors from kern_path 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. Signed-off-by: Chris Siebenmann Closes #7764 --- module/zfs/zfs_ctldir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c index 8a35c99471c5..f5cfdb55d797 100644 --- a/module/zfs/zfs_ctldir.c +++ b/module/zfs/zfs_ctldir.c @@ -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;