Thread (45 messages) 45 messages, 7 authors, 2019-07-19

Re: [PATCH v9 04/10] namei: split out nd->dfd handling to dirfd_path_init

From: Aleksa Sarai <hidden>
Date: 2019-07-12 12:13:04
Also in: linux-alpha, linux-api, linux-arch, linux-fsdevel, linux-kselftest, linux-mips, linux-s390, linux-sh, linuxppc-dev, lkml, sparclinux

On 2019-07-12, Aleksa Sarai [off-list ref] wrote:
On 2019-07-12, Al Viro [off-list ref] wrote:
quoted
On Sun, Jul 07, 2019 at 12:57:31AM +1000, Aleksa Sarai wrote:
quoted
Previously, path_init's handling of *at(dfd, ...) was only done once,
but with LOOKUP_BENEATH (and LOOKUP_IN_ROOT) we have to parse the
initial nd->path at different times (before or after absolute path
handling) depending on whether we have been asked to scope resolution
within a root.
quoted
 	if (*s == '/') {
-		set_root(nd);
-		if (likely(!nd_jump_root(nd)))
-			return s;
-		return ERR_PTR(-ECHILD);
quoted
+		if (likely(!nd->root.mnt))
+			set_root(nd);
How can we get there with non-NULL nd->root.mnt, when LOOKUP_ROOT case
has been already handled by that point?
Yup, you're completely right. I will remove the
  if (!nd->root.mnt)
in the next version.
Ah sorry, there is a reason for it -- later in the series the
LOOKUP_BENEATH case means that you might end up with a non-NULL
nd->root.mnt. If you want, I can move the addition of the conditional to
later in the series (it was easier to split the patch by-hunk back when
you originally asked me to split out dirfd_path_init()).

-- 
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
<https://www.cyphar.com/>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help