mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
nsfs: support exhaustive file handles
Pidfd file handles are exhaustive meaning they don't require a handle on another pidfd to pass to open_by_handle_at() so it can derive the filesystem to decode in. Instead it can be derived from the file handle itself. The same is possible for namespace file handles. Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include <linux/personality.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/compat.h>
|
||||
#include <linux/nsfs.h>
|
||||
#include "internal.h"
|
||||
#include "mount.h"
|
||||
|
||||
@@ -189,6 +190,11 @@ static int get_path_anchor(int fd, struct path *root)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fd == FD_NSFS_ROOT) {
|
||||
nsfs_get_root(root);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user