From d24503815b44b31cd3c4adb2340cdce3a1bc79a4 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Fri, 4 Sep 2015 23:23:14 -0400 Subject: [PATCH] Wrapfs: update follow_link Signed-off-by: Erez Zadok --- fs/wrapfs/inode.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fs/wrapfs/inode.c b/fs/wrapfs/inode.c index ae3b9fd7e28e..6a6bcf104ca7 100644 --- a/fs/wrapfs/inode.c +++ b/fs/wrapfs/inode.c @@ -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) -- 2.43.0