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.

chdir(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 592ab7fb b756d8ba

+3 -1
+3 -1
fs/open.c
··· 555 555 struct path path; 556 556 int error; 557 557 unsigned int lookup_flags = LOOKUP_FOLLOW | LOOKUP_DIRECTORY; 558 + struct filename *name = getname(filename); 558 559 retry: 559 - error = user_path_at(AT_FDCWD, filename, lookup_flags, &path); 560 + error = filename_lookup(AT_FDCWD, name, lookup_flags, &path, NULL); 560 561 if (error) 561 562 goto out; 562 563 ··· 574 573 goto retry; 575 574 } 576 575 out: 576 + putname(name); 577 577 return error; 578 578 } 579 579