LKML Archive on
help / color / mirror / Atom feed
From: Christian Brauner <>
To:, torvalds@linux-foundation.o,,
Cc: Christian Brauner <>
Subject: [PATCH 0/3] namei: add follow_up_bind()
Date: Thu,  5 Apr 2018 12:45:46 +0200	[thread overview]
Message-ID: <> (raw)

Hi everyone,

Back when we fixed TIOCGPTPEER again in

commit a319b01d9095 ("devpts: resolve devpts bind-mounts")

we discovered [1] that the code for bind-mount resolution we needed to add
in devpts_mtnget() was already duplicated in nfsd code. So we briefly
discussed [2] adding a helper to namei.{c,h} that would resolve
bind-mounts. The bind-mount resolution code is replicated in at least two
- fs/nfsd/vfs.c:follow_to_parent()
- fs/devpts/inode.c:devpts_mntget()

This series adds:
- follow_up_bind() to namei.{c,h}
- switches fs/nfsd/vfs.c:follow_to_parent() to use follow_up_bind()
- switches fs/devpts/inode.c:devpts_mntget() to use follow_up_bind()

I just wanted to wait until the devpts patches I sent would make it into
mainline. Seems to me that this helper might be worth having around. Not
just because it avoids (granted rather trivial) code duplication but also
because it makes the concept of resolving a bind-mount up to the origin
mountpoint of the vfs's mount obvious (which at least to me wasn't
obivous before).



Christian Brauner (3):
  namei: add follow_up_bind()
  devpts: use follow_up_bind() helper
  nfsd: use follow_up_bind() helper

 fs/devpts/inode.c     |  4 +---
 fs/namei.c            | 10 ++++++++++
 fs/nfsd/vfs.c         |  4 ++--
 include/linux/namei.h |  1 +
 4 files changed, 14 insertions(+), 5 deletions(-)


             reply	other threads:[~2018-04-05 10:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 10:45 Christian Brauner [this message]
2018-04-05 10:45 ` [PATCH 1/3] " Christian Brauner
2018-04-05 10:45 ` [PATCH 2/3] devpts: use follow_up_bind() helper Christian Brauner
2018-04-05 10:45 ` [PATCH 3/3] nfsd: " Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \
    --cc=torvalds@linux-foundation.o \ \
    --subject='Re: [PATCH 0/3] namei: add follow_up_bind()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).