mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02: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 <mszeredi@redhat.com>
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user