zfsonlinux/zfs-patches/0033-Correctly-handle-errors-from-kern_path.patch
Stoiko Ivanov a010b40938 update/rebase to zfs-0.7.10 with patches from ZOL
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2018-09-13 08:54:51 +02:00

36 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Chris Siebenmann <cks.github@cs.toronto.edu>
Date: Wed, 5 Sep 2018 01:26:56 -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.
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
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
---
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 25edea78..0ab5b4f0 100644
--- a/module/zfs/zfs_ctldir.c
+++ b/module/zfs/zfs_ctldir.c
@@ -1180,7 +1180,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;