aboutsummaryrefslogtreecommitdiffstats
path: root/fs/stat.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-12-17 19:16:12 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-17 19:16:12 -0800
commit231753ef780012eb6f3922c3dfc0a7186baa33c2 (patch)
treec580186402ac9c5d7392ba4516dd3c88588807ba /fs/stat.c
parentMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs (diff)
parentvfs: make generic_readlink() static (diff)
downloadlinux-dev-231753ef780012eb6f3922c3dfc0a7186baa33c2.tar.xz
linux-dev-231753ef780012eb6f3922c3dfc0a7186baa33c2.zip
Merge uncontroversial parts of branch 'readlink' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs
Pull partial readlink cleanups from Miklos Szeredi. This is the uncontroversial part of the readlink cleanup patch-set that simplifies the default readlink handling. Miklos and Al are still discussing the rest of the series. * git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/vfs: vfs: make generic_readlink() static vfs: remove ".readlink = generic_readlink" assignments vfs: default to generic_readlink() vfs: replace calling i_op->readlink with vfs_readlink() proc/self: use generic_readlink ecryptfs: use vfs_get_link() bad_inode: add missing i_op initializers
Diffstat (limited to 'fs/stat.c')
-rw-r--r--fs/stat.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/stat.c b/fs/stat.c
index bc045c7994e1..0b210c3ead5c 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -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);