aboutsummaryrefslogtreecommitdiffstats
path: root/fs/stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/stat.c')
-rw-r--r--fs/stat.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/stat.c b/fs/stat.c
index 961039121cb..8806b8997d2 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -27,12 +27,12 @@ void generic_fillattr(struct inode *inode, struct kstat *stat)
27 stat->uid = inode->i_uid; 27 stat->uid = inode->i_uid;
28 stat->gid = inode->i_gid; 28 stat->gid = inode->i_gid;
29 stat->rdev = inode->i_rdev; 29 stat->rdev = inode->i_rdev;
30 stat->size = i_size_read(inode);
30 stat->atime = inode->i_atime; 31 stat->atime = inode->i_atime;
31 stat->mtime = inode->i_mtime; 32 stat->mtime = inode->i_mtime;
32 stat->ctime = inode->i_ctime; 33 stat->ctime = inode->i_ctime;
33 stat->size = i_size_read(inode);
34 stat->blocks = inode->i_blocks;
35 stat->blksize = (1 << inode->i_blkbits); 34 stat->blksize = (1 << inode->i_blkbits);
35 stat->blocks = inode->i_blocks;
36} 36}
37 37
38EXPORT_SYMBOL(generic_fillattr); 38EXPORT_SYMBOL(generic_fillattr);
@@ -81,8 +81,6 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,
81 81
82 if (!(flag & AT_SYMLINK_NOFOLLOW)) 82 if (!(flag & AT_SYMLINK_NOFOLLOW))
83 lookup_flags |= LOOKUP_FOLLOW; 83 lookup_flags |= LOOKUP_FOLLOW;
84 if (flag & AT_NO_AUTOMOUNT)
85 lookup_flags |= LOOKUP_NO_AUTOMOUNT;
86 if (flag & AT_EMPTY_PATH) 84 if (flag & AT_EMPTY_PATH)
87 lookup_flags |= LOOKUP_EMPTY; 85 lookup_flags |= LOOKUP_EMPTY;
88 86
@@ -296,15 +294,16 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
296{ 294{
297 struct path path; 295 struct path path;
298 int error; 296 int error;
297 int empty = 0;
299 298
300 if (bufsiz <= 0) 299 if (bufsiz <= 0)
301 return -EINVAL; 300 return -EINVAL;
302 301
303 error = user_path_at(dfd, pathname, LOOKUP_EMPTY, &path); 302 error = user_path_at_empty(dfd, pathname, LOOKUP_EMPTY, &path, &empty);
304 if (!error) { 303 if (!error) {
305 struct inode *inode = path.dentry->d_inode; 304 struct inode *inode = path.dentry->d_inode;
306 305
307 error = -EINVAL; 306 error = empty ? -ENOENT : -EINVAL;
308 if (inode->i_op->readlink) { 307 if (inode->i_op->readlink) {
309 error = security_inode_readlink(path.dentry); 308 error = security_inode_readlink(path.dentry);
310 if (!error) { 309 if (!error) {