mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
vfs: replace calling i_op->readlink with vfs_readlink()
Also check d_is_symlink() in callers instead of inode->i_op->readlink because following patches will allow NULL ->readlink for symlinks. Signed-off-by: Miklos Szeredi <[email protected]>
This commit is contained in:
parent
2a07a1f5ab
commit
fd4a0edf2a
6 changed files with 35 additions and 13 deletions
|
|
@ -329,12 +329,14 @@ retry:
|
|||
struct inode *inode = d_backing_inode(path.dentry);
|
||||
|
||||
error = empty ? -ENOENT : -EINVAL;
|
||||
if (inode->i_op->readlink) {
|
||||
/*
|
||||
* AFS mountpoints allow readlink(2) but are not symlinks
|
||||
*/
|
||||
if (d_is_symlink(path.dentry) || inode->i_op->readlink) {
|
||||
error = security_inode_readlink(path.dentry);
|
||||
if (!error) {
|
||||
touch_atime(&path);
|
||||
error = inode->i_op->readlink(path.dentry,
|
||||
buf, bufsiz);
|
||||
error = vfs_readlink(path.dentry, buf, bufsiz);
|
||||
}
|
||||
}
|
||||
path_put(&path);
|
||||
|
|
|
|||
Loading…
Reference in a new issue