All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vfs: allow O_PATH file descriptors for open_by_handle_at()
@ 2021-05-28  5:17 NeilBrown
  0 siblings, 0 replies; only message in thread
From: NeilBrown @ 2021-05-28  5:17 UTC (permalink / raw)
  To: Al Viro; +Cc: Andrew Morton, LKML, James Simmons


The purpose of the "mount_fd" arg to open_by_handle_at() is solely to
identify a particular mount.  i.e.  it indicates "a location in the
filesystem tree" which is one of the purposes of O_PATH.

So change fdget() to fdget_raw().

Cc: stable@vger.kernel.org # O_PATH introduced in 3.0+
Signed-off-by: NeilBrown <neilb@suse.de>
---

This seems generally sensible, but will particularly be useful in
preparing the Lustre filesystem for upstream.

 fs/fhandle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fhandle.c b/fs/fhandle.c
index ec6feeccc276..0020a0afdf86 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -122,7 +122,7 @@ static struct vfsmount *get_vfsmount_from_fd(int fd)
 		mnt = mntget(fs->pwd.mnt);
 		spin_unlock(&fs->lock);
 	} else {
-		struct fd f = fdget(fd);
+		struct fd f = fdget_raw(fd);
 		if (!f.file)
 			return ERR_PTR(-EBADF);
 		mnt = mntget(f.file->f_path.mnt);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-28  5:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28  5:17 [PATCH] vfs: allow O_PATH file descriptors for open_by_handle_at() NeilBrown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.