]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/stat.c
CIFS: Cleanup byte-range locking code style
[karo-tx-linux.git] / fs / stat.c
index 78a3aa83c7eac3f153cc5e370cabd754babb9aab..8806b8997d2efcfd73944df9f3695d40207fb6bf 100644 (file)
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -294,15 +294,16 @@ SYSCALL_DEFINE4(readlinkat, int, dfd, const char __user *, pathname,
 {
        struct path path;
        int error;
+       int empty = 0;
 
        if (bufsiz <= 0)
                return -EINVAL;
 
-       error = user_path_at(dfd, pathname, LOOKUP_EMPTY, &path);
+       error = user_path_at_empty(dfd, pathname, LOOKUP_EMPTY, &path, &empty);
        if (!error) {
                struct inode *inode = path.dentry->d_inode;
 
-               error = -EINVAL;
+               error = empty ? -ENOENT : -EINVAL;
                if (inode->i_op->readlink) {
                        error = security_inode_readlink(path.dentry);
                        if (!error) {