Skip to content

Commit

Permalink
Correctly handle errors from kern_path
Browse files Browse the repository at this point in the history
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 openzfs#7764
Closes openzfs#7864
  • Loading branch information
siebenmann authored and tonyhutter committed Jul 6, 2018
1 parent 30d8b85 commit 88ef5b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 88ef5b2

Please sign in to comment.