summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/stat.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/stat.c b/fs/stat.c
index 6c79661e1b96..ee9ae2c3273a 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -566,13 +566,13 @@ static int do_readlinkat(int dfd, const char __user *pathname,
struct path path;
struct filename *name;
int error;
- unsigned int lookup_flags = LOOKUP_EMPTY;
+ unsigned int lookup_flags = 0;
if (bufsiz <= 0)
return -EINVAL;
+ name = getname_flags(pathname, LOOKUP_EMPTY);
retry:
- name = getname_flags(pathname, lookup_flags);
error = filename_lookup(dfd, name, lookup_flags, &path, NULL);
if (unlikely(error)) {
putname(name);
@@ -593,11 +593,11 @@ retry:
error = (name->name[0] == '\0') ? -ENOENT : -EINVAL;
}
path_put(&path);
- putname(name);
if (retry_estale(error, lookup_flags)) {
lookup_flags |= LOOKUP_REVAL;
goto retry;
}
+ putname(name);
return error;
}