Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

do_readlinkat(): import pathname only once

Take getname_flags() and putname() outside of retry loop.

Since getname_flags() is the only thing that cares about LOOKUP_EMPTY,
don't bother with setting LOOKUP_EMPTY in lookup_flags - just pass it
to getname_flags() and be done with that.

The things could be further simplified by use of cleanup.h stuff, but
let's not clutter the patch with that.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 1ee5220e cf6b819c

+3 -3
+3 -3
fs/stat.c
··· 566 566 struct path path; 567 567 struct filename *name; 568 568 int error; 569 - unsigned int lookup_flags = LOOKUP_EMPTY; 569 + unsigned int lookup_flags = 0; 570 570 571 571 if (bufsiz <= 0) 572 572 return -EINVAL; 573 573 574 + name = getname_flags(pathname, LOOKUP_EMPTY); 574 575 retry: 575 - name = getname_flags(pathname, lookup_flags); 576 576 error = filename_lookup(dfd, name, lookup_flags, &path, NULL); 577 577 if (unlikely(error)) { 578 578 putname(name); ··· 593 593 error = (name->name[0] == '\0') ? -ENOENT : -EINVAL; 594 594 } 595 595 path_put(&path); 596 - putname(name); 597 596 if (retry_estale(error, lookup_flags)) { 598 597 lookup_flags |= LOOKUP_REVAL; 599 598 goto retry; 600 599 } 600 + putname(name); 601 601 return error; 602 602 } 603 603