Use -zfs_readlink() error
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 17 Feb 2011 17:48:06 +0000 (09:48 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 17 Feb 2011 17:48:06 +0000 (09:48 -0800)
The zfs_readlink() function returns a Solaris positive error value
and that needs to be converted to a Linux negative error value.
While in this case nothing would actually go wrong, it's still
incorrect and should be fixed if for no other reason than clarity.

module/zfs/zpl_inode.c

index 75d299b..888dc17 100644 (file)
@@ -262,7 +262,7 @@ zpl_follow_link(struct dentry *dentry, struct nameidata *nd)
        uio.uio_resid = (MAXPATHLEN - 1);
        uio.uio_segflg = UIO_SYSSPACE;
 
-       error = zfs_readlink(ip, &uio, cr);
+       error = -zfs_readlink(ip, &uio, cr);
        if (error) {
                kmem_free(link, MAXPATHLEN);
                nd_set_link(nd, ERR_PTR(error));