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.

chroot(2): import pathname only once

Convert the user_path_at() call inside a retry loop into getname_flags() +
filename_lookup() + putname() and leave only filename_lookup() inside
the loop.

In this case we never pass LOOKUP_EMPTY, so getname_flags() is equivalent
to plain getname().

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 c3fa2b7c 592ab7fb

+3 -1
+3 -1
fs/open.c
··· 600 600 struct path path; 601 601 int error; 602 602 unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY; 603 + struct filename *name = getname(filename); 603 604 retry: 604 - error = user_path_at(AT_FDCWD, filename, lookup_flags, &path); 605 + error = filename_lookup(AT_FDCWD, name, lookup_flags, &path, NULL); 605 606 if (error) 606 607 goto out; 607 608 ··· 626 625 goto retry; 627 626 } 628 627 out: 628 + putname(name); 629 629 return error; 630 630 } 631 631