Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98444
b: refs/heads/master
c: 694a176
h: refs/heads/master
v: v3
  • Loading branch information
Marcin Slusarz authored and Al Viro committed Jun 23, 2008
1 parent 35dc39b commit 7d91f83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 20d4fdc1a788e4ca0aaf2422772ba668e7e10839
refs/heads/master: 694a1764d657e0f7a9b139bc7269c8d5f5a2534b
15 changes: 8 additions & 7 deletions trunk/fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2856,16 +2856,17 @@ int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen)
{
struct nameidata nd;
void *cookie;
int res;

nd.depth = 0;
cookie = dentry->d_inode->i_op->follow_link(dentry, &nd);
if (!IS_ERR(cookie)) {
int res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd));
if (dentry->d_inode->i_op->put_link)
dentry->d_inode->i_op->put_link(dentry, &nd, cookie);
cookie = ERR_PTR(res);
}
return PTR_ERR(cookie);
if (IS_ERR(cookie))
return PTR_ERR(cookie);

res = vfs_readlink(dentry, buffer, buflen, nd_get_link(&nd));
if (dentry->d_inode->i_op->put_link)
dentry->d_inode->i_op->put_link(dentry, &nd, cookie);
return res;
}

int vfs_follow_link(struct nameidata *nd, const char *link)
Expand Down

0 comments on commit 7d91f83

Please sign in to comment.