]> git.proxmox.com Git - zfsonlinux.git/blob - zfs-patches/0033-Correctly-handle-errors-from-kern_path.patch
update/rebase to zfs-0.7.10 with patches from ZOL
[zfsonlinux.git] / zfs-patches / 0033-Correctly-handle-errors-from-kern_path.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Chris Siebenmann <cks.github@cs.toronto.edu>
3 Date: Wed, 5 Sep 2018 01:26:56 -0400
4 Subject: [PATCH] Correctly handle errors from kern_path
5
6 As a regular kernel function, kern_path() returns errors as negative
7 errnos, such as -ELOOP. zfsctl_snapdir_vget() must convert these into
8 the positive errnos used throughout the ZFS code when it returns them
9 to other ZFS functions so that the ZFS code properly sees them as
10 errors.
11
12 Reviewed-by: George Melikov <mail@gmelikov.ru>
13 Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
14 Signed-off-by: Chris Siebenmann <cks.git01@cs.toronto.edu>
15 Closes #7764
16 Closes #7864
17
18 Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
19 ---
20 module/zfs/zfs_ctldir.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
22
23 diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c
24 index 25edea78..0ab5b4f0 100644
25 --- a/module/zfs/zfs_ctldir.c
26 +++ b/module/zfs/zfs_ctldir.c
27 @@ -1180,7 +1180,7 @@ zfsctl_snapdir_vget(struct super_block *sb, uint64_t objsetid, int gen,
28 goto out;
29
30 /* Trigger automount */
31 - error = kern_path(mnt, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &path);
32 + error = -kern_path(mnt, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, &path);
33 if (error)
34 goto out;
35