Wrapfs: update follow_link
authorErez Zadok <ezk@cs.sunysb.edu>
Sat, 5 Sep 2015 03:23:14 +0000 (23:23 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Dec 2016 19:05:24 +0000 (14:05 -0500)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/wrapfs/inode.c

index ae3b9fd7e28e2d8744b55e96e03797872725913b..6a6bcf104ca7de9e648bd2f92856a3e7544f93ab 100644 (file)
@@ -311,7 +311,7 @@ out:
        return err;
 }
 
-static void *wrapfs_follow_link(struct dentry *dentry, struct nameidata *nd)
+static const char *wrapfs_follow_link(struct dentry *dentry, void **cookie)
 {
        char *buf;
        int len = PAGE_SIZE, err;
@@ -321,7 +321,7 @@ static void *wrapfs_follow_link(struct dentry *dentry, struct nameidata *nd)
        buf = kmalloc(len, GFP_KERNEL);
        if (!buf) {
                buf = ERR_PTR(-ENOMEM);
-               goto out;
+               return buf;
        }
 
        /* read the symlink, and then we will follow it */
@@ -335,9 +335,7 @@ static void *wrapfs_follow_link(struct dentry *dentry, struct nameidata *nd)
        } else {
                buf[err] = '\0';
        }
-out:
-       nd_set_link(nd, buf);
-       return NULL;
+       return *cookie = buf;
 }
 
 static int wrapfs_permission(struct inode *inode, int mask)