* [PATCH v4 00/47] file: FD_{ADD,PREPARE}()
@ 2025-11-23 16:33 Christian Brauner
2025-11-23 16:33 ` [PATCH v4 01/47] file: add FD_{ADD,PREPARE}() Christian Brauner
` (47 more replies)
0 siblings, 48 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Hey,
This now removes roughly double the code that it adds.
I've been playing with this to allow for moderately flexible usage of
the get_unused_fd_flags() + create file + fd_install() pattern that's
used quite extensively and requires cumbersome cleanup paths.
How callers allocate files is really heterogenous so it's not really
convenient to fold them into a single class. It's possibe to split them
into subclasses like for anon inodes. I think that's not necessarily
nice as well. This adds two primitives:
(1) FD_ADD() the simple cases a file is installed:
fd = FD_ADD(O_CLOEXEC, vfio_device_open_file(device));
if (fd < 0)
vfio_device_put_registration(device);
return fd;
(2) FD_PREPARE() that captures all the cases where access to fd or file
or additional work before publishing the fd is needed:
FD_PREPARE(fdf, O_CLOEXEC, sync_file->file);
if (fdf.err) {
fput(sync_file->file);
return fdf.err;
}
data.fence = fd_prepare_fd(fdf);
if (copy_to_user((void __user *)arg, &data, sizeof(data)))
return -EFAULT;
return fd_publish(fdf);
I've converted all of the easy cases over to it and it gets rid of an
aweful lot of convoluted cleanup logic. There are a bunch of other cases
that can also be converted after a bit of massaging.
It's centered around a simple struct. FD_PREPARE() encapsulates all of
allocation and cleanup logic and must be followed by a call to
fd_publish() which associates the fd with the file and installs it into
the callers fdtable. If fd_publish() isn't called both are deallocated.
FD_ADD() is a shorthand that does the fd_publish() and never exposes the
struct to the caller. That's often the case when they don't need access
to anything after installing the fd.
It mandates a specific order namely that first we allocate the fd and
then instantiate the file. But that shouldn't be a problem. Nearly
everyone I've converted used this order anyway.
There's a bunch of additional cases where it would be easy to convert
them to this pattern. For example, the whole sync file stuff in dma
currently returns the containing structure of the file instead of the
file itself even though it's only used to allocate files. Changing that
would make it fall into the FD_PREPARE() pattern easily. I've not done
that work yet.
There's room for extending this in a way that wed'd have subclasses for
some particularly often use patterns but as I said I'm not even sure
that's worth it.
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
Changes in v4:
- Integrated error checking into FD_PREPARE() as per Linus suggestion.
- Added FD_ADD() as it's such an obvious win for a bunch of cases.
- Link to v3: https://patch.msgid.link/20251121-work-fd-prepare-v3-0-2c6444d13e0e@kernel.org
Changes in v3:
- Remove scope-based variant.
- Link to v2: https://patch.msgid.link/20251120-work-fd-prepare-v2-0-fef6ebda05d3@kernel.org
Changes in v2:
- Make FD_PREPARE() use a separate scope.
- Convert most easy cases.
- Link to v1: https://patch.msgid.link/20251118-work-fd-prepare-v1-0-c20504d97375@kernel.org
---
Christian Brauner (47):
file: add FD_{ADD,PREPARE}()
anon_inodes: convert to FD_PREPARE()
eventfd: convert do_eventfd() to FD_PREPARE()
fhandle: convert do_handle_open() to FD_PREPARE()
namespace: convert open_tree() to FD_PREPARE()
namespace: convert open_tree_attr() to FD_PREPARE()
namespace: convert fsmount() to FD_PREPARE()
fanotify: convert fanotify_init() to FD_PREPARE()
nsfs: convert open_namespace() to FD_PREPARE()
nsfs: convert ns_ioctl() to FD_PREPARE()
autofs: convert autofs_dev_ioctl_open_mountpoint() to FD_PREPARE()
eventpoll: convert do_epoll_create() to FD_PREPARE()
open: convert do_sys_openat2() to FD_PREPARE()
signalfd: convert do_signalfd4() to FD_PREPARE()
timerfd: convert timerfd_create() to FD_PREPARE()
userfaultfd: convert new_userfaultfd() to FD_PREPARE()
xfs: convert xfs_open_by_handle() to FD_PREPARE()
dma: convert dma_buf_fd() to FD_PREPARE()
af_unix: convert unix_file_open() to FD_PREPARE()
dma: convert sync_file_ioctl_merge() to FD_PREPARE()
exec: convert begin_new_exec() to FD_PREPARE()
ipc: convert do_mq_open() to FD_PREPARE()
bpf: convert bpf_iter_new_fd() to FD_PREPARE()
bpf: convert bpf_token_create() to FD_PREPARE()
memfd: convert memfd_create() to FD_PREPARE()
secretmem: convert memfd_secret() to FD_PREPARE()
net/handshake: convert handshake_nl_accept_doit() to FD_PREPARE()
net/kcm: convert kcm_ioctl() to FD_PREPARE()
net/sctp: convert sctp_getsockopt_peeloff_common() to FD_PREPARE()
net/socket: convert sock_map_fd() to FD_PREPARE()
net/socket: convert __sys_accept4_file() to FD_PREPARE()
spufs: convert spufs_context_open() to FD_PREPARE()
papr-hvpipe: convert papr_hvpipe_dev_create_handle() to FD_PREPARE()
spufs: convert spufs_gang_open() to FD_PREPARE()
pseries: convert papr_platform_dump_create_handle() to FD_PREPARE()
pseries: port papr_rtas_setup_file_interface() to FD_PREPARE()
dma: port sw_sync_ioctl_create_fence() to FD_PREPARE()
gpio: convert linehandle_create() to FD_PREPARE()
hv: convert mshv_ioctl_create_partition() to FD_PREPARE()
media: convert media_request_alloc() to FD_PREPARE()
ntsync: convert ntsync_obj_get_fd() to FD_PREPARE()
tty: convert ptm_open_peer() to FD_PREPARE()
vfio: convert vfio_group_ioctl_get_device_fd() to FD_PREPARE()
file: convert replace_fd() to FD_PREPARE()
io_uring: convert io_create_mock_file() to FD_PREPARE()
kvm: convert kvm_arch_supports_gmem_init_shared() to FD_PREPARE()
kvm: convert kvm_vcpu_ioctl_get_stats_fd() to FD_PREPARE()
arch/powerpc/platforms/cell/spufs/inode.c | 42 +++-------
arch/powerpc/platforms/pseries/papr-hvpipe.c | 39 +++-------
.../powerpc/platforms/pseries/papr-platform-dump.c | 32 +++-----
arch/powerpc/platforms/pseries/papr-rtas-common.c | 27 ++-----
drivers/dma-buf/dma-buf.c | 10 +--
drivers/dma-buf/sw_sync.c | 40 ++++------
drivers/dma-buf/sync_file.c | 52 ++++---------
drivers/gpio/gpiolib-cdev.c | 58 ++++++--------
drivers/hv/mshv_root_main.c | 29 ++-----
drivers/media/mc/mc-request.c | 34 +++-----
drivers/misc/ntsync.c | 20 ++---
drivers/tty/pty.c | 30 ++-----
drivers/vfio/group.c | 28 ++-----
fs/anon_inodes.c | 23 +-----
fs/autofs/dev-ioctl.c | 30 ++-----
fs/eventfd.c | 31 +++-----
fs/eventpoll.c | 32 +++-----
fs/exec.c | 9 ++-
fs/fhandle.c | 30 ++++---
fs/file.c | 19 ++---
fs/namespace.c | 88 +++++++--------------
fs/notify/fanotify/fanotify_user.c | 60 ++++++--------
fs/nsfs.c | 46 ++++-------
fs/open.c | 17 +---
fs/signalfd.c | 29 +++----
fs/timerfd.c | 29 +++----
fs/userfaultfd.c | 30 +++----
fs/xfs/xfs_handle.c | 53 ++++---------
include/linux/cleanup.h | 7 ++
include/linux/file.h | 91 ++++++++++++++++++++++
io_uring/mock_file.c | 44 ++++-------
ipc/mqueue.c | 31 +++-----
kernel/bpf/bpf_iter.c | 29 ++-----
kernel/bpf/token.c | 47 ++++-------
mm/memfd.c | 29 ++-----
mm/secretmem.c | 20 +----
net/handshake/netlink.c | 37 ++++-----
net/kcm/kcmsock.c | 23 ++----
net/sctp/socket.c | 90 ++++++---------------
net/socket.c | 34 ++------
net/unix/af_unix.c | 16 +---
virt/kvm/guest_memfd.c | 35 +++------
virt/kvm/kvm_main.c | 20 ++---
43 files changed, 511 insertions(+), 1009 deletions(-)
---
base-commit: c8e00cdc7425d5c60fd1ce6e7f71e5fb1b236991
change-id: 20251118-work-fd-prepare-f415a3bf5fda
^ permalink raw reply [flat|nested] 74+ messages in thread
* [PATCH v4 01/47] file: add FD_{ADD,PREPARE}()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-24 15:03 ` Jason Gunthorpe
2025-11-23 16:33 ` [PATCH v4 02/47] anon_inodes: convert to FD_PREPARE() Christian Brauner
` (46 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
I've been playing with this to allow for moderately flexible usage of
the get_unused_fd_flags() + create file + fd_install() pattern that's
used quite extensively.
How callers allocate files is really heterogenous so it's not really
convenient to fold them into a single class. It's possibe to split them
into subclasses like for anon inodes. I think that's not necessarily
nice as well.
My take is to add two primites:
(1) FD_ADD() the simple cases a file is installed:
fd = FD_ADD(O_CLOEXEC, open_file(some, args)));
if (fd >= 0)
kvm_get_kvm(vcpu->kvm);
return fd;
(2) FD_PREPARE() that captures all the cases where access to fd or file
or additional work before publishing the fd is needed:
FD_PREPARE(fdf, open_flag, file_open_handle(&path, open_flag));
if (fdf.err)
return fdf.err;
if (copy_to_user(/* something something */))
return -EFAULT;
return fd_publish(fdf);
I've converted all of the easy cases over to it and it gets rid of an
aweful lot of convoluted cleanup logic.
It's centered around struct fd_prepare. FD_PREPARE() encapsulates all of
allocation and cleanup logic and must be followed by a call to
fd_publish() which associates the fd with the file and installs it into
the callers fdtable. If fd_publish() isn't called both are deallocated.
It mandates a specific order namely that first we allocate the fd and
then instantiate the file. But that shouldn't be a problem nearly
everyone I've converted uses this exact pattern anyway.
There's a bunch of additional cases where it would be easy to convert
them to this pattern. For example, the whole sync file stuff in dma
currently retains the containing structure of the file instead of the
file itself even though it's only used to allocate files. Changing that
would make it fall into the FD_PREPARE() pattern easily. I've not done
that work yet.
There's room for extending this in a way that wed'd have subclasses for
some particularly often use patterns but as I said I'm not even sure
that's worth it.
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
include/linux/cleanup.h | 7 ++++
include/linux/file.h | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 98 insertions(+)
diff --git a/include/linux/cleanup.h b/include/linux/cleanup.h
index 19c7e475d3a4..b8bd2f15f91f 100644
--- a/include/linux/cleanup.h
+++ b/include/linux/cleanup.h
@@ -261,6 +261,10 @@ const volatile void * __must_check_fn(const volatile void *val)
* CLASS(name, var)(args...):
* declare the variable @var as an instance of the named class
*
+ * CLASS_INIT(name, var, init_expr):
+ * declare the variable @var as an instance of the named class with
+ * custom initialization expression.
+ *
* Ex.
*
* DEFINE_CLASS(fdget, struct fd, fdput(_T), fdget(fd), int fd)
@@ -290,6 +294,9 @@ static inline class_##_name##_t class_##_name##ext##_constructor(_init_args) \
class_##_name##_t var __cleanup(class_##_name##_destructor) = \
class_##_name##_constructor
+#define CLASS_INIT(_name, _var, _init_expr) \
+ class_##_name##_t _var __cleanup(class_##_name##_destructor) = (_init_expr)
+
#define __scoped_class(_name, var, _label, args...) \
for (CLASS(_name, var)(args); ; ({ goto _label; })) \
if (0) { \
diff --git a/include/linux/file.h b/include/linux/file.h
index af1768d934a0..2f1853612b56 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -127,4 +127,95 @@ extern void __fput_sync(struct file *);
extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max;
+/*
+ * class_fd_prepare_t: Combined fd + file allocation cleanup class.
+ *
+ * Allocates an fd and a file together. On error paths, automatically cleans
+ * up whichever resource was successfully allocated. Allows flexible file
+ * allocation with different functions per usage.
+ */
+typedef struct {
+ s32 err;
+ s32 __fd;
+ struct file *__file;
+} class_fd_prepare_t;
+
+#define fd_prepare_fd(_T) ((_T).__fd)
+#define fd_prepare_file(_T) ((_T).__file)
+
+static inline void class_fd_prepare_destructor(class_fd_prepare_t *_T)
+{
+ if (unlikely(_T->err)) {
+ if (likely(_T->__fd >= 0))
+ put_unused_fd(_T->__fd);
+ if (unlikely(!IS_ERR_OR_NULL(_T->__file)))
+ fput(_T->__file);
+ }
+}
+
+static inline int class_fd_prepare_lock_err(class_fd_prepare_t *_T)
+{
+ if (unlikely(_T->__fd < 0))
+ return _T->__fd;
+ if (unlikely(IS_ERR(_T->__file)))
+ return PTR_ERR(_T->__file);
+ if (unlikely(!_T->__file))
+ return -ENOMEM;
+ return 0;
+}
+
+/*
+ * __FD_PREPARE_INIT(fd_flags, file_init_expr):
+ * Helper to initialize fd_prepare class.
+ * @fd_flags: flags for get_unused_fd_flags()
+ * @file_init_expr: expression that returns struct file *
+ *
+ * Returns a struct fd_prepare with fd, file, and err set.
+ * If fd allocation fails, fd will be negative and err will be set.
+ * If fd succeeds but file_init_expr fails, file will be ERR_PTR and err will be set.
+ * The err field is the single source of truth for error checking.
+ */
+#define __FD_PREPARE_INIT(_fd_flags, _file_init_owned) \
+ ({ \
+ class_fd_prepare_t _fd_prepare = { \
+ .__fd = get_unused_fd_flags((_fd_flags)), \
+ }; \
+ if (likely(_fd_prepare.__fd >= 0)) \
+ _fd_prepare.__file = (_file_init_owned); \
+ _fd_prepare.err = ACQUIRE_ERR(fd_prepare, &_fd_prepare); \
+ _fd_prepare; \
+ })
+
+/*
+ * FD_PREPARE(var, fd_flags, file_init_owned):
+ * Declares and initializes an fd_prepare variable with automatic cleanup.
+ * No separate scope required - cleanup happens when variable goes out of scope.
+ *
+ * @_var: name of struct fd_prepare variable to define
+ * @_fd_flags: flags for get_unused_fd_flags()
+ * @_file_init_owned: struct file to take ownership of (can be expression)
+ */
+#define FD_PREPARE(_var, _fd_flags, _file_init_owned) \
+ CLASS_INIT(fd_prepare, _var, __FD_PREPARE_INIT(_fd_flags, _file_init_owned))
+
+#define fd_publish(_fd_prepare) \
+ ({ \
+ class_fd_prepare_t *__p = &(_fd_prepare); \
+ VFS_WARN_ON_ONCE(__p->err); \
+ VFS_WARN_ON_ONCE(__p->__fd < 0); \
+ VFS_WARN_ON_ONCE(IS_ERR_OR_NULL(__p->__file)); \
+ fd_install(__p->__fd, __p->__file); \
+ retain_and_null_ptr(__p->__file); \
+ take_fd(__p->__fd); \
+ })
+
+#define FD_ADD(_fd_flags, _file_init_owned) \
+ ({ \
+ FD_PREPARE(_var, _fd_flags, _file_init_owned); \
+ s32 ret = _var.err; \
+ if (likely(!ret)) \
+ ret = fd_publish(_var); \
+ ret; \
+ })
+
#endif /* __LINUX_FILE_H */
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 02/47] anon_inodes: convert to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
2025-11-23 16:33 ` [PATCH v4 01/47] file: add FD_{ADD,PREPARE}() Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 12:16 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 03/47] eventfd: convert do_eventfd() " Christian Brauner
` (45 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/anon_inodes.c | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
index 180a458fc4f7..b8381c7fb636 100644
--- a/fs/anon_inodes.c
+++ b/fs/anon_inodes.c
@@ -280,27 +280,8 @@ static int __anon_inode_getfd(const char *name,
const struct inode *context_inode,
bool make_inode)
{
- int error, fd;
- struct file *file;
-
- error = get_unused_fd_flags(flags);
- if (error < 0)
- return error;
- fd = error;
-
- file = __anon_inode_getfile(name, fops, priv, flags, context_inode,
- make_inode);
- if (IS_ERR(file)) {
- error = PTR_ERR(file);
- goto err_put_unused_fd;
- }
- fd_install(fd, file);
-
- return fd;
-
-err_put_unused_fd:
- put_unused_fd(fd);
- return error;
+ return FD_ADD(flags, __anon_inode_getfile(name, fops, priv, flags,
+ context_inode, make_inode));
}
/**
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 03/47] eventfd: convert do_eventfd() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
2025-11-23 16:33 ` [PATCH v4 01/47] file: add FD_{ADD,PREPARE}() Christian Brauner
2025-11-23 16:33 ` [PATCH v4 02/47] anon_inodes: convert to FD_PREPARE() Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 12:18 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 04/47] fhandle: convert do_handle_open() " Christian Brauner
` (44 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/eventfd.c | 31 +++++++++++--------------------
1 file changed, 11 insertions(+), 20 deletions(-)
diff --git a/fs/eventfd.c b/fs/eventfd.c
index af42b2c7d235..3219e0d596fe 100644
--- a/fs/eventfd.c
+++ b/fs/eventfd.c
@@ -378,9 +378,7 @@ EXPORT_SYMBOL_GPL(eventfd_ctx_fileget);
static int do_eventfd(unsigned int count, int flags)
{
- struct eventfd_ctx *ctx;
- struct file *file;
- int fd;
+ struct eventfd_ctx *ctx __free(kfree) = NULL;
/* Check the EFD_* constants for consistency. */
BUILD_BUG_ON(EFD_CLOEXEC != O_CLOEXEC);
@@ -398,26 +396,19 @@ static int do_eventfd(unsigned int count, int flags)
init_waitqueue_head(&ctx->wqh);
ctx->count = count;
ctx->flags = flags;
- ctx->id = ida_alloc(&eventfd_ida, GFP_KERNEL);
flags &= EFD_SHARED_FCNTL_FLAGS;
flags |= O_RDWR;
- fd = get_unused_fd_flags(flags);
- if (fd < 0)
- goto err;
-
- file = anon_inode_getfile_fmode("[eventfd]", &eventfd_fops,
- ctx, flags, FMODE_NOWAIT);
- if (IS_ERR(file)) {
- put_unused_fd(fd);
- fd = PTR_ERR(file);
- goto err;
- }
- fd_install(fd, file);
- return fd;
-err:
- eventfd_free_ctx(ctx);
- return fd;
+
+ FD_PREPARE(fdf, flags,
+ anon_inode_getfile_fmode("[eventfd]", &eventfd_fops, ctx,
+ flags, FMODE_NOWAIT));
+ if (fdf.err)
+ return fdf.err;
+
+ ctx->id = ida_alloc(&eventfd_ida, GFP_KERNEL);
+ retain_and_null_ptr(ctx);
+ return fd_publish(fdf);
}
SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 04/47] fhandle: convert do_handle_open() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (2 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 03/47] eventfd: convert do_eventfd() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 12:15 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 05/47] namespace: convert open_tree() " Christian Brauner
` (43 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/fhandle.c | 30 +++++++++++++-----------------
1 file changed, 13 insertions(+), 17 deletions(-)
diff --git a/fs/fhandle.c b/fs/fhandle.c
index 052f9c9368fb..3de1547ec9d4 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -404,32 +404,28 @@ static int handle_to_path(int mountdirfd, struct file_handle __user *ufh,
return retval;
}
+static struct file *file_open_handle(struct path *path, int open_flag)
+{
+ const struct export_operations *eops;
+
+ eops = path->mnt->mnt_sb->s_export_op;
+ if (eops->open)
+ return eops->open(path, open_flag);
+
+ return file_open_root(path, "", open_flag, 0);
+}
+
static long do_handle_open(int mountdirfd, struct file_handle __user *ufh,
int open_flag)
{
- long retval = 0;
+ long retval;
struct path path __free(path_put) = {};
- struct file *file;
- const struct export_operations *eops;
retval = handle_to_path(mountdirfd, ufh, &path, open_flag);
if (retval)
return retval;
- CLASS(get_unused_fd, fd)(open_flag);
- if (fd < 0)
- return fd;
-
- eops = path.mnt->mnt_sb->s_export_op;
- if (eops->open)
- file = eops->open(&path, open_flag);
- else
- file = file_open_root(&path, "", open_flag, 0);
- if (IS_ERR(file))
- return PTR_ERR(file);
-
- fd_install(fd, file);
- return take_fd(fd);
+ return FD_ADD(open_flag, file_open_handle(&path, open_flag));
}
/**
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 05/47] namespace: convert open_tree() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (3 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 04/47] fhandle: convert do_handle_open() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 12:32 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 06/47] namespace: convert open_tree_attr() " Christian Brauner
` (42 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/namespace.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index d82910f33dc4..3cf3fa27117d 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3103,19 +3103,7 @@ static struct file *vfs_open_tree(int dfd, const char __user *filename, unsigned
SYSCALL_DEFINE3(open_tree, int, dfd, const char __user *, filename, unsigned, flags)
{
- int fd;
- struct file *file __free(fput) = NULL;
-
- file = vfs_open_tree(dfd, filename, flags);
- if (IS_ERR(file))
- return PTR_ERR(file);
-
- fd = get_unused_fd_flags(flags & O_CLOEXEC);
- if (fd < 0)
- return fd;
-
- fd_install(fd, no_free_ptr(file));
- return fd;
+ return FD_ADD(flags, vfs_open_tree(dfd, filename, flags));
}
/*
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 06/47] namespace: convert open_tree_attr() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (4 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 05/47] namespace: convert open_tree() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 12:33 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 07/47] namespace: convert fsmount() " Christian Brauner
` (41 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/namespace.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 3cf3fa27117d..0c4024558c13 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -5023,19 +5023,17 @@ SYSCALL_DEFINE5(open_tree_attr, int, dfd, const char __user *, filename,
unsigned, flags, struct mount_attr __user *, uattr,
size_t, usize)
{
- struct file __free(fput) *file = NULL;
- int fd;
-
if (!uattr && usize)
return -EINVAL;
- file = vfs_open_tree(dfd, filename, flags);
- if (IS_ERR(file))
- return PTR_ERR(file);
+ FD_PREPARE(fdf, flags, vfs_open_tree(dfd, filename, flags));
+ if (fdf.err)
+ return fdf.err;
if (uattr) {
- int ret;
struct mount_kattr kattr = {};
+ struct file *file = fd_prepare_file(fdf);
+ int ret;
if (flags & OPEN_TREE_CLONE)
kattr.kflags = MOUNT_KATTR_IDMAP_REPLACE;
@@ -5051,12 +5049,7 @@ SYSCALL_DEFINE5(open_tree_attr, int, dfd, const char __user *, filename,
return ret;
}
- fd = get_unused_fd_flags(flags & O_CLOEXEC);
- if (fd < 0)
- return fd;
-
- fd_install(fd, no_free_ptr(file));
- return fd;
+ return fd_publish(fdf);
}
int show_path(struct seq_file *m, struct dentry *root)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 07/47] namespace: convert fsmount() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (5 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 06/47] namespace: convert open_tree_attr() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 12:42 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 08/47] fanotify: convert fanotify_init() " Christian Brauner
` (40 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/namespace.c | 55 +++++++++++++++++++++----------------------------------
1 file changed, 21 insertions(+), 34 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 0c4024558c13..f118fc318156 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -4273,8 +4273,7 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
{
struct mnt_namespace *ns;
struct fs_context *fc;
- struct file *file;
- struct path newmount;
+ struct path newmount __free(path_put) = {};
struct mount *mnt;
unsigned int mnt_flags = 0;
long ret;
@@ -4312,33 +4311,32 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
fc = fd_file(f)->private_data;
- ret = mutex_lock_interruptible(&fc->uapi_mutex);
- if (ret < 0)
+ ACQUIRE(mutex_intr, uapi_mutex)(&fc->uapi_mutex);
+ ret = ACQUIRE_ERR(mutex_intr, &uapi_mutex);
+ if (ret)
return ret;
/* There must be a valid superblock or we can't mount it */
ret = -EINVAL;
if (!fc->root)
- goto err_unlock;
+ return ret;
ret = -EPERM;
if (mount_too_revealing(fc->root->d_sb, &mnt_flags)) {
errorfcp(fc, "VFS", "Mount too revealing");
- goto err_unlock;
+ return ret;
}
ret = -EBUSY;
if (fc->phase != FS_CONTEXT_AWAITING_MOUNT)
- goto err_unlock;
+ return ret;
if (fc->sb_flags & SB_MANDLOCK)
warn_mandlock();
newmount.mnt = vfs_create_mount(fc);
- if (IS_ERR(newmount.mnt)) {
- ret = PTR_ERR(newmount.mnt);
- goto err_unlock;
- }
+ if (IS_ERR(newmount.mnt))
+ return PTR_ERR(newmount.mnt);
newmount.dentry = dget(fc->root);
newmount.mnt->mnt_flags = mnt_flags;
@@ -4350,38 +4348,27 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
vfs_clean_context(fc);
ns = alloc_mnt_ns(current->nsproxy->mnt_ns->user_ns, true);
- if (IS_ERR(ns)) {
- ret = PTR_ERR(ns);
- goto err_path;
- }
+ if (IS_ERR(ns))
+ return PTR_ERR(ns);
mnt = real_mount(newmount.mnt);
ns->root = mnt;
ns->nr_mounts = 1;
mnt_add_to_ns(ns, mnt);
mntget(newmount.mnt);
- /* Attach to an apparent O_PATH fd with a note that we need to unmount
- * it, not just simply put it.
- */
- file = dentry_open(&newmount, O_PATH, fc->cred);
- if (IS_ERR(file)) {
+ FD_PREPARE(fdf, (flags & FSMOUNT_CLOEXEC) ? O_CLOEXEC : 0,
+ dentry_open(&newmount, O_PATH, fc->cred));
+ if (fdf.err) {
dissolve_on_fput(newmount.mnt);
- ret = PTR_ERR(file);
- goto err_path;
+ return fdf.err;
}
- file->f_mode |= FMODE_NEED_UNMOUNT;
-
- ret = get_unused_fd_flags((flags & FSMOUNT_CLOEXEC) ? O_CLOEXEC : 0);
- if (ret >= 0)
- fd_install(ret, file);
- else
- fput(file);
-err_path:
- path_put(&newmount);
-err_unlock:
- mutex_unlock(&fc->uapi_mutex);
- return ret;
+ /*
+ * Attach to an apparent O_PATH fd with a note that we
+ * need to unmount it, not just simply put it.
+ */
+ fd_prepare_file(fdf)->f_mode |= FMODE_NEED_UNMOUNT;
+ return fd_publish(fdf);
}
static inline int vfs_move_mount(const struct path *from_path,
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 08/47] fanotify: convert fanotify_init() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (6 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 07/47] namespace: convert fsmount() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-24 17:13 ` Amir Goldstein
2025-11-25 12:13 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 09/47] nsfs: convert open_namespace() " Christian Brauner
` (39 subsequent siblings)
47 siblings, 2 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/notify/fanotify/fanotify_user.c | 60 ++++++++++++++------------------------
1 file changed, 22 insertions(+), 38 deletions(-)
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 1dadda82cae5..be0a96ad4316 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -1597,16 +1597,20 @@ static struct hlist_head *fanotify_alloc_merge_hash(void)
return hash;
}
+DEFINE_CLASS(fsnotify_group,
+ struct fsnotify_group *,
+ if (_T) fsnotify_destroy_group(_T),
+ fsnotify_alloc_group(ops, flags),
+ const struct fsnotify_ops *ops, int flags)
+
/* fanotify syscalls */
SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
{
struct user_namespace *user_ns = current_user_ns();
- struct fsnotify_group *group;
int f_flags, fd;
unsigned int fid_mode = flags & FANOTIFY_FID_BITS;
unsigned int class = flags & FANOTIFY_CLASS_BITS;
unsigned int internal_flags = 0;
- struct file *file;
pr_debug("%s: flags=%x event_f_flags=%x\n",
__func__, flags, event_f_flags);
@@ -1690,36 +1694,29 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
if (flags & FAN_NONBLOCK)
f_flags |= O_NONBLOCK;
- /* fsnotify_alloc_group takes a ref. Dropped in fanotify_release */
- group = fsnotify_alloc_group(&fanotify_fsnotify_ops,
+ CLASS(fsnotify_group, group)(&fanotify_fsnotify_ops,
FSNOTIFY_GROUP_USER);
- if (IS_ERR(group)) {
+ /* fsnotify_alloc_group takes a ref. Dropped in fanotify_release */
+ if (IS_ERR(group))
return PTR_ERR(group);
- }
/* Enforce groups limits per user in all containing user ns */
group->fanotify_data.ucounts = inc_ucount(user_ns, current_euid(),
UCOUNT_FANOTIFY_GROUPS);
- if (!group->fanotify_data.ucounts) {
- fd = -EMFILE;
- goto out_destroy_group;
- }
+ if (!group->fanotify_data.ucounts)
+ return -EMFILE;
group->fanotify_data.flags = flags | internal_flags;
group->memcg = get_mem_cgroup_from_mm(current->mm);
group->user_ns = get_user_ns(user_ns);
group->fanotify_data.merge_hash = fanotify_alloc_merge_hash();
- if (!group->fanotify_data.merge_hash) {
- fd = -ENOMEM;
- goto out_destroy_group;
- }
+ if (!group->fanotify_data.merge_hash)
+ return -ENOMEM;
group->overflow_event = fanotify_alloc_overflow_event();
- if (unlikely(!group->overflow_event)) {
- fd = -ENOMEM;
- goto out_destroy_group;
- }
+ if (unlikely(!group->overflow_event))
+ return -ENOMEM;
if (force_o_largefile())
event_f_flags |= O_LARGEFILE;
@@ -1738,8 +1735,7 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
group->priority = FSNOTIFY_PRIO_PRE_CONTENT;
break;
default:
- fd = -EINVAL;
- goto out_destroy_group;
+ return -EINVAL;
}
BUILD_BUG_ON(!(FANOTIFY_ADMIN_INIT_FLAGS & FAN_UNLIMITED_QUEUE));
@@ -1750,27 +1746,15 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
}
if (flags & FAN_ENABLE_AUDIT) {
- fd = -EPERM;
if (!capable(CAP_AUDIT_WRITE))
- goto out_destroy_group;
- }
-
- fd = get_unused_fd_flags(f_flags);
- if (fd < 0)
- goto out_destroy_group;
-
- file = anon_inode_getfile_fmode("[fanotify]", &fanotify_fops, group,
- f_flags, FMODE_NONOTIFY);
- if (IS_ERR(file)) {
- put_unused_fd(fd);
- fd = PTR_ERR(file);
- goto out_destroy_group;
+ return -EPERM;
}
- fd_install(fd, file);
- return fd;
-out_destroy_group:
- fsnotify_destroy_group(group);
+ fd = FD_ADD(f_flags,
+ anon_inode_getfile_fmode("[fanotify]", &fanotify_fops,
+ group, f_flags, FMODE_NONOTIFY));
+ if (fd >= 0)
+ retain_and_null_ptr(group);
return fd;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 09/47] nsfs: convert open_namespace() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (7 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 08/47] fanotify: convert fanotify_init() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 10/47] nsfs: convert ns_ioctl() " Christian Brauner
` (38 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/nsfs.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/fs/nsfs.c b/fs/nsfs.c
index 79b026a36fb6..7b26cb49a62c 100644
--- a/fs/nsfs.c
+++ b/fs/nsfs.c
@@ -108,7 +108,6 @@ int ns_get_path(struct path *path, struct task_struct *task,
int open_namespace(struct ns_common *ns)
{
struct path path __free(path_put) = {};
- struct file *f;
int err;
/* call first to consume reference */
@@ -116,16 +115,7 @@ int open_namespace(struct ns_common *ns)
if (err < 0)
return err;
- CLASS(get_unused_fd, fd)(O_CLOEXEC);
- if (fd < 0)
- return fd;
-
- f = dentry_open(&path, O_RDONLY, current_cred());
- if (IS_ERR(f))
- return PTR_ERR(f);
-
- fd_install(fd, f);
- return take_fd(fd);
+ return FD_ADD(O_CLOEXEC, dentry_open(&path, O_RDONLY, current_cred()));
}
int open_related_ns(struct ns_common *ns,
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 10/47] nsfs: convert ns_ioctl() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (8 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 09/47] nsfs: convert open_namespace() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 11/47] autofs: convert autofs_dev_ioctl_open_mountpoint() " Christian Brauner
` (37 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/nsfs.c | 34 ++++++++++++----------------------
1 file changed, 12 insertions(+), 22 deletions(-)
diff --git a/fs/nsfs.c b/fs/nsfs.c
index 7b26cb49a62c..1cf20cc8f6ed 100644
--- a/fs/nsfs.c
+++ b/fs/nsfs.c
@@ -320,28 +320,18 @@ static long ns_ioctl(struct file *filp, unsigned int ioctl,
if (ret)
return ret;
- CLASS(get_unused_fd, fd)(O_CLOEXEC);
- if (fd < 0)
- return fd;
-
- f = dentry_open(&path, O_RDONLY, current_cred());
- if (IS_ERR(f))
- return PTR_ERR(f);
-
- if (uinfo) {
- /*
- * If @uinfo is passed return all information about the
- * mount namespace as well.
- */
- ret = copy_ns_info_to_user(to_mnt_ns(ns), uinfo, usize, &kinfo);
- if (ret)
- return ret;
- }
-
- /* Transfer reference of @f to caller's fdtable. */
- fd_install(fd, no_free_ptr(f));
- /* File descriptor is live so hand it off to the caller. */
- return take_fd(fd);
+ FD_PREPARE(fdf, O_CLOEXEC, dentry_open(&path, O_RDONLY, current_cred()));
+ if (fdf.err)
+ return fdf.err;
+ /*
+ * If @uinfo is passed return all information about the
+ * mount namespace as well.
+ */
+ ret = copy_ns_info_to_user(to_mnt_ns(ns), uinfo, usize, &kinfo);
+ if (ret)
+ return ret;
+ ret = fd_publish(fdf);
+ break;
}
default:
ret = -ENOTTY;
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 11/47] autofs: convert autofs_dev_ioctl_open_mountpoint() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (9 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 10/47] nsfs: convert ns_ioctl() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 12/47] eventpoll: convert do_epoll_create() " Christian Brauner
` (36 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/autofs/dev-ioctl.c | 30 ++++++------------------------
1 file changed, 6 insertions(+), 24 deletions(-)
diff --git a/fs/autofs/dev-ioctl.c b/fs/autofs/dev-ioctl.c
index d8dd150cbd74..ff67cd776812 100644
--- a/fs/autofs/dev-ioctl.c
+++ b/fs/autofs/dev-ioctl.c
@@ -231,32 +231,14 @@ static int test_by_type(const struct path *path, void *p)
*/
static int autofs_dev_ioctl_open_mountpoint(const char *name, dev_t devid)
{
- int err, fd;
-
- fd = get_unused_fd_flags(O_CLOEXEC);
- if (likely(fd >= 0)) {
- struct file *filp;
- struct path path;
-
- err = find_autofs_mount(name, &path, test_by_dev, &devid);
- if (err)
- goto out;
-
- filp = dentry_open(&path, O_RDONLY, current_cred());
- path_put(&path);
- if (IS_ERR(filp)) {
- err = PTR_ERR(filp);
- goto out;
- }
-
- fd_install(fd, filp);
- }
+ struct path path __free(path_put) = {};
+ int err;
- return fd;
+ err = find_autofs_mount(name, &path, test_by_dev, &devid);
+ if (err)
+ return err;
-out:
- put_unused_fd(fd);
- return err;
+ return FD_ADD(O_CLOEXEC, dentry_open(&path, O_RDONLY, current_cred()));
}
/* Open a file descriptor on an autofs mount point */
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 12/47] eventpoll: convert do_epoll_create() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (10 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 11/47] autofs: convert autofs_dev_ioctl_open_mountpoint() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 13/47] open: convert do_sys_openat2() " Christian Brauner
` (35 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/eventpoll.c | 32 ++++++++++----------------------
1 file changed, 10 insertions(+), 22 deletions(-)
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index ee7c4b683ec3..6c36d9dc6926 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -2165,9 +2165,8 @@ static void clear_tfile_check_list(void)
*/
static int do_epoll_create(int flags)
{
- int error, fd;
- struct eventpoll *ep = NULL;
- struct file *file;
+ int error;
+ struct eventpoll *ep;
/* Check the EPOLL_* constant for consistency. */
BUILD_BUG_ON(EPOLL_CLOEXEC != O_CLOEXEC);
@@ -2184,26 +2183,15 @@ static int do_epoll_create(int flags)
* Creates all the items needed to setup an eventpoll file. That is,
* a file structure and a free file descriptor.
*/
- fd = get_unused_fd_flags(O_RDWR | (flags & O_CLOEXEC));
- if (fd < 0) {
- error = fd;
- goto out_free_ep;
- }
- file = anon_inode_getfile("[eventpoll]", &eventpoll_fops, ep,
- O_RDWR | (flags & O_CLOEXEC));
- if (IS_ERR(file)) {
- error = PTR_ERR(file);
- goto out_free_fd;
+ FD_PREPARE(fdf, O_RDWR | (flags & O_CLOEXEC),
+ anon_inode_getfile("[eventpoll]", &eventpoll_fops, ep,
+ O_RDWR | (flags & O_CLOEXEC)));
+ if (fdf.err) {
+ ep_clear_and_put(ep);
+ return fdf.err;
}
- ep->file = file;
- fd_install(fd, file);
- return fd;
-
-out_free_fd:
- put_unused_fd(fd);
-out_free_ep:
- ep_clear_and_put(ep);
- return error;
+ ep->file = fd_prepare_file(fdf);
+ return fd_publish(fdf);
}
SYSCALL_DEFINE1(epoll_create1, int, flags)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 13/47] open: convert do_sys_openat2() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (11 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 12/47] eventpoll: convert do_epoll_create() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 12:20 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 14/47] signalfd: convert do_signalfd4() " Christian Brauner
` (34 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/open.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/fs/open.c b/fs/open.c
index 3d64372ecc67..fa00860f4e4c 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -1421,8 +1421,8 @@ static int do_sys_openat2(int dfd, const char __user *filename,
struct open_how *how)
{
struct open_flags op;
- struct filename *tmp;
- int err, fd;
+ struct filename *tmp __free(putname);
+ int err;
err = build_open_flags(how, &op);
if (unlikely(err))
@@ -1432,18 +1432,7 @@ static int do_sys_openat2(int dfd, const char __user *filename,
if (IS_ERR(tmp))
return PTR_ERR(tmp);
- fd = get_unused_fd_flags(how->flags);
- if (likely(fd >= 0)) {
- struct file *f = do_filp_open(dfd, tmp, &op);
- if (IS_ERR(f)) {
- put_unused_fd(fd);
- fd = PTR_ERR(f);
- } else {
- fd_install(fd, f);
- }
- }
- putname(tmp);
- return fd;
+ return FD_ADD(how->flags, do_filp_open(dfd, tmp, &op));
}
int do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 14/47] signalfd: convert do_signalfd4() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (12 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 13/47] open: convert do_sys_openat2() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 15/47] timerfd: convert timerfd_create() " Christian Brauner
` (33 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/signalfd.c | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/fs/signalfd.c b/fs/signalfd.c
index d469782f97f4..d69eab584bc6 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -250,8 +250,6 @@ static const struct file_operations signalfd_fops = {
static int do_signalfd4(int ufd, sigset_t *mask, int flags)
{
- struct signalfd_ctx *ctx;
-
/* Check the SFD_* constants for consistency. */
BUILD_BUG_ON(SFD_CLOEXEC != O_CLOEXEC);
BUILD_BUG_ON(SFD_NONBLOCK != O_NONBLOCK);
@@ -263,7 +261,8 @@ static int do_signalfd4(int ufd, sigset_t *mask, int flags)
signotset(mask);
if (ufd == -1) {
- struct file *file;
+ int fd;
+ struct signalfd_ctx *ctx __free(kfree) = NULL;
ctx = kmalloc(sizeof(*ctx), GFP_KERNEL);
if (!ctx)
@@ -271,22 +270,16 @@ static int do_signalfd4(int ufd, sigset_t *mask, int flags)
ctx->sigmask = *mask;
- ufd = get_unused_fd_flags(flags & O_CLOEXEC);
- if (ufd < 0) {
- kfree(ctx);
- return ufd;
- }
-
- file = anon_inode_getfile_fmode("[signalfd]", &signalfd_fops,
- ctx, O_RDWR | (flags & O_NONBLOCK),
- FMODE_NOWAIT);
- if (IS_ERR(file)) {
- put_unused_fd(ufd);
- kfree(ctx);
- return PTR_ERR(file);
- }
- fd_install(ufd, file);
+ fd = FD_ADD(flags & O_CLOEXEC,
+ anon_inode_getfile_fmode(
+ "[signalfd]", &signalfd_fops, ctx,
+ O_RDWR | (flags & O_NONBLOCK), FMODE_NOWAIT));
+ if (fd >= 0)
+ retain_and_null_ptr(ctx);
+ return fd;
} else {
+ struct signalfd_ctx *ctx;
+
CLASS(fd, f)(ufd);
if (fd_empty(f))
return -EBADF;
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 15/47] timerfd: convert timerfd_create() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (13 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 14/47] signalfd: convert do_signalfd4() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 16/47] userfaultfd: convert new_userfaultfd() " Christian Brauner
` (32 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/timerfd.c | 29 +++++++++--------------------
1 file changed, 9 insertions(+), 20 deletions(-)
diff --git a/fs/timerfd.c b/fs/timerfd.c
index c68f28d9c426..9fcea7860ddf 100644
--- a/fs/timerfd.c
+++ b/fs/timerfd.c
@@ -393,9 +393,8 @@ static const struct file_operations timerfd_fops = {
SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
{
- int ufd;
- struct timerfd_ctx *ctx;
- struct file *file;
+ struct timerfd_ctx *ctx __free(kfree) = NULL;
+ int ret;
/* Check the TFD_* constants for consistency. */
BUILD_BUG_ON(TFD_CLOEXEC != O_CLOEXEC);
@@ -432,23 +431,13 @@ SYSCALL_DEFINE2(timerfd_create, int, clockid, int, flags)
ctx->moffs = ktime_mono_to_real(0);
- ufd = get_unused_fd_flags(flags & TFD_SHARED_FCNTL_FLAGS);
- if (ufd < 0) {
- kfree(ctx);
- return ufd;
- }
-
- file = anon_inode_getfile_fmode("[timerfd]", &timerfd_fops, ctx,
- O_RDWR | (flags & TFD_SHARED_FCNTL_FLAGS),
- FMODE_NOWAIT);
- if (IS_ERR(file)) {
- put_unused_fd(ufd);
- kfree(ctx);
- return PTR_ERR(file);
- }
-
- fd_install(ufd, file);
- return ufd;
+ ret = FD_ADD(flags & TFD_SHARED_FCNTL_FLAGS,
+ anon_inode_getfile_fmode("[timerfd]", &timerfd_fops, ctx,
+ O_RDWR | (flags & TFD_SHARED_FCNTL_FLAGS),
+ FMODE_NOWAIT));
+ if (ret >= 0)
+ retain_and_null_ptr(ctx);
+ return ret;
}
static int do_timerfd_settime(int ufd, int flags,
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 16/47] userfaultfd: convert new_userfaultfd() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (14 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 15/47] timerfd: convert timerfd_create() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 11:24 ` Mike Rapoport
2025-11-23 16:33 ` [PATCH v4 17/47] xfs: convert xfs_open_by_handle() " Christian Brauner
` (31 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/userfaultfd.c | 30 ++++++++++--------------------
1 file changed, 10 insertions(+), 20 deletions(-)
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
index 54c6cc7fe9c6..e6e74b384087 100644
--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -2111,9 +2111,7 @@ static void init_once_userfaultfd_ctx(void *mem)
static int new_userfaultfd(int flags)
{
- struct userfaultfd_ctx *ctx;
- struct file *file;
- int fd;
+ struct userfaultfd_ctx *ctx __free(kfree) = NULL;
VM_WARN_ON_ONCE(!current->mm);
@@ -2135,26 +2133,18 @@ static int new_userfaultfd(int flags)
atomic_set(&ctx->mmap_changing, 0);
ctx->mm = current->mm;
- fd = get_unused_fd_flags(flags & UFFD_SHARED_FCNTL_FLAGS);
- if (fd < 0)
- goto err_out;
+ FD_PREPARE(fdf, flags & UFFD_SHARED_FCNTL_FLAGS,
+ anon_inode_create_getfile("[userfaultfd]", &userfaultfd_fops, ctx,
+ O_RDONLY | (flags & UFFD_SHARED_FCNTL_FLAGS),
+ NULL));
+ if (fdf.err)
+ return fdf.err;
- /* Create a new inode so that the LSM can block the creation. */
- file = anon_inode_create_getfile("[userfaultfd]", &userfaultfd_fops, ctx,
- O_RDONLY | (flags & UFFD_SHARED_FCNTL_FLAGS), NULL);
- if (IS_ERR(file)) {
- put_unused_fd(fd);
- fd = PTR_ERR(file);
- goto err_out;
- }
/* prevent the mm struct to be freed */
mmgrab(ctx->mm);
- file->f_mode |= FMODE_NOWAIT;
- fd_install(fd, file);
- return fd;
-err_out:
- kmem_cache_free(userfaultfd_ctx_cachep, ctx);
- return fd;
+ fd_prepare_file(fdf)->f_mode |= FMODE_NOWAIT;
+ retain_and_null_ptr(ctx);
+ return fd_publish(fdf);
}
static inline bool userfaultfd_syscall_allowed(int flags)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 17/47] xfs: convert xfs_open_by_handle() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (15 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 16/47] userfaultfd: convert new_userfaultfd() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 18/47] dma: convert dma_buf_fd() " Christian Brauner
` (30 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/xfs/xfs_handle.c | 53 ++++++++++++++++-------------------------------------
1 file changed, 16 insertions(+), 37 deletions(-)
diff --git a/fs/xfs/xfs_handle.c b/fs/xfs/xfs_handle.c
index f19fce557354..e01d5c0b1113 100644
--- a/fs/xfs/xfs_handle.c
+++ b/fs/xfs/xfs_handle.c
@@ -233,14 +233,11 @@ xfs_open_by_handle(
xfs_fsop_handlereq_t *hreq)
{
const struct cred *cred = current_cred();
- int error;
- int fd;
int permflag;
- struct file *filp;
struct inode *inode;
struct dentry *dentry;
fmode_t fmode;
- struct path path;
+ struct path path __free(path_put) = {};
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
@@ -252,8 +249,7 @@ xfs_open_by_handle(
/* Restrict xfs_open_by_handle to directories & regular files. */
if (!(S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode))) {
- error = -EPERM;
- goto out_dput;
+ return -EPERM;
}
#if BITS_PER_LONG != 32
@@ -263,48 +259,31 @@ xfs_open_by_handle(
permflag = hreq->oflags;
fmode = OPEN_FMODE(permflag);
if ((!(permflag & O_APPEND) || (permflag & O_TRUNC)) &&
- (fmode & FMODE_WRITE) && IS_APPEND(inode)) {
- error = -EPERM;
- goto out_dput;
- }
+ (fmode & FMODE_WRITE) && IS_APPEND(inode))
+ return -EPERM;
- if ((fmode & FMODE_WRITE) && IS_IMMUTABLE(inode)) {
- error = -EPERM;
- goto out_dput;
- }
+ if ((fmode & FMODE_WRITE) && IS_IMMUTABLE(inode))
+ return -EPERM;
/* Can't write directories. */
- if (S_ISDIR(inode->i_mode) && (fmode & FMODE_WRITE)) {
- error = -EISDIR;
- goto out_dput;
- }
+ if (S_ISDIR(inode->i_mode) && (fmode & FMODE_WRITE))
+ return -EISDIR;
- fd = get_unused_fd_flags(0);
- if (fd < 0) {
- error = fd;
- goto out_dput;
- }
-
- path.mnt = parfilp->f_path.mnt;
+ path.mnt = mntget(parfilp->f_path.mnt);
path.dentry = dentry;
- filp = dentry_open(&path, hreq->oflags, cred);
- dput(dentry);
- if (IS_ERR(filp)) {
- put_unused_fd(fd);
- return PTR_ERR(filp);
- }
+
+ FD_PREPARE(fdf, 0, dentry_open(&path, hreq->oflags, cred));
+ if (fdf.err)
+ return fdf.err;
if (S_ISREG(inode->i_mode)) {
+ struct file *filp = fd_prepare_file(fdf);
+
filp->f_flags |= O_NOATIME;
filp->f_mode |= FMODE_NOCMTIME;
}
- fd_install(fd, filp);
- return fd;
-
- out_dput:
- dput(dentry);
- return error;
+ return fd_publish(fdf);
}
int
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 18/47] dma: convert dma_buf_fd() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (16 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 17/47] xfs: convert xfs_open_by_handle() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 19/47] af_unix: convert unix_file_open() " Christian Brauner
` (29 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
drivers/dma-buf/dma-buf.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 2bcf9ceca997..edaa9e4ee4ae 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -768,18 +768,10 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_export, "DMA_BUF");
*/
int dma_buf_fd(struct dma_buf *dmabuf, int flags)
{
- int fd;
-
if (!dmabuf || !dmabuf->file)
return -EINVAL;
- fd = get_unused_fd_flags(flags);
- if (fd < 0)
- return fd;
-
- fd_install(fd, dmabuf->file);
-
- return fd;
+ return FD_ADD(flags, dmabuf->file);
}
EXPORT_SYMBOL_NS_GPL(dma_buf_fd, "DMA_BUF");
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 19/47] af_unix: convert unix_file_open() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (17 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 18/47] dma: convert dma_buf_fd() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 20/47] dma: convert sync_file_ioctl_merge() " Christian Brauner
` (28 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
net/unix/af_unix.c | 16 +---------------
1 file changed, 1 insertion(+), 15 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 68c94f49f7b5..6de7909182ee 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -3277,9 +3277,6 @@ EXPORT_SYMBOL_GPL(unix_outq_len);
static int unix_open_file(struct sock *sk)
{
- struct file *f;
- int fd;
-
if (!ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))
return -EPERM;
@@ -3289,18 +3286,7 @@ static int unix_open_file(struct sock *sk)
if (!unix_sk(sk)->path.dentry)
return -ENOENT;
- fd = get_unused_fd_flags(O_CLOEXEC);
- if (fd < 0)
- return fd;
-
- f = dentry_open(&unix_sk(sk)->path, O_PATH, current_cred());
- if (IS_ERR(f)) {
- put_unused_fd(fd);
- return PTR_ERR(f);
- }
-
- fd_install(fd, f);
- return fd;
+ return FD_ADD(O_CLOEXEC, dentry_open(&unix_sk(sk)->path, O_PATH, current_cred()));
}
static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 20/47] dma: convert sync_file_ioctl_merge() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (18 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 19/47] af_unix: convert unix_file_open() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 21/47] exec: convert begin_new_exec() " Christian Brauner
` (27 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
drivers/dma-buf/sync_file.c | 52 +++++++++++++++------------------------------
1 file changed, 17 insertions(+), 35 deletions(-)
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 747e377fb954..dc2e79a1b196 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -213,56 +213,38 @@ static __poll_t sync_file_poll(struct file *file, poll_table *wait)
static long sync_file_ioctl_merge(struct sync_file *sync_file,
unsigned long arg)
{
- int fd = get_unused_fd_flags(O_CLOEXEC);
- int err;
struct sync_file *fence2, *fence3;
struct sync_merge_data data;
- if (fd < 0)
- return fd;
-
- if (copy_from_user(&data, (void __user *)arg, sizeof(data))) {
- err = -EFAULT;
- goto err_put_fd;
- }
+ if (copy_from_user(&data, (void __user *)arg, sizeof(data)))
+ return -EFAULT;
- if (data.flags || data.pad) {
- err = -EINVAL;
- goto err_put_fd;
- }
+ if (data.flags || data.pad)
+ return -EINVAL;
fence2 = sync_file_fdget(data.fd2);
- if (!fence2) {
- err = -ENOENT;
- goto err_put_fd;
- }
+ if (!fence2)
+ return -ENOENT;
data.name[sizeof(data.name) - 1] = '\0';
fence3 = sync_file_merge(data.name, sync_file, fence2);
if (!fence3) {
- err = -ENOMEM;
- goto err_put_fence2;
- }
-
- data.fence = fd;
- if (copy_to_user((void __user *)arg, &data, sizeof(data))) {
- err = -EFAULT;
- goto err_put_fence3;
+ fput(fence2->file);
+ return -ENOMEM;
}
- fd_install(fd, fence3->file);
+ FD_PREPARE(fdf, O_CLOEXEC, fence3->file);
fput(fence2->file);
- return 0;
-
-err_put_fence3:
- fput(fence3->file);
+ if (fdf.err) {
+ fput(fence3->file);
+ return fdf.err;
+ }
-err_put_fence2:
- fput(fence2->file);
+ data.fence = fd_prepare_fd(fdf);
+ if (copy_to_user((void __user *)arg, &data, sizeof(data)))
+ return -EFAULT;
-err_put_fd:
- put_unused_fd(fd);
- return err;
+ return fd_publish(fdf);
}
static int sync_fill_fence_info(struct dma_fence *fence,
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 21/47] exec: convert begin_new_exec() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (19 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 20/47] dma: convert sync_file_ioctl_merge() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 22/47] ipc: convert do_mq_open() " Christian Brauner
` (26 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/exec.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/exec.c b/fs/exec.c
index 4298e7e08d5d..7d9fffb38ee5 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1280,12 +1280,13 @@ int begin_new_exec(struct linux_binprm * bprm)
/* Pass the opened binary to the interpreter. */
if (bprm->have_execfd) {
- retval = get_unused_fd_flags(0);
- if (retval < 0)
+ FD_PREPARE(fdf, 0, bprm->executable);
+ if (fdf.err) {
+ retval = fdf.err;
goto out_unlock;
- fd_install(retval, bprm->executable);
+ }
bprm->executable = NULL;
- bprm->execfd = retval;
+ bprm->execfd = fd_publish(fdf);
}
return 0;
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 22/47] ipc: convert do_mq_open() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (20 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 21/47] exec: convert begin_new_exec() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 22:30 ` Mark Brown
2025-11-23 16:33 ` [PATCH v4 23/47] bpf: convert bpf_iter_new_fd() " Christian Brauner
` (25 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
ipc/mqueue.c | 31 +++++++++----------------------
1 file changed, 9 insertions(+), 22 deletions(-)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 093551fe66a7..8b9b53db67a2 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -899,7 +899,7 @@ static int do_mq_open(const char __user *u_name, int oflag, umode_t mode,
struct dentry *root = mnt->mnt_root;
struct filename *name;
struct path path;
- int fd, error;
+ int ret;
int ro;
audit_mq_open(oflag, mode, attr);
@@ -908,38 +908,25 @@ static int do_mq_open(const char __user *u_name, int oflag, umode_t mode,
if (IS_ERR(name))
return PTR_ERR(name);
- fd = get_unused_fd_flags(O_CLOEXEC);
- if (fd < 0)
- goto out_putname;
-
ro = mnt_want_write(mnt); /* we'll drop it in any case */
inode_lock(d_inode(root));
path.dentry = lookup_noperm(&QSTR(name->name), root);
if (IS_ERR(path.dentry)) {
- error = PTR_ERR(path.dentry);
- goto out_putfd;
+ ret = PTR_ERR(path.dentry);
+ goto out_unlock;
}
path.mnt = mntget(mnt);
- error = prepare_open(path.dentry, oflag, ro, mode, name, attr);
- if (!error) {
- struct file *file = dentry_open(&path, oflag, current_cred());
- if (!IS_ERR(file))
- fd_install(fd, file);
- else
- error = PTR_ERR(file);
- }
+ ret = prepare_open(path.dentry, oflag, ro, mode, name, attr);
+ if (!ret)
+ ret = FD_ADD(O_CLOEXEC, dentry_open(&path, oflag, current_cred()));
path_put(&path);
-out_putfd:
- if (error) {
- put_unused_fd(fd);
- fd = error;
- }
+
+out_unlock:
inode_unlock(d_inode(root));
if (!ro)
mnt_drop_write(mnt);
-out_putname:
putname(name);
- return fd;
+ return ret;
}
SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, umode_t, mode,
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 23/47] bpf: convert bpf_iter_new_fd() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (21 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 22/47] ipc: convert do_mq_open() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 24/47] bpf: convert bpf_token_create() " Christian Brauner
` (24 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
kernel/bpf/bpf_iter.c | 29 ++++++++---------------------
1 file changed, 8 insertions(+), 21 deletions(-)
diff --git a/kernel/bpf/bpf_iter.c b/kernel/bpf/bpf_iter.c
index 6ac35430c573..eec60b57bd3d 100644
--- a/kernel/bpf/bpf_iter.c
+++ b/kernel/bpf/bpf_iter.c
@@ -634,37 +634,24 @@ static int prepare_seq_file(struct file *file, struct bpf_iter_link *link)
int bpf_iter_new_fd(struct bpf_link *link)
{
struct bpf_iter_link *iter_link;
- struct file *file;
unsigned int flags;
- int err, fd;
+ int err;
if (link->ops != &bpf_iter_link_lops)
return -EINVAL;
flags = O_RDONLY | O_CLOEXEC;
- fd = get_unused_fd_flags(flags);
- if (fd < 0)
- return fd;
-
- file = anon_inode_getfile("bpf_iter", &bpf_iter_fops, NULL, flags);
- if (IS_ERR(file)) {
- err = PTR_ERR(file);
- goto free_fd;
- }
+
+ FD_PREPARE(fdf, flags, anon_inode_getfile("bpf_iter", &bpf_iter_fops, NULL, flags));
+ if (fdf.err)
+ return fdf.err;
iter_link = container_of(link, struct bpf_iter_link, link);
- err = prepare_seq_file(file, iter_link);
+ err = prepare_seq_file(fd_prepare_file(fdf), iter_link);
if (err)
- goto free_file;
+ return err; /* Automatic cleanup handles fput */
- fd_install(fd, file);
- return fd;
-
-free_file:
- fput(file);
-free_fd:
- put_unused_fd(fd);
- return err;
+ return fd_publish(fdf);
}
struct bpf_prog *bpf_iter_get_info(struct bpf_iter_meta *meta, bool in_stop)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 24/47] bpf: convert bpf_token_create() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (22 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 23/47] bpf: convert bpf_iter_new_fd() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 25/47] memfd: convert memfd_create() " Christian Brauner
` (23 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
kernel/bpf/token.c | 47 +++++++++++++++--------------------------------
1 file changed, 15 insertions(+), 32 deletions(-)
diff --git a/kernel/bpf/token.c b/kernel/bpf/token.c
index 0bbe412f854e..feecd8f4dbf9 100644
--- a/kernel/bpf/token.c
+++ b/kernel/bpf/token.c
@@ -110,16 +110,15 @@ const struct file_operations bpf_token_fops = {
int bpf_token_create(union bpf_attr *attr)
{
+ struct bpf_token *token __free(kfree) = NULL;
struct bpf_mount_opts *mnt_opts;
- struct bpf_token *token = NULL;
struct user_namespace *userns;
struct inode *inode;
- struct file *file;
CLASS(fd, f)(attr->token_create.bpffs_fd);
struct path path;
struct super_block *sb;
umode_t mode;
- int err, fd;
+ int err;
if (fd_empty(f))
return -EBADF;
@@ -166,23 +165,20 @@ int bpf_token_create(union bpf_attr *attr)
inode->i_fop = &bpf_token_fops;
clear_nlink(inode); /* make sure it is unlinked */
- file = alloc_file_pseudo(inode, path.mnt, BPF_TOKEN_INODE_NAME, O_RDWR, &bpf_token_fops);
- if (IS_ERR(file)) {
- iput(inode);
- return PTR_ERR(file);
- }
+ FD_PREPARE(fdf, O_CLOEXEC,
+ alloc_file_pseudo(inode, path.mnt, BPF_TOKEN_INODE_NAME,
+ O_RDWR, &bpf_token_fops));
+ if (fdf.err)
+ return fdf.err;
token = kzalloc(sizeof(*token), GFP_USER);
- if (!token) {
- err = -ENOMEM;
- goto out_file;
- }
+ if (!token)
+ return -ENOMEM;
atomic64_set(&token->refcnt, 1);
- /* remember bpffs owning userns for future ns_capable() checks */
- token->userns = get_user_ns(userns);
-
+ /* remember bpffs owning userns for future ns_capable() checks. */
+ token->userns = userns;
token->allowed_cmds = mnt_opts->delegate_cmds;
token->allowed_maps = mnt_opts->delegate_maps;
token->allowed_progs = mnt_opts->delegate_progs;
@@ -190,24 +186,11 @@ int bpf_token_create(union bpf_attr *attr)
err = security_bpf_token_create(token, attr, &path);
if (err)
- goto out_token;
-
- fd = get_unused_fd_flags(O_CLOEXEC);
- if (fd < 0) {
- err = fd;
- goto out_token;
- }
-
- file->private_data = token;
- fd_install(fd, file);
-
- return fd;
+ return err;
-out_token:
- bpf_token_free(token);
-out_file:
- fput(file);
- return err;
+ get_user_ns(token->userns);
+ fd_prepare_file(fdf)->private_data = no_free_ptr(token);
+ return fd_publish(fdf);
}
int bpf_token_get_info_by_fd(struct bpf_token *token,
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 25/47] memfd: convert memfd_create() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (23 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 24/47] bpf: convert bpf_token_create() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 11:30 ` Mike Rapoport
2025-11-23 16:33 ` [PATCH v4 26/47] secretmem: convert memfd_secret() " Christian Brauner
` (22 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
mm/memfd.c | 29 +++++------------------------
1 file changed, 5 insertions(+), 24 deletions(-)
diff --git a/mm/memfd.c b/mm/memfd.c
index 1d109c1acf21..2a6614b7c4ea 100644
--- a/mm/memfd.c
+++ b/mm/memfd.c
@@ -470,9 +470,9 @@ SYSCALL_DEFINE2(memfd_create,
const char __user *, uname,
unsigned int, flags)
{
- struct file *file;
- int fd, error;
- char *name;
+ char *name __free(kfree) = NULL;
+ unsigned int fd_flags;
+ int error;
error = sanitize_flags(&flags);
if (error < 0)
@@ -482,25 +482,6 @@ SYSCALL_DEFINE2(memfd_create,
if (IS_ERR(name))
return PTR_ERR(name);
- fd = get_unused_fd_flags((flags & MFD_CLOEXEC) ? O_CLOEXEC : 0);
- if (fd < 0) {
- error = fd;
- goto err_free_name;
- }
-
- file = alloc_file(name, flags);
- if (IS_ERR(file)) {
- error = PTR_ERR(file);
- goto err_free_fd;
- }
-
- fd_install(fd, file);
- kfree(name);
- return fd;
-
-err_free_fd:
- put_unused_fd(fd);
-err_free_name:
- kfree(name);
- return error;
+ fd_flags = (flags & MFD_CLOEXEC) ? O_CLOEXEC : 0;
+ return FD_ADD(fd_flags, alloc_file(name, flags));
}
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 26/47] secretmem: convert memfd_secret() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (24 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 25/47] memfd: convert memfd_create() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-25 11:21 ` Mike Rapoport
2025-11-23 16:33 ` [PATCH v4 27/47] net/handshake: convert handshake_nl_accept_doit() " Christian Brauner
` (21 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
mm/secretmem.c | 20 +-------------------
1 file changed, 1 insertion(+), 19 deletions(-)
diff --git a/mm/secretmem.c b/mm/secretmem.c
index 60137305bc20..eb950f8193c9 100644
--- a/mm/secretmem.c
+++ b/mm/secretmem.c
@@ -224,9 +224,6 @@ static struct file *secretmem_file_create(unsigned long flags)
SYSCALL_DEFINE1(memfd_secret, unsigned int, flags)
{
- struct file *file;
- int fd, err;
-
/* make sure local flags do not confict with global fcntl.h */
BUILD_BUG_ON(SECRETMEM_FLAGS_MASK & O_CLOEXEC);
@@ -238,22 +235,7 @@ SYSCALL_DEFINE1(memfd_secret, unsigned int, flags)
if (atomic_read(&secretmem_users) < 0)
return -ENFILE;
- fd = get_unused_fd_flags(flags & O_CLOEXEC);
- if (fd < 0)
- return fd;
-
- file = secretmem_file_create(flags);
- if (IS_ERR(file)) {
- err = PTR_ERR(file);
- goto err_put_fd;
- }
-
- fd_install(fd, file);
- return fd;
-
-err_put_fd:
- put_unused_fd(fd);
- return err;
+ return FD_ADD(flags & O_CLOEXEC, secretmem_file_create(flags));
}
static int secretmem_init_fs_context(struct fs_context *fc)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 27/47] net/handshake: convert handshake_nl_accept_doit() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (25 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 26/47] secretmem: convert memfd_secret() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 28/47] net/kcm: convert kcm_ioctl() " Christian Brauner
` (20 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
net/handshake/netlink.c | 37 +++++++++++++++++--------------------
1 file changed, 17 insertions(+), 20 deletions(-)
diff --git a/net/handshake/netlink.c b/net/handshake/netlink.c
index 7e46d130dce2..7a26f9010277 100644
--- a/net/handshake/netlink.c
+++ b/net/handshake/netlink.c
@@ -93,7 +93,7 @@ int handshake_nl_accept_doit(struct sk_buff *skb, struct genl_info *info)
struct handshake_net *hn = handshake_pernet(net);
struct handshake_req *req = NULL;
struct socket *sock;
- int class, fd, err;
+ int class, err;
err = -EOPNOTSUPP;
if (!hn)
@@ -106,27 +106,24 @@ int handshake_nl_accept_doit(struct sk_buff *skb, struct genl_info *info)
err = -EAGAIN;
req = handshake_req_next(hn, class);
- if (!req)
- goto out_status;
-
- sock = req->hr_sk->sk_socket;
- fd = get_unused_fd_flags(O_CLOEXEC);
- if (fd < 0) {
- err = fd;
- goto out_complete;
- }
-
- err = req->hr_proto->hp_accept(req, info, fd);
- if (err) {
- put_unused_fd(fd);
- goto out_complete;
+ if (req) {
+ sock = req->hr_sk->sk_socket;
+
+ FD_PREPARE(fdf, O_CLOEXEC, sock->file);
+ if (fdf.err) {
+ err = fdf.err;
+ goto out_complete;
+ }
+
+ get_file(sock->file); /* FD_PREPARE() consumes a reference. */
+ err = req->hr_proto->hp_accept(req, info, fd_prepare_fd(fdf));
+ if (err)
+ goto out_complete; /* Automatic cleanup handles fput */
+
+ trace_handshake_cmd_accept(net, req, req->hr_sk, fd_prepare_fd(fdf));
+ return fd_publish(fdf);
}
- fd_install(fd, get_file(sock->file));
-
- trace_handshake_cmd_accept(net, req, req->hr_sk, fd);
- return 0;
-
out_complete:
handshake_complete(req, -EIO, NULL);
out_status:
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 28/47] net/kcm: convert kcm_ioctl() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (26 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 27/47] net/handshake: convert handshake_nl_accept_doit() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 29/47] net/sctp: convert sctp_getsockopt_peeloff_common() " Christian Brauner
` (19 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
net/kcm/kcmsock.c | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)
diff --git a/net/kcm/kcmsock.c b/net/kcm/kcmsock.c
index b4f01cb07561..7ce5f492df14 100644
--- a/net/kcm/kcmsock.c
+++ b/net/kcm/kcmsock.c
@@ -1560,25 +1560,16 @@ static int kcm_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
}
case SIOCKCMCLONE: {
struct kcm_clone info;
- struct file *file;
- info.fd = get_unused_fd_flags(0);
- if (unlikely(info.fd < 0))
- return info.fd;
+ FD_PREPARE(fdf, 0, kcm_clone(sock));
+ if (fdf.err)
+ return fdf.err;
- file = kcm_clone(sock);
- if (IS_ERR(file)) {
- put_unused_fd(info.fd);
- return PTR_ERR(file);
- }
- if (copy_to_user((void __user *)arg, &info,
- sizeof(info))) {
- put_unused_fd(info.fd);
- fput(file);
+ info.fd = fd_prepare_fd(fdf);
+ if (copy_to_user((void __user *)arg, &info, sizeof(info)))
return -EFAULT;
- }
- fd_install(info.fd, file);
- err = 0;
+
+ err = fd_publish(fdf);
break;
}
default:
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 29/47] net/sctp: convert sctp_getsockopt_peeloff_common() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (27 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 28/47] net/kcm: convert kcm_ioctl() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 30/47] net/socket: convert sock_map_fd() " Christian Brauner
` (18 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
net/sctp/socket.c | 90 ++++++++++++++++---------------------------------------
1 file changed, 25 insertions(+), 65 deletions(-)
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index ed8293a34240..206f9b7e648e 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -5664,47 +5664,45 @@ static int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id,
return err;
}
-static int sctp_getsockopt_peeloff_common(struct sock *sk, sctp_peeloff_arg_t *peeloff,
- struct file **newfile, unsigned flags)
+static int sctp_getsockopt_peeloff_common(struct sock *sk,
+ sctp_peeloff_arg_t *peeloff, int len,
+ char __user *optval,
+ int __user *optlen, unsigned flags)
{
struct socket *newsock;
int retval;
retval = sctp_do_peeloff(sk, peeloff->associd, &newsock);
if (retval < 0)
- goto out;
+ return retval;
- /* Map the socket to an unused fd that can be returned to the user. */
- retval = get_unused_fd_flags(flags & SOCK_CLOEXEC);
- if (retval < 0) {
+ FD_PREPARE(fdf, flags & SOCK_CLOEXEC, sock_alloc_file(newsock, 0, NULL));
+ if (fdf.err) {
sock_release(newsock);
- goto out;
- }
-
- *newfile = sock_alloc_file(newsock, 0, NULL);
- if (IS_ERR(*newfile)) {
- put_unused_fd(retval);
- retval = PTR_ERR(*newfile);
- *newfile = NULL;
- return retval;
+ return fdf.err;
}
pr_debug("%s: sk:%p, newsk:%p, sd:%d\n", __func__, sk, newsock->sk,
- retval);
-
- peeloff->sd = retval;
+ fd_prepare_fd(fdf));
if (flags & SOCK_NONBLOCK)
- (*newfile)->f_flags |= O_NONBLOCK;
-out:
- return retval;
+ fd_prepare_file(fdf)->f_flags |= O_NONBLOCK;
+
+ /* Return the fd mapped to the new socket. */
+ if (put_user(len, optlen))
+ return -EFAULT;
+
+ if (copy_to_user(optval, &peeloff, len))
+ return -EFAULT;
+
+ peeloff->sd = fd_prepare_fd(fdf);
+ return fd_publish(fdf);
}
-static int sctp_getsockopt_peeloff(struct sock *sk, int len, char __user *optval, int __user *optlen)
+static int sctp_getsockopt_peeloff(struct sock *sk, int len,
+ char __user *optval, int __user *optlen)
{
sctp_peeloff_arg_t peeloff;
- struct file *newfile = NULL;
- int retval = 0;
if (len < sizeof(sctp_peeloff_arg_t))
return -EINVAL;
@@ -5712,33 +5710,13 @@ static int sctp_getsockopt_peeloff(struct sock *sk, int len, char __user *optval
if (copy_from_user(&peeloff, optval, len))
return -EFAULT;
- retval = sctp_getsockopt_peeloff_common(sk, &peeloff, &newfile, 0);
- if (retval < 0)
- goto out;
-
- /* Return the fd mapped to the new socket. */
- if (put_user(len, optlen)) {
- fput(newfile);
- put_unused_fd(retval);
- return -EFAULT;
- }
-
- if (copy_to_user(optval, &peeloff, len)) {
- fput(newfile);
- put_unused_fd(retval);
- return -EFAULT;
- }
- fd_install(retval, newfile);
-out:
- return retval;
+ return sctp_getsockopt_peeloff_common(sk, &peeloff, len, optval, optlen, 0);
}
static int sctp_getsockopt_peeloff_flags(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
sctp_peeloff_flags_arg_t peeloff;
- struct file *newfile = NULL;
- int retval = 0;
if (len < sizeof(sctp_peeloff_flags_arg_t))
return -EINVAL;
@@ -5746,26 +5724,8 @@ static int sctp_getsockopt_peeloff_flags(struct sock *sk, int len,
if (copy_from_user(&peeloff, optval, len))
return -EFAULT;
- retval = sctp_getsockopt_peeloff_common(sk, &peeloff.p_arg,
- &newfile, peeloff.flags);
- if (retval < 0)
- goto out;
-
- /* Return the fd mapped to the new socket. */
- if (put_user(len, optlen)) {
- fput(newfile);
- put_unused_fd(retval);
- return -EFAULT;
- }
-
- if (copy_to_user(optval, &peeloff, len)) {
- fput(newfile);
- put_unused_fd(retval);
- return -EFAULT;
- }
- fd_install(retval, newfile);
-out:
- return retval;
+ return sctp_getsockopt_peeloff_common(sk, &peeloff.p_arg, len, optval,
+ optlen, peeloff.flags);
}
/* 7.1.13 Peer Address Parameters (SCTP_PEER_ADDR_PARAMS)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 30/47] net/socket: convert sock_map_fd() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (28 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 29/47] net/sctp: convert sctp_getsockopt_peeloff_common() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 31/47] net/socket: convert __sys_accept4_file() " Christian Brauner
` (17 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
net/socket.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/net/socket.c b/net/socket.c
index e8892b218708..db2065051d33 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -503,21 +503,12 @@ EXPORT_SYMBOL(sock_alloc_file);
static int sock_map_fd(struct socket *sock, int flags)
{
- struct file *newfile;
- int fd = get_unused_fd_flags(flags);
- if (unlikely(fd < 0)) {
- sock_release(sock);
- return fd;
- }
+ int fd;
- newfile = sock_alloc_file(sock, flags, NULL);
- if (!IS_ERR(newfile)) {
- fd_install(fd, newfile);
- return fd;
- }
-
- put_unused_fd(fd);
- return PTR_ERR(newfile);
+ fd = FD_ADD(flags, sock_alloc_file(sock, flags, NULL));
+ if (fd < 0)
+ sock_release(sock);
+ return fd;
}
/**
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 31/47] net/socket: convert __sys_accept4_file() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (29 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 30/47] net/socket: convert sock_map_fd() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 32/47] spufs: convert spufs_context_open() " Christian Brauner
` (16 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
net/socket.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/net/socket.c b/net/socket.c
index db2065051d33..e1bf93508f05 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2003,8 +2003,6 @@ static int __sys_accept4_file(struct file *file, struct sockaddr __user *upeer_s
int __user *upeer_addrlen, int flags)
{
struct proto_accept_arg arg = { };
- struct file *newfile;
- int newfd;
if (flags & ~(SOCK_CLOEXEC | SOCK_NONBLOCK))
return -EINVAL;
@@ -2012,18 +2010,7 @@ static int __sys_accept4_file(struct file *file, struct sockaddr __user *upeer_s
if (SOCK_NONBLOCK != O_NONBLOCK && (flags & SOCK_NONBLOCK))
flags = (flags & ~SOCK_NONBLOCK) | O_NONBLOCK;
- newfd = get_unused_fd_flags(flags);
- if (unlikely(newfd < 0))
- return newfd;
-
- newfile = do_accept(file, &arg, upeer_sockaddr, upeer_addrlen,
- flags);
- if (IS_ERR(newfile)) {
- put_unused_fd(newfd);
- return PTR_ERR(newfile);
- }
- fd_install(newfd, newfile);
- return newfd;
+ return FD_ADD(flags, do_accept(file, &arg, upeer_sockaddr, upeer_addrlen, flags));
}
/*
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 32/47] spufs: convert spufs_context_open() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (30 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 31/47] net/socket: convert __sys_accept4_file() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 33/47] papr-hvpipe: convert papr_hvpipe_dev_create_handle() " Christian Brauner
` (15 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
arch/powerpc/platforms/cell/spufs/inode.c | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 7ec60290abe6..195322393709 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -267,22 +267,11 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags,
static int spufs_context_open(const struct path *path)
{
- int ret;
- struct file *filp;
-
- ret = get_unused_fd_flags(0);
- if (ret < 0)
- return ret;
-
- filp = dentry_open(path, O_RDONLY, current_cred());
- if (IS_ERR(filp)) {
- put_unused_fd(ret);
- return PTR_ERR(filp);
- }
-
- filp->f_op = &spufs_context_fops;
- fd_install(ret, filp);
- return ret;
+ FD_PREPARE(fdf, 0, dentry_open(path, O_RDONLY, current_cred()));
+ if (fdf.err)
+ return fdf.err;
+ fd_prepare_file(fdf)->f_op = &spufs_context_fops;
+ return fd_publish(fdf);
}
static struct spu_context *
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 33/47] papr-hvpipe: convert papr_hvpipe_dev_create_handle() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (31 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 32/47] spufs: convert spufs_context_open() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 34/47] spufs: convert spufs_gang_open() " Christian Brauner
` (14 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Fixes a UAF for src_info as well.
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
arch/powerpc/platforms/pseries/papr-hvpipe.c | 39 +++++++---------------------
1 file changed, 9 insertions(+), 30 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/papr-hvpipe.c b/arch/powerpc/platforms/pseries/papr-hvpipe.c
index 21a2f447c43f..dd7b668799d9 100644
--- a/arch/powerpc/platforms/pseries/papr-hvpipe.c
+++ b/arch/powerpc/platforms/pseries/papr-hvpipe.c
@@ -479,10 +479,7 @@ static const struct file_operations papr_hvpipe_handle_ops = {
static int papr_hvpipe_dev_create_handle(u32 srcID)
{
- struct hvpipe_source_info *src_info;
- struct file *file;
- long err;
- int fd;
+ struct hvpipe_source_info *src_info __free(kfree) = NULL;
spin_lock(&hvpipe_src_list_lock);
/*
@@ -506,20 +503,13 @@ static int papr_hvpipe_dev_create_handle(u32 srcID)
src_info->tsk = current;
init_waitqueue_head(&src_info->recv_wqh);
- fd = get_unused_fd_flags(O_RDONLY | O_CLOEXEC);
- if (fd < 0) {
- err = fd;
- goto free_buf;
- }
-
- file = anon_inode_getfile("[papr-hvpipe]",
- &papr_hvpipe_handle_ops, (void *)src_info,
- O_RDWR);
- if (IS_ERR(file)) {
- err = PTR_ERR(file);
- goto free_fd;
- }
+ FD_PREPARE(fdf, O_RDONLY | O_CLOEXEC,
+ anon_inode_getfile("[papr-hvpipe]", &papr_hvpipe_handle_ops,
+ (void *)src_info, O_RDWR));
+ if (fdf.err)
+ return fdf.err;
+ retain_and_null_ptr(src_info);
spin_lock(&hvpipe_src_list_lock);
/*
* If two processes are executing ioctl() for the same
@@ -528,22 +518,11 @@ static int papr_hvpipe_dev_create_handle(u32 srcID)
*/
if (hvpipe_find_source(srcID)) {
spin_unlock(&hvpipe_src_list_lock);
- err = -EALREADY;
- goto free_file;
+ return -EALREADY;
}
list_add(&src_info->list, &hvpipe_src_list);
spin_unlock(&hvpipe_src_list_lock);
-
- fd_install(fd, file);
- return fd;
-
-free_file:
- fput(file);
-free_fd:
- put_unused_fd(fd);
-free_buf:
- kfree(src_info);
- return err;
+ return fd_publish(fdf);
}
/*
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 34/47] spufs: convert spufs_gang_open() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (32 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 33/47] papr-hvpipe: convert papr_hvpipe_dev_create_handle() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 35/47] pseries: convert papr_platform_dump_create_handle() " Christian Brauner
` (13 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
arch/powerpc/platforms/cell/spufs/inode.c | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 195322393709..78c4b6ce5f13 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -497,26 +497,15 @@ static const struct file_operations spufs_gang_fops = {
static int spufs_gang_open(const struct path *path)
{
- int ret;
- struct file *filp;
-
- ret = get_unused_fd_flags(0);
- if (ret < 0)
- return ret;
-
/*
* get references for dget and mntget, will be released
* in error path of *_open().
*/
- filp = dentry_open(path, O_RDONLY, current_cred());
- if (IS_ERR(filp)) {
- put_unused_fd(ret);
- return PTR_ERR(filp);
- }
-
- filp->f_op = &spufs_gang_fops;
- fd_install(ret, filp);
- return ret;
+ FD_PREPARE(fdf, 0, dentry_open(path, O_RDONLY, current_cred()));
+ if (fdf.err)
+ return fdf.err;
+ fd_prepare_file(fdf)->f_op = &spufs_gang_fops;
+ return fd_publish(fdf);
}
static int spufs_create_gang(struct inode *inode,
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 35/47] pseries: convert papr_platform_dump_create_handle() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (33 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 34/47] spufs: convert spufs_gang_open() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 36/47] pseries: port papr_rtas_setup_file_interface() " Christian Brauner
` (12 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
.../powerpc/platforms/pseries/papr-platform-dump.c | 32 ++++++----------------
1 file changed, 9 insertions(+), 23 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/papr-platform-dump.c b/arch/powerpc/platforms/pseries/papr-platform-dump.c
index f8d55eccdb6b..3f60e89be714 100644
--- a/arch/powerpc/platforms/pseries/papr-platform-dump.c
+++ b/arch/powerpc/platforms/pseries/papr-platform-dump.c
@@ -301,10 +301,8 @@ static const struct file_operations papr_platform_dump_handle_ops = {
*/
static long papr_platform_dump_create_handle(u64 dump_tag)
{
- struct ibm_platform_dump_params *params;
+ struct ibm_platform_dump_params *params, *tmp;
u64 param_dump_tag;
- struct file *file;
- long err;
int fd;
/*
@@ -334,34 +332,22 @@ static long papr_platform_dump_create_handle(u64 dump_tag)
params->dump_tag_lo = (u32)(dump_tag & 0x00000000ffffffffULL);
params->status = RTAS_IBM_PLATFORM_DUMP_START;
- fd = get_unused_fd_flags(O_RDONLY | O_CLOEXEC);
+ fd = FD_ADD(O_RDONLY | O_CLOEXEC,
+ anon_inode_getfile_fmode("[papr-platform-dump]",
+ &papr_platform_dump_handle_ops,
+ (void *)params, O_RDONLY,
+ FMODE_LSEEK | FMODE_PREAD));
if (fd < 0) {
- err = fd;
- goto free_area;
- }
-
- file = anon_inode_getfile_fmode("[papr-platform-dump]",
- &papr_platform_dump_handle_ops,
- (void *)params, O_RDONLY,
- FMODE_LSEEK | FMODE_PREAD);
- if (IS_ERR(file)) {
- err = PTR_ERR(file);
- goto put_fd;
+ rtas_work_area_free(params->work_area);
+ kfree(params);
+ return fd;
}
- fd_install(fd, file);
-
list_add(¶ms->list, &platform_dump_list);
pr_info("%s (%d) initiated platform dump for dump tag %llu\n",
current->comm, current->pid, dump_tag);
return fd;
-put_fd:
- put_unused_fd(fd);
-free_area:
- rtas_work_area_free(params->work_area);
- kfree(params);
- return err;
}
/*
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 36/47] pseries: port papr_rtas_setup_file_interface() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (34 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 35/47] pseries: convert papr_platform_dump_create_handle() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 37/47] dma: port sw_sync_ioctl_create_fence() " Christian Brauner
` (11 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
arch/powerpc/platforms/pseries/papr-rtas-common.c | 27 +++++------------------
1 file changed, 5 insertions(+), 22 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/papr-rtas-common.c b/arch/powerpc/platforms/pseries/papr-rtas-common.c
index 33c606e3378a..1630e0cd210c 100644
--- a/arch/powerpc/platforms/pseries/papr-rtas-common.c
+++ b/arch/powerpc/platforms/pseries/papr-rtas-common.c
@@ -205,35 +205,18 @@ long papr_rtas_setup_file_interface(struct papr_rtas_sequence *seq,
char *name)
{
const struct papr_rtas_blob *blob;
- struct file *file;
- long ret;
int fd;
blob = papr_rtas_retrieve(seq);
if (IS_ERR(blob))
return PTR_ERR(blob);
- fd = get_unused_fd_flags(O_RDONLY | O_CLOEXEC);
- if (fd < 0) {
- ret = fd;
- goto free_blob;
- }
-
- file = anon_inode_getfile_fmode(name, fops, (void *)blob,
- O_RDONLY, FMODE_LSEEK | FMODE_PREAD);
- if (IS_ERR(file)) {
- ret = PTR_ERR(file);
- goto put_fd;
- }
-
- fd_install(fd, file);
+ fd = FD_ADD(O_RDONLY | O_CLOEXEC,
+ anon_inode_getfile_fmode(name, fops, (void *)blob, O_RDONLY,
+ FMODE_LSEEK | FMODE_PREAD));
+ if (fd < 0)
+ papr_rtas_blob_free(blob);
return fd;
-
-put_fd:
- put_unused_fd(fd);
-free_blob:
- papr_rtas_blob_free(blob);
- return ret;
}
/*
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 37/47] dma: port sw_sync_ioctl_create_fence() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (35 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 36/47] pseries: port papr_rtas_setup_file_interface() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 38/47] gpio: convert linehandle_create() " Christian Brauner
` (10 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
drivers/dma-buf/sw_sync.c | 40 +++++++++++++---------------------------
1 file changed, 13 insertions(+), 27 deletions(-)
diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index 3c20f1d31cf5..f100a13fdc00 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -343,47 +343,33 @@ static int sw_sync_debugfs_release(struct inode *inode, struct file *file)
static long sw_sync_ioctl_create_fence(struct sync_timeline *obj,
unsigned long arg)
{
- int fd = get_unused_fd_flags(O_CLOEXEC);
- int err;
struct sync_pt *pt;
struct sync_file *sync_file;
struct sw_sync_create_fence_data data;
- if (fd < 0)
- return fd;
-
- if (copy_from_user(&data, (void __user *)arg, sizeof(data))) {
- err = -EFAULT;
- goto err;
- }
+ if (copy_from_user(&data, (void __user *)arg, sizeof(data)))
+ return -EFAULT;
pt = sync_pt_create(obj, data.value);
- if (!pt) {
- err = -ENOMEM;
- goto err;
- }
+ if (!pt)
+ return -ENOMEM;
sync_file = sync_file_create(&pt->base);
dma_fence_put(&pt->base);
- if (!sync_file) {
- err = -ENOMEM;
- goto err;
- }
+ if (!sync_file)
+ return -ENOMEM;
- data.fence = fd;
- if (copy_to_user((void __user *)arg, &data, sizeof(data))) {
+ FD_PREPARE(fdf, O_CLOEXEC, sync_file->file);
+ if (fdf.err) {
fput(sync_file->file);
- err = -EFAULT;
- goto err;
+ return fdf.err;
}
- fd_install(fd, sync_file->file);
-
- return 0;
+ data.fence = fd_prepare_fd(fdf);
+ if (copy_to_user((void __user *)arg, &data, sizeof(data)))
+ return -EFAULT;
-err:
- put_unused_fd(fd);
- return err;
+ return fd_publish(fdf);
}
static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 38/47] gpio: convert linehandle_create() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (36 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 37/47] dma: port sw_sync_ioctl_create_fence() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 39/47] hv: convert mshv_ioctl_create_partition() " Christian Brauner
` (9 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
drivers/gpio/gpiolib-cdev.c | 58 +++++++++++++++++++--------------------------
1 file changed, 24 insertions(+), 34 deletions(-)
diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c
index 175836467f21..d24cae0c0022 100644
--- a/drivers/gpio/gpiolib-cdev.c
+++ b/drivers/gpio/gpiolib-cdev.c
@@ -298,12 +298,32 @@ static const struct file_operations linehandle_fileops = {
#endif
};
+static int linehandle_fd_create(struct gpio_device *gdev,
+ struct linehandle_state *lh,
+ struct gpiohandle_request *handlereq,
+ void __user *ip)
+{
+ FD_PREPARE(fdf, O_RDONLY | O_CLOEXEC,
+ anon_inode_getfile("gpio-linehandle", &linehandle_fileops,
+ lh, O_RDONLY | O_CLOEXEC));
+ if (fdf.err)
+ return fdf.err;
+
+ handlereq->fd = fd_prepare_fd(fdf);
+ if (copy_to_user(ip, handlereq, sizeof(*handlereq)))
+ return -EFAULT;
+
+ dev_dbg(&gdev->dev, "registered chardev handle for %d lines\n", lh->num_descs);
+
+ fd_publish(fdf);
+ return 0;
+}
+
static int linehandle_create(struct gpio_device *gdev, void __user *ip)
{
struct gpiohandle_request handlereq;
struct linehandle_state *lh;
- struct file *file;
- int fd, i, ret;
+ int i, ret;
u32 lflags;
if (copy_from_user(&handlereq, ip, sizeof(handlereq)))
@@ -377,41 +397,11 @@ static int linehandle_create(struct gpio_device *gdev, void __user *ip)
offset);
}
- fd = get_unused_fd_flags(O_RDONLY | O_CLOEXEC);
- if (fd < 0) {
- ret = fd;
+ ret = linehandle_fd_create(gdev, lh, &handlereq, ip);
+ if (ret)
goto out_free_lh;
- }
-
- file = anon_inode_getfile("gpio-linehandle",
- &linehandle_fileops,
- lh,
- O_RDONLY | O_CLOEXEC);
- if (IS_ERR(file)) {
- ret = PTR_ERR(file);
- goto out_put_unused_fd;
- }
-
- handlereq.fd = fd;
- if (copy_to_user(ip, &handlereq, sizeof(handlereq))) {
- /*
- * fput() will trigger the release() callback, so do not go onto
- * the regular error cleanup path here.
- */
- fput(file);
- put_unused_fd(fd);
- return -EFAULT;
- }
-
- fd_install(fd, file);
-
- dev_dbg(&gdev->dev, "registered chardev handle for %d lines\n",
- lh->num_descs);
-
return 0;
-out_put_unused_fd:
- put_unused_fd(fd);
out_free_lh:
linehandle_free(lh);
return ret;
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 39/47] hv: convert mshv_ioctl_create_partition() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (37 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 38/47] gpio: convert linehandle_create() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 40/47] media: convert media_request_alloc() " Christian Brauner
` (8 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
drivers/hv/mshv_root_main.c | 29 ++++++-----------------------
1 file changed, 6 insertions(+), 23 deletions(-)
diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c
index e3b2bd417c46..8f99be5b54ad 100644
--- a/drivers/hv/mshv_root_main.c
+++ b/drivers/hv/mshv_root_main.c
@@ -1871,7 +1871,6 @@ mshv_ioctl_create_partition(void __user *user_arg, struct device *module_dev)
union hv_partition_isolation_properties isolation_properties = {};
struct mshv_partition *partition;
struct file *file;
- int fd;
long ret;
if (copy_from_user(&args, user_arg, sizeof(args)))
@@ -1938,29 +1937,13 @@ mshv_ioctl_create_partition(void __user *user_arg, struct device *module_dev)
goto delete_partition;
ret = mshv_init_async_handler(partition);
- if (ret)
- goto remove_partition;
-
- fd = get_unused_fd_flags(O_CLOEXEC);
- if (fd < 0) {
- ret = fd;
- goto remove_partition;
- }
-
- file = anon_inode_getfile("mshv_partition", &mshv_partition_fops,
- partition, O_RDWR);
- if (IS_ERR(file)) {
- ret = PTR_ERR(file);
- goto put_fd;
+ if (!ret) {
+ ret = FD_ADD(O_CLOEXEC, anon_inode_getfile("mshv_partition",
+ &mshv_partition_fops,
+ partition, O_RDWR));
+ if (ret >= 0)
+ return ret;
}
-
- fd_install(fd, file);
-
- return fd;
-
-put_fd:
- put_unused_fd(fd);
-remove_partition:
remove_partition(partition);
delete_partition:
hv_call_delete_partition(partition->pt_id);
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 40/47] media: convert media_request_alloc() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (38 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 39/47] hv: convert mshv_ioctl_create_partition() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:33 ` [PATCH v4 41/47] ntsync: convert ntsync_obj_get_fd() " Christian Brauner
` (7 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
drivers/media/mc/mc-request.c | 34 ++++++++++++----------------------
1 file changed, 12 insertions(+), 22 deletions(-)
diff --git a/drivers/media/mc/mc-request.c b/drivers/media/mc/mc-request.c
index f66f728b1b43..2ac9ac0a740b 100644
--- a/drivers/media/mc/mc-request.c
+++ b/drivers/media/mc/mc-request.c
@@ -282,8 +282,6 @@ EXPORT_SYMBOL_GPL(media_request_get_by_fd);
int media_request_alloc(struct media_device *mdev, int *alloc_fd)
{
struct media_request *req;
- struct file *filp;
- int fd;
int ret;
/* Either both are NULL or both are non-NULL */
@@ -297,19 +295,6 @@ int media_request_alloc(struct media_device *mdev, int *alloc_fd)
if (!req)
return -ENOMEM;
- fd = get_unused_fd_flags(O_CLOEXEC);
- if (fd < 0) {
- ret = fd;
- goto err_free_req;
- }
-
- filp = anon_inode_getfile("request", &request_fops, NULL, O_CLOEXEC);
- if (IS_ERR(filp)) {
- ret = PTR_ERR(filp);
- goto err_put_fd;
- }
-
- filp->private_data = req;
req->mdev = mdev;
req->state = MEDIA_REQUEST_STATE_IDLE;
req->num_incomplete_objects = 0;
@@ -320,19 +305,24 @@ int media_request_alloc(struct media_device *mdev, int *alloc_fd)
req->updating_count = 0;
req->access_count = 0;
- *alloc_fd = fd;
+ FD_PREPARE(fdf, O_CLOEXEC,
+ anon_inode_getfile("request", &request_fops, NULL,
+ O_CLOEXEC));
+ if (fdf.err) {
+ ret = fdf.err;
+ goto err_free_req;
+ }
+
+ fd_prepare_file(fdf)->private_data = req;
+
+ *alloc_fd = fd_publish(fdf);
snprintf(req->debug_str, sizeof(req->debug_str), "%u:%d",
- atomic_inc_return(&mdev->request_id), fd);
+ atomic_inc_return(&mdev->request_id), *alloc_fd);
dev_dbg(mdev->dev, "request: allocated %s\n", req->debug_str);
- fd_install(fd, filp);
-
return 0;
-err_put_fd:
- put_unused_fd(fd);
-
err_free_req:
if (mdev->ops->req_free)
mdev->ops->req_free(req);
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 41/47] ntsync: convert ntsync_obj_get_fd() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (39 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 40/47] media: convert media_request_alloc() " Christian Brauner
@ 2025-11-23 16:33 ` Christian Brauner
2025-11-23 16:34 ` [PATCH v4 42/47] tty: convert ptm_open_peer() " Christian Brauner
` (6 subsequent siblings)
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:33 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
drivers/misc/ntsync.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/misc/ntsync.c b/drivers/misc/ntsync.c
index 999026a1ae04..3f88cd46dd25 100644
--- a/drivers/misc/ntsync.c
+++ b/drivers/misc/ntsync.c
@@ -721,21 +721,11 @@ static struct ntsync_obj *ntsync_alloc_obj(struct ntsync_device *dev,
static int ntsync_obj_get_fd(struct ntsync_obj *obj)
{
- struct file *file;
- int fd;
-
- fd = get_unused_fd_flags(O_CLOEXEC);
- if (fd < 0)
- return fd;
- file = anon_inode_getfile("ntsync", &ntsync_obj_fops, obj, O_RDWR);
- if (IS_ERR(file)) {
- put_unused_fd(fd);
- return PTR_ERR(file);
- }
- obj->file = file;
- fd_install(fd, file);
-
- return fd;
+ FD_PREPARE(fdf, O_CLOEXEC,
+ anon_inode_getfile("ntsync", &ntsync_obj_fops, obj, O_RDWR));
+ if (!fdf.err)
+ obj->file = fd_prepare_file(fdf);
+ return fd_publish(fdf);
}
static int ntsync_create_sem(struct ntsync_device *dev, void __user *argp)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 42/47] tty: convert ptm_open_peer() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (40 preceding siblings ...)
2025-11-23 16:33 ` [PATCH v4 41/47] ntsync: convert ntsync_obj_get_fd() " Christian Brauner
@ 2025-11-23 16:34 ` Christian Brauner
2025-11-25 22:39 ` Mark Brown
2025-11-23 16:34 ` [PATCH v4 43/47] vfio: convert vfio_group_ioctl_get_device_fd() " Christian Brauner
` (5 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:34 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
drivers/tty/pty.c | 30 +++++-------------------------
1 file changed, 5 insertions(+), 25 deletions(-)
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 8bb1a01fef2a..e6249c2b5672 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -602,41 +602,21 @@ static struct cdev ptmx_cdev;
int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
{
int fd;
- struct file *filp;
- int retval = -EINVAL;
struct path path;
if (tty->driver != ptm_driver)
return -EIO;
- fd = get_unused_fd_flags(flags);
- if (fd < 0) {
- retval = fd;
- goto err;
- }
-
/* Compute the slave's path */
path.mnt = devpts_mntget(master, tty->driver_data);
- if (IS_ERR(path.mnt)) {
- retval = PTR_ERR(path.mnt);
- goto err_put;
- }
+ if (IS_ERR(path.mnt))
+ return PTR_ERR(path.mnt);
path.dentry = tty->link->driver_data;
- filp = dentry_open(&path, flags, current_cred());
- mntput(path.mnt);
- if (IS_ERR(filp)) {
- retval = PTR_ERR(filp);
- goto err_put;
- }
-
- fd_install(fd, filp);
+ fd = FD_ADD(flags, dentry_open(&path, flags, current_cred()));
+ if (fd < 0)
+ mntput(path.mnt);
return fd;
-
-err_put:
- put_unused_fd(fd);
-err:
- return retval;
}
static int pty_unix98_ioctl(struct tty_struct *tty,
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 43/47] vfio: convert vfio_group_ioctl_get_device_fd() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (41 preceding siblings ...)
2025-11-23 16:34 ` [PATCH v4 42/47] tty: convert ptm_open_peer() " Christian Brauner
@ 2025-11-23 16:34 ` Christian Brauner
2025-11-24 14:52 ` Jason Gunthorpe
2025-11-23 16:34 ` [PATCH v4 44/47] file: convert replace_fd() " Christian Brauner
` (4 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:34 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
drivers/vfio/group.c | 28 +++++-----------------------
1 file changed, 5 insertions(+), 23 deletions(-)
diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c
index c376a6279de0..d47ffada6912 100644
--- a/drivers/vfio/group.c
+++ b/drivers/vfio/group.c
@@ -299,10 +299,8 @@ static int vfio_group_ioctl_get_device_fd(struct vfio_group *group,
char __user *arg)
{
struct vfio_device *device;
- struct file *filep;
char *buf;
- int fdno;
- int ret;
+ int fd;
buf = strndup_user(arg, PAGE_SIZE);
if (IS_ERR(buf))
@@ -313,26 +311,10 @@ static int vfio_group_ioctl_get_device_fd(struct vfio_group *group,
if (IS_ERR(device))
return PTR_ERR(device);
- fdno = get_unused_fd_flags(O_CLOEXEC);
- if (fdno < 0) {
- ret = fdno;
- goto err_put_device;
- }
-
- filep = vfio_device_open_file(device);
- if (IS_ERR(filep)) {
- ret = PTR_ERR(filep);
- goto err_put_fdno;
- }
-
- fd_install(fdno, filep);
- return fdno;
-
-err_put_fdno:
- put_unused_fd(fdno);
-err_put_device:
- vfio_device_put_registration(device);
- return ret;
+ fd = FD_ADD(O_CLOEXEC, vfio_device_open_file(device));
+ if (fd < 0)
+ vfio_device_put_registration(device);
+ return fd;
}
static int vfio_group_ioctl_get_status(struct vfio_group *group,
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 44/47] file: convert replace_fd() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (42 preceding siblings ...)
2025-11-23 16:34 ` [PATCH v4 43/47] vfio: convert vfio_group_ioctl_get_device_fd() " Christian Brauner
@ 2025-11-23 16:34 ` Christian Brauner
2025-11-25 12:29 ` Jan Kara
2025-11-23 16:34 ` [PATCH v4 45/47] io_uring: convert io_create_mock_file() " Christian Brauner
` (3 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:34 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
fs/file.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/fs/file.c b/fs/file.c
index 28743b742e3c..7ea33a617896 100644
--- a/fs/file.c
+++ b/fs/file.c
@@ -1357,28 +1357,25 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags)
*/
int receive_fd(struct file *file, int __user *ufd, unsigned int o_flags)
{
- int new_fd;
int error;
error = security_file_receive(file);
if (error)
return error;
- new_fd = get_unused_fd_flags(o_flags);
- if (new_fd < 0)
- return new_fd;
+ FD_PREPARE(fdf, o_flags, file);
+ if (fdf.err)
+ return fdf.err;
+ get_file(file);
if (ufd) {
- error = put_user(new_fd, ufd);
- if (error) {
- put_unused_fd(new_fd);
+ error = put_user(fd_prepare_fd(fdf), ufd);
+ if (error)
return error;
- }
}
- fd_install(new_fd, get_file(file));
- __receive_sock(file);
- return new_fd;
+ __receive_sock(fd_prepare_file(fdf));
+ return fd_publish(fdf);
}
EXPORT_SYMBOL_GPL(receive_fd);
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 45/47] io_uring: convert io_create_mock_file() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (43 preceding siblings ...)
2025-11-23 16:34 ` [PATCH v4 44/47] file: convert replace_fd() " Christian Brauner
@ 2025-11-23 16:34 ` Christian Brauner
2025-11-25 16:38 ` Jens Axboe
2025-11-23 16:34 ` [PATCH v4 46/47] kvm: convert kvm_arch_supports_gmem_init_shared() " Christian Brauner
` (2 subsequent siblings)
47 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:34 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
io_uring/mock_file.c | 44 +++++++++++++++-----------------------------
1 file changed, 15 insertions(+), 29 deletions(-)
diff --git a/io_uring/mock_file.c b/io_uring/mock_file.c
index 45d3735b2708..a2116c79e67e 100644
--- a/io_uring/mock_file.c
+++ b/io_uring/mock_file.c
@@ -211,10 +211,9 @@ static int io_create_mock_file(struct io_uring_cmd *cmd, unsigned int issue_flag
const struct file_operations *fops = &io_mock_fops;
const struct io_uring_sqe *sqe = cmd->sqe;
struct io_uring_mock_create mc, __user *uarg;
- struct io_mock_file *mf = NULL;
- struct file *file = NULL;
+ struct file *file;
+ struct io_mock_file *mf __free(kfree) = NULL;
size_t uarg_size;
- int fd = -1, ret;
/*
* It's a testing only driver that allows exercising edge cases
@@ -246,10 +245,6 @@ static int io_create_mock_file(struct io_uring_cmd *cmd, unsigned int issue_flag
if (!mf)
return -ENOMEM;
- ret = fd = get_unused_fd_flags(O_RDWR | O_CLOEXEC);
- if (fd < 0)
- goto fail;
-
init_waitqueue_head(&mf->poll_wq);
mf->size = mc.file_size;
mf->rw_delay_ns = mc.rw_delay_ns;
@@ -258,33 +253,24 @@ static int io_create_mock_file(struct io_uring_cmd *cmd, unsigned int issue_flag
mf->pollable = true;
}
- file = anon_inode_create_getfile("[io_uring_mock]", fops,
- mf, O_RDWR | O_CLOEXEC, NULL);
- if (IS_ERR(file)) {
- ret = PTR_ERR(file);
- goto fail;
- }
+ FD_PREPARE(fdf, O_RDWR | O_CLOEXEC,
+ anon_inode_create_getfile("[io_uring_mock]", fops, mf,
+ O_RDWR | O_CLOEXEC, NULL));
+ if (fdf.err)
+ return fdf.err;
- file->f_mode |= FMODE_READ | FMODE_CAN_READ |
- FMODE_WRITE | FMODE_CAN_WRITE |
- FMODE_LSEEK;
+ file = fd_prepare_file(fdf);
+ file->f_mode |= FMODE_READ | FMODE_CAN_READ | FMODE_WRITE |
+ FMODE_CAN_WRITE | FMODE_LSEEK;
if (mc.flags & IORING_MOCK_CREATE_F_SUPPORT_NOWAIT)
file->f_mode |= FMODE_NOWAIT;
- mc.out_fd = fd;
- if (copy_to_user(uarg, &mc, uarg_size)) {
- fput(file);
- ret = -EFAULT;
- goto fail;
- }
+ mc.out_fd = fd_prepare_fd(fdf);
+ if (copy_to_user(uarg, &mc, uarg_size))
+ return -EFAULT;
- fd_install(fd, file);
- return 0;
-fail:
- if (fd >= 0)
- put_unused_fd(fd);
- kfree(mf);
- return ret;
+ retain_and_null_ptr(mf);
+ return fd_publish(fdf);
}
static int io_probe_mock(struct io_uring_cmd *cmd)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 46/47] kvm: convert kvm_arch_supports_gmem_init_shared() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (44 preceding siblings ...)
2025-11-23 16:34 ` [PATCH v4 45/47] io_uring: convert io_create_mock_file() " Christian Brauner
@ 2025-11-23 16:34 ` Christian Brauner
2025-11-23 16:34 ` [PATCH v4 47/47] kvm: convert kvm_vcpu_ioctl_get_stats_fd() " Christian Brauner
2025-11-23 16:43 ` [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Linus Torvalds
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:34 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
virt/kvm/guest_memfd.c | 35 +++++++++++------------------------
1 file changed, 11 insertions(+), 24 deletions(-)
diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index fbca8c0972da..1d583d0cf6b9 100644
--- a/virt/kvm/guest_memfd.c
+++ b/virt/kvm/guest_memfd.c
@@ -493,28 +493,20 @@ bool __weak kvm_arch_supports_gmem_init_shared(struct kvm *kvm)
static int __kvm_gmem_create(struct kvm *kvm, loff_t size, u64 flags)
{
const char *anon_name = "[kvm-gmem]";
- struct kvm_gmem *gmem;
+ struct kvm_gmem *gmem __free(kfree) = NULL;
struct inode *inode;
struct file *file;
- int fd, err;
-
- fd = get_unused_fd_flags(0);
- if (fd < 0)
- return fd;
gmem = kzalloc(sizeof(*gmem), GFP_KERNEL);
- if (!gmem) {
- err = -ENOMEM;
- goto err_fd;
- }
+ if (!gmem)
+ return -ENOMEM;
- file = anon_inode_create_getfile(anon_name, &kvm_gmem_fops, gmem,
- O_RDWR, NULL);
- if (IS_ERR(file)) {
- err = PTR_ERR(file);
- goto err_gmem;
- }
+ FD_PREPARE(fdf, 0, anon_inode_create_getfile(anon_name, &kvm_gmem_fops,
+ gmem, O_RDWR, NULL));
+ if (fdf.err)
+ return fdf.err;
+ file = fd_prepare_file(fdf);
file->f_flags |= O_LARGEFILE;
inode = file->f_inode;
@@ -535,14 +527,9 @@ static int __kvm_gmem_create(struct kvm *kvm, loff_t size, u64 flags)
xa_init(&gmem->bindings);
list_add(&gmem->entry, &inode->i_mapping->i_private_list);
- fd_install(fd, file);
- return fd;
-
-err_gmem:
- kfree(gmem);
-err_fd:
- put_unused_fd(fd);
- return err;
+ /* Ownership of gmem transferred to file */
+ retain_and_null_ptr(gmem);
+ return fd_publish(fdf);
}
int kvm_gmem_create(struct kvm *kvm, struct kvm_create_guest_memfd *args)
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* [PATCH v4 47/47] kvm: convert kvm_vcpu_ioctl_get_stats_fd() to FD_PREPARE()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (45 preceding siblings ...)
2025-11-23 16:34 ` [PATCH v4 46/47] kvm: convert kvm_arch_supports_gmem_init_shared() " Christian Brauner
@ 2025-11-23 16:34 ` Christian Brauner
2025-11-23 16:43 ` [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Linus Torvalds
47 siblings, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 16:34 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe, Christian Brauner
Signed-off-by: Christian Brauner <brauner@kernel.org>
---
virt/kvm/kvm_main.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index b7a0ae2a7b20..aecc3b4aa472 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4314,25 +4314,15 @@ static const struct file_operations kvm_vcpu_stats_fops = {
static int kvm_vcpu_ioctl_get_stats_fd(struct kvm_vcpu *vcpu)
{
int fd;
- struct file *file;
char name[15 + ITOA_MAX_LEN + 1];
snprintf(name, sizeof(name), "kvm-vcpu-stats:%d", vcpu->vcpu_id);
- fd = get_unused_fd_flags(O_CLOEXEC);
- if (fd < 0)
- return fd;
-
- file = anon_inode_getfile_fmode(name, &kvm_vcpu_stats_fops, vcpu,
- O_RDONLY, FMODE_PREAD);
- if (IS_ERR(file)) {
- put_unused_fd(fd);
- return PTR_ERR(file);
- }
-
- kvm_get_kvm(vcpu->kvm);
- fd_install(fd, file);
-
+ fd = FD_ADD(O_CLOEXEC,
+ anon_inode_getfile_fmode(name, &kvm_vcpu_stats_fops, vcpu,
+ O_RDONLY, FMODE_PREAD));
+ if (fd >= 0)
+ kvm_get_kvm(vcpu->kvm);
return fd;
}
--
2.47.3
^ permalink raw reply related [flat|nested] 74+ messages in thread
* Re: [PATCH v4 00/47] file: FD_{ADD,PREPARE}()
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
` (46 preceding siblings ...)
2025-11-23 16:34 ` [PATCH v4 47/47] kvm: convert kvm_vcpu_ioctl_get_stats_fd() " Christian Brauner
@ 2025-11-23 16:43 ` Linus Torvalds
2025-11-23 16:46 ` Linus Torvalds
2025-11-23 22:53 ` Christian Brauner
47 siblings, 2 replies; 74+ messages in thread
From: Linus Torvalds @ 2025-11-23 16:43 UTC (permalink / raw)
To: Christian Brauner
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe
On Sun, 23 Nov 2025 at 08:33, Christian Brauner <brauner@kernel.org> wrote:
>
> This now removes roughly double the code that it adds.
.. and I think more importantly, I think the end result now is not
just smaller, but looks nice and straightforward too.
I particularly like your FD_ADD() macro. Good call.
So yeah, no more complaints about this from my side.
Linus
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 00/47] file: FD_{ADD,PREPARE}()
2025-11-23 16:43 ` [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Linus Torvalds
@ 2025-11-23 16:46 ` Linus Torvalds
2025-11-23 22:53 ` Christian Brauner
1 sibling, 0 replies; 74+ messages in thread
From: Linus Torvalds @ 2025-11-23 16:46 UTC (permalink / raw)
To: Christian Brauner
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe
On Sun, 23 Nov 2025 at 08:43, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> So yeah, no more complaints about this from my side.
.. oh, but one note: you should update some of the subject lines.
The subjects typically say "convert xyz to FD_PREPARE()", but half of
them should say "convert xyz to FD_ADD()".
I mean, technically FD_ADD() is obviously just a simple wrapper for
the FD_PREPARE() pattern, so it's not like it's *wrong*, but...
Linus
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 00/47] file: FD_{ADD,PREPARE}()
2025-11-23 16:43 ` [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Linus Torvalds
2025-11-23 16:46 ` Linus Torvalds
@ 2025-11-23 22:53 ` Christian Brauner
1 sibling, 0 replies; 74+ messages in thread
From: Christian Brauner @ 2025-11-23 22:53 UTC (permalink / raw)
To: Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe
On Sun, Nov 23, 2025 at 08:43:18AM -0800, Linus Torvalds wrote:
> On Sun, 23 Nov 2025 at 08:33, Christian Brauner <brauner@kernel.org> wrote:
> >
> > This now removes roughly double the code that it adds.
>
> .. and I think more importantly, I think the end result now is not
> just smaller, but looks nice and straightforward too.
>
> I particularly like your FD_ADD() macro. Good call.
>
> So yeah, no more complaints about this from my side.
Cool! This already exceeds all of the remaining direct uses to
get_unused_fd_flags() + file + install. And there's a good chunk more
that can easily be converted. I've got most of dma ported. Only
special-sauce cases should be left afterwards.
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 43/47] vfio: convert vfio_group_ioctl_get_device_fd() to FD_PREPARE()
2025-11-23 16:34 ` [PATCH v4 43/47] vfio: convert vfio_group_ioctl_get_device_fd() " Christian Brauner
@ 2025-11-24 14:52 ` Jason Gunthorpe
0 siblings, 0 replies; 74+ messages in thread
From: Jason Gunthorpe @ 2025-11-24 14:52 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun, Nov 23, 2025 at 05:34:01PM +0100, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
> ---
> drivers/vfio/group.c | 28 +++++-----------------------
> 1 file changed, 5 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c
> index c376a6279de0..d47ffada6912 100644
> --- a/drivers/vfio/group.c
> +++ b/drivers/vfio/group.c
> @@ -299,10 +299,8 @@ static int vfio_group_ioctl_get_device_fd(struct vfio_group *group,
> char __user *arg)
> {
> struct vfio_device *device;
> - struct file *filep;
> char *buf;
> - int fdno;
> - int ret;
> + int fd;
>
> buf = strndup_user(arg, PAGE_SIZE);
> if (IS_ERR(buf))
> @@ -313,26 +311,10 @@ static int vfio_group_ioctl_get_device_fd(struct vfio_group *group,
> if (IS_ERR(device))
> return PTR_ERR(device);
>
> - fdno = get_unused_fd_flags(O_CLOEXEC);
> - if (fdno < 0) {
> - ret = fdno;
> - goto err_put_device;
> - }
> -
> - filep = vfio_device_open_file(device);
> - if (IS_ERR(filep)) {
> - ret = PTR_ERR(filep);
> - goto err_put_fdno;
> - }
> -
> - fd_install(fdno, filep);
> - return fdno;
> -
> -err_put_fdno:
> - put_unused_fd(fdno);
> -err_put_device:
> - vfio_device_put_registration(device);
> - return ret;
> + fd = FD_ADD(O_CLOEXEC, vfio_device_open_file(device));
> + if (fd < 0)
> + vfio_device_put_registration(device);
> + return fd;
> }
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tough I'd bikeshed this name and suggest something with INSTALL in the
macro as we've always used install to mean the FD is visible to
userspace and is the barrier where we have to start to be careful.
Jason
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 01/47] file: add FD_{ADD,PREPARE}()
2025-11-23 16:33 ` [PATCH v4 01/47] file: add FD_{ADD,PREPARE}() Christian Brauner
@ 2025-11-24 15:03 ` Jason Gunthorpe
0 siblings, 0 replies; 74+ messages in thread
From: Jason Gunthorpe @ 2025-11-24 15:03 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun, Nov 23, 2025 at 05:33:19PM +0100, Christian Brauner wrote:
> +/*
> + * __FD_PREPARE_INIT(fd_flags, file_init_expr):
> + * Helper to initialize fd_prepare class.
> + * @fd_flags: flags for get_unused_fd_flags()
> + * @file_init_expr: expression that returns struct file *
> + *
> + * Returns a struct fd_prepare with fd, file, and err set.
> + * If fd allocation fails, fd will be negative and err will be set.
> + * If fd succeeds but file_init_expr fails, file will be ERR_PTR and err will be set.
> + * The err field is the single source of truth for error checking.
> + */
> +#define __FD_PREPARE_INIT(_fd_flags, _file_init_owned) \
> + ({ \
> + class_fd_prepare_t _fd_prepare = { \
> + .__fd = get_unused_fd_flags((_fd_flags)), \
> + }; \
> + if (likely(_fd_prepare.__fd >= 0)) \
> + _fd_prepare.__file = (_file_init_owned); \
> + _fd_prepare.err = ACQUIRE_ERR(fd_prepare, &_fd_prepare); \
> + _fd_prepare; \
> + })
> +
> +/*
> + * FD_PREPARE(var, fd_flags, file_init_owned):
> + * Declares and initializes an fd_prepare variable with automatic cleanup.
> + * No separate scope required - cleanup happens when variable goes out of scope.
> + *
> + * @_var: name of struct fd_prepare variable to define
> + * @_fd_flags: flags for get_unused_fd_flags()
> + * @_file_init_owned: struct file to take ownership of (can be expression)
> + */
> +#define FD_PREPARE(_var, _fd_flags, _file_init_owned) \
> + CLASS_INIT(fd_prepare, _var, __FD_PREPARE_INIT(_fd_flags, _file_init_owned))
> +
> +#define fd_publish(_fd_prepare) \
> + ({ \
> + class_fd_prepare_t *__p = &(_fd_prepare); \
> + VFS_WARN_ON_ONCE(__p->err); \
> + VFS_WARN_ON_ONCE(__p->__fd < 0); \
> + VFS_WARN_ON_ONCE(IS_ERR_OR_NULL(__p->__file)); \
> + fd_install(__p->__fd, __p->__file); \
> + retain_and_null_ptr(__p->__file); \
> + take_fd(__p->__fd); \
> + })
Why not use a real function?
> +#define FD_ADD(_fd_flags, _file_init_owned) \
> + ({ \
> + FD_PREPARE(_var, _fd_flags, _file_init_owned); \
> + s32 ret = _var.err; \
> + if (likely(!ret)) \
> + ret = fd_publish(_var); \
> + ret; \
> + })
Here too, seems like there are many of these, for the sake of .text
why not have it just be a function call?
int __do_fd_add(int flags, struct file *new_file);
#define FD_ADD(_fd_flags, new_file) __do_fd_add(_fd_flags, new_file)
cleanup.h is not adding anything to the caller since the cleanup is
fully contained to the scope of the macro.
I don't think it really matters that get_unused_fd_flags() is called
before or after allocating the struct file?
Jason
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 08/47] fanotify: convert fanotify_init() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 08/47] fanotify: convert fanotify_init() " Christian Brauner
@ 2025-11-24 17:13 ` Amir Goldstein
2025-11-25 12:13 ` Jan Kara
1 sibling, 0 replies; 74+ messages in thread
From: Amir Goldstein @ 2025-11-24 17:13 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Jens Axboe
On Sun, Nov 23, 2025 at 5:33 PM Christian Brauner <brauner@kernel.org> wrote:
>
> Signed-off-by: Christian Brauner <brauner@kernel.org>
> ---
> fs/notify/fanotify/fanotify_user.c | 60 ++++++++++++++------------------------
> 1 file changed, 22 insertions(+), 38 deletions(-)
>
Love the diffstat!
Love the end result!
Feel free to add
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Thanks,
Amir.
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index 1dadda82cae5..be0a96ad4316 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -1597,16 +1597,20 @@ static struct hlist_head *fanotify_alloc_merge_hash(void)
> return hash;
> }
>
> +DEFINE_CLASS(fsnotify_group,
> + struct fsnotify_group *,
> + if (_T) fsnotify_destroy_group(_T),
> + fsnotify_alloc_group(ops, flags),
> + const struct fsnotify_ops *ops, int flags)
> +
> /* fanotify syscalls */
> SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
> {
> struct user_namespace *user_ns = current_user_ns();
> - struct fsnotify_group *group;
> int f_flags, fd;
> unsigned int fid_mode = flags & FANOTIFY_FID_BITS;
> unsigned int class = flags & FANOTIFY_CLASS_BITS;
> unsigned int internal_flags = 0;
> - struct file *file;
>
> pr_debug("%s: flags=%x event_f_flags=%x\n",
> __func__, flags, event_f_flags);
> @@ -1690,36 +1694,29 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
> if (flags & FAN_NONBLOCK)
> f_flags |= O_NONBLOCK;
>
> - /* fsnotify_alloc_group takes a ref. Dropped in fanotify_release */
> - group = fsnotify_alloc_group(&fanotify_fsnotify_ops,
> + CLASS(fsnotify_group, group)(&fanotify_fsnotify_ops,
> FSNOTIFY_GROUP_USER);
> - if (IS_ERR(group)) {
> + /* fsnotify_alloc_group takes a ref. Dropped in fanotify_release */
> + if (IS_ERR(group))
> return PTR_ERR(group);
> - }
>
> /* Enforce groups limits per user in all containing user ns */
> group->fanotify_data.ucounts = inc_ucount(user_ns, current_euid(),
> UCOUNT_FANOTIFY_GROUPS);
> - if (!group->fanotify_data.ucounts) {
> - fd = -EMFILE;
> - goto out_destroy_group;
> - }
> + if (!group->fanotify_data.ucounts)
> + return -EMFILE;
>
> group->fanotify_data.flags = flags | internal_flags;
> group->memcg = get_mem_cgroup_from_mm(current->mm);
> group->user_ns = get_user_ns(user_ns);
>
> group->fanotify_data.merge_hash = fanotify_alloc_merge_hash();
> - if (!group->fanotify_data.merge_hash) {
> - fd = -ENOMEM;
> - goto out_destroy_group;
> - }
> + if (!group->fanotify_data.merge_hash)
> + return -ENOMEM;
>
> group->overflow_event = fanotify_alloc_overflow_event();
> - if (unlikely(!group->overflow_event)) {
> - fd = -ENOMEM;
> - goto out_destroy_group;
> - }
> + if (unlikely(!group->overflow_event))
> + return -ENOMEM;
>
> if (force_o_largefile())
> event_f_flags |= O_LARGEFILE;
> @@ -1738,8 +1735,7 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
> group->priority = FSNOTIFY_PRIO_PRE_CONTENT;
> break;
> default:
> - fd = -EINVAL;
> - goto out_destroy_group;
> + return -EINVAL;
> }
>
> BUILD_BUG_ON(!(FANOTIFY_ADMIN_INIT_FLAGS & FAN_UNLIMITED_QUEUE));
> @@ -1750,27 +1746,15 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
> }
>
> if (flags & FAN_ENABLE_AUDIT) {
> - fd = -EPERM;
> if (!capable(CAP_AUDIT_WRITE))
> - goto out_destroy_group;
> - }
> -
> - fd = get_unused_fd_flags(f_flags);
> - if (fd < 0)
> - goto out_destroy_group;
> -
> - file = anon_inode_getfile_fmode("[fanotify]", &fanotify_fops, group,
> - f_flags, FMODE_NONOTIFY);
> - if (IS_ERR(file)) {
> - put_unused_fd(fd);
> - fd = PTR_ERR(file);
> - goto out_destroy_group;
> + return -EPERM;
> }
> - fd_install(fd, file);
> - return fd;
>
> -out_destroy_group:
> - fsnotify_destroy_group(group);
> + fd = FD_ADD(f_flags,
> + anon_inode_getfile_fmode("[fanotify]", &fanotify_fops,
> + group, f_flags, FMODE_NONOTIFY));
> + if (fd >= 0)
> + retain_and_null_ptr(group);
> return fd;
> }
>
>
> --
> 2.47.3
>
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 26/47] secretmem: convert memfd_secret() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 26/47] secretmem: convert memfd_secret() " Christian Brauner
@ 2025-11-25 11:21 ` Mike Rapoport
0 siblings, 0 replies; 74+ messages in thread
From: Mike Rapoport @ 2025-11-25 11:21 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun, Nov 23, 2025 at 05:33:44PM +0100, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> mm/secretmem.c | 20 +-------------------
> 1 file changed, 1 insertion(+), 19 deletions(-)
>
> diff --git a/mm/secretmem.c b/mm/secretmem.c
> index 60137305bc20..eb950f8193c9 100644
> --- a/mm/secretmem.c
> +++ b/mm/secretmem.c
> @@ -224,9 +224,6 @@ static struct file *secretmem_file_create(unsigned long flags)
>
> SYSCALL_DEFINE1(memfd_secret, unsigned int, flags)
> {
> - struct file *file;
> - int fd, err;
> -
> /* make sure local flags do not confict with global fcntl.h */
> BUILD_BUG_ON(SECRETMEM_FLAGS_MASK & O_CLOEXEC);
>
> @@ -238,22 +235,7 @@ SYSCALL_DEFINE1(memfd_secret, unsigned int, flags)
> if (atomic_read(&secretmem_users) < 0)
> return -ENFILE;
>
> - fd = get_unused_fd_flags(flags & O_CLOEXEC);
> - if (fd < 0)
> - return fd;
> -
> - file = secretmem_file_create(flags);
> - if (IS_ERR(file)) {
> - err = PTR_ERR(file);
> - goto err_put_fd;
> - }
> -
> - fd_install(fd, file);
> - return fd;
> -
> -err_put_fd:
> - put_unused_fd(fd);
> - return err;
> + return FD_ADD(flags & O_CLOEXEC, secretmem_file_create(flags));
> }
>
> static int secretmem_init_fs_context(struct fs_context *fc)
>
> --
> 2.47.3
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 16/47] userfaultfd: convert new_userfaultfd() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 16/47] userfaultfd: convert new_userfaultfd() " Christian Brauner
@ 2025-11-25 11:24 ` Mike Rapoport
0 siblings, 0 replies; 74+ messages in thread
From: Mike Rapoport @ 2025-11-25 11:24 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun, Nov 23, 2025 at 05:33:34PM +0100, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> fs/userfaultfd.c | 30 ++++++++++--------------------
> 1 file changed, 10 insertions(+), 20 deletions(-)
>
> diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c
> index 54c6cc7fe9c6..e6e74b384087 100644
> --- a/fs/userfaultfd.c
> +++ b/fs/userfaultfd.c
> @@ -2111,9 +2111,7 @@ static void init_once_userfaultfd_ctx(void *mem)
>
> static int new_userfaultfd(int flags)
> {
> - struct userfaultfd_ctx *ctx;
> - struct file *file;
> - int fd;
> + struct userfaultfd_ctx *ctx __free(kfree) = NULL;
>
> VM_WARN_ON_ONCE(!current->mm);
>
> @@ -2135,26 +2133,18 @@ static int new_userfaultfd(int flags)
> atomic_set(&ctx->mmap_changing, 0);
> ctx->mm = current->mm;
>
> - fd = get_unused_fd_flags(flags & UFFD_SHARED_FCNTL_FLAGS);
> - if (fd < 0)
> - goto err_out;
> + FD_PREPARE(fdf, flags & UFFD_SHARED_FCNTL_FLAGS,
> + anon_inode_create_getfile("[userfaultfd]", &userfaultfd_fops, ctx,
> + O_RDONLY | (flags & UFFD_SHARED_FCNTL_FLAGS),
> + NULL));
> + if (fdf.err)
> + return fdf.err;
>
> - /* Create a new inode so that the LSM can block the creation. */
> - file = anon_inode_create_getfile("[userfaultfd]", &userfaultfd_fops, ctx,
> - O_RDONLY | (flags & UFFD_SHARED_FCNTL_FLAGS), NULL);
> - if (IS_ERR(file)) {
> - put_unused_fd(fd);
> - fd = PTR_ERR(file);
> - goto err_out;
> - }
> /* prevent the mm struct to be freed */
> mmgrab(ctx->mm);
> - file->f_mode |= FMODE_NOWAIT;
> - fd_install(fd, file);
> - return fd;
> -err_out:
> - kmem_cache_free(userfaultfd_ctx_cachep, ctx);
> - return fd;
> + fd_prepare_file(fdf)->f_mode |= FMODE_NOWAIT;
> + retain_and_null_ptr(ctx);
> + return fd_publish(fdf);
> }
>
> static inline bool userfaultfd_syscall_allowed(int flags)
>
> --
> 2.47.3
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 25/47] memfd: convert memfd_create() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 25/47] memfd: convert memfd_create() " Christian Brauner
@ 2025-11-25 11:30 ` Mike Rapoport
0 siblings, 0 replies; 74+ messages in thread
From: Mike Rapoport @ 2025-11-25 11:30 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun, Nov 23, 2025 at 05:33:43PM +0100, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
> ---
> mm/memfd.c | 29 +++++------------------------
> 1 file changed, 5 insertions(+), 24 deletions(-)
>
> diff --git a/mm/memfd.c b/mm/memfd.c
> index 1d109c1acf21..2a6614b7c4ea 100644
> --- a/mm/memfd.c
> +++ b/mm/memfd.c
> @@ -470,9 +470,9 @@ SYSCALL_DEFINE2(memfd_create,
> const char __user *, uname,
> unsigned int, flags)
> {
> - struct file *file;
> - int fd, error;
> - char *name;
> + char *name __free(kfree) = NULL;
> + unsigned int fd_flags;
> + int error;
>
> error = sanitize_flags(&flags);
> if (error < 0)
> @@ -482,25 +482,6 @@ SYSCALL_DEFINE2(memfd_create,
> if (IS_ERR(name))
> return PTR_ERR(name);
>
> - fd = get_unused_fd_flags((flags & MFD_CLOEXEC) ? O_CLOEXEC : 0);
> - if (fd < 0) {
> - error = fd;
> - goto err_free_name;
> - }
> -
> - file = alloc_file(name, flags);
> - if (IS_ERR(file)) {
> - error = PTR_ERR(file);
> - goto err_free_fd;
> - }
> -
> - fd_install(fd, file);
> - kfree(name);
> - return fd;
> -
> -err_free_fd:
> - put_unused_fd(fd);
> -err_free_name:
> - kfree(name);
> - return error;
> + fd_flags = (flags & MFD_CLOEXEC) ? O_CLOEXEC : 0;
> + return FD_ADD(fd_flags, alloc_file(name, flags));
> }
>
> --
> 2.47.3
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 08/47] fanotify: convert fanotify_init() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 08/47] fanotify: convert fanotify_init() " Christian Brauner
2025-11-24 17:13 ` Amir Goldstein
@ 2025-11-25 12:13 ` Jan Kara
1 sibling, 0 replies; 74+ messages in thread
From: Jan Kara @ 2025-11-25 12:13 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun 23-11-25 17:33:26, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
> ---
> fs/notify/fanotify/fanotify_user.c | 60 ++++++++++++++------------------------
> 1 file changed, 22 insertions(+), 38 deletions(-)
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
>
> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
> index 1dadda82cae5..be0a96ad4316 100644
> --- a/fs/notify/fanotify/fanotify_user.c
> +++ b/fs/notify/fanotify/fanotify_user.c
> @@ -1597,16 +1597,20 @@ static struct hlist_head *fanotify_alloc_merge_hash(void)
> return hash;
> }
>
> +DEFINE_CLASS(fsnotify_group,
> + struct fsnotify_group *,
> + if (_T) fsnotify_destroy_group(_T),
> + fsnotify_alloc_group(ops, flags),
> + const struct fsnotify_ops *ops, int flags)
> +
> /* fanotify syscalls */
> SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
> {
> struct user_namespace *user_ns = current_user_ns();
> - struct fsnotify_group *group;
> int f_flags, fd;
> unsigned int fid_mode = flags & FANOTIFY_FID_BITS;
> unsigned int class = flags & FANOTIFY_CLASS_BITS;
> unsigned int internal_flags = 0;
> - struct file *file;
>
> pr_debug("%s: flags=%x event_f_flags=%x\n",
> __func__, flags, event_f_flags);
> @@ -1690,36 +1694,29 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
> if (flags & FAN_NONBLOCK)
> f_flags |= O_NONBLOCK;
>
> - /* fsnotify_alloc_group takes a ref. Dropped in fanotify_release */
> - group = fsnotify_alloc_group(&fanotify_fsnotify_ops,
> + CLASS(fsnotify_group, group)(&fanotify_fsnotify_ops,
> FSNOTIFY_GROUP_USER);
> - if (IS_ERR(group)) {
> + /* fsnotify_alloc_group takes a ref. Dropped in fanotify_release */
> + if (IS_ERR(group))
> return PTR_ERR(group);
> - }
>
> /* Enforce groups limits per user in all containing user ns */
> group->fanotify_data.ucounts = inc_ucount(user_ns, current_euid(),
> UCOUNT_FANOTIFY_GROUPS);
> - if (!group->fanotify_data.ucounts) {
> - fd = -EMFILE;
> - goto out_destroy_group;
> - }
> + if (!group->fanotify_data.ucounts)
> + return -EMFILE;
>
> group->fanotify_data.flags = flags | internal_flags;
> group->memcg = get_mem_cgroup_from_mm(current->mm);
> group->user_ns = get_user_ns(user_ns);
>
> group->fanotify_data.merge_hash = fanotify_alloc_merge_hash();
> - if (!group->fanotify_data.merge_hash) {
> - fd = -ENOMEM;
> - goto out_destroy_group;
> - }
> + if (!group->fanotify_data.merge_hash)
> + return -ENOMEM;
>
> group->overflow_event = fanotify_alloc_overflow_event();
> - if (unlikely(!group->overflow_event)) {
> - fd = -ENOMEM;
> - goto out_destroy_group;
> - }
> + if (unlikely(!group->overflow_event))
> + return -ENOMEM;
>
> if (force_o_largefile())
> event_f_flags |= O_LARGEFILE;
> @@ -1738,8 +1735,7 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
> group->priority = FSNOTIFY_PRIO_PRE_CONTENT;
> break;
> default:
> - fd = -EINVAL;
> - goto out_destroy_group;
> + return -EINVAL;
> }
>
> BUILD_BUG_ON(!(FANOTIFY_ADMIN_INIT_FLAGS & FAN_UNLIMITED_QUEUE));
> @@ -1750,27 +1746,15 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
> }
>
> if (flags & FAN_ENABLE_AUDIT) {
> - fd = -EPERM;
> if (!capable(CAP_AUDIT_WRITE))
> - goto out_destroy_group;
> - }
> -
> - fd = get_unused_fd_flags(f_flags);
> - if (fd < 0)
> - goto out_destroy_group;
> -
> - file = anon_inode_getfile_fmode("[fanotify]", &fanotify_fops, group,
> - f_flags, FMODE_NONOTIFY);
> - if (IS_ERR(file)) {
> - put_unused_fd(fd);
> - fd = PTR_ERR(file);
> - goto out_destroy_group;
> + return -EPERM;
> }
> - fd_install(fd, file);
> - return fd;
>
> -out_destroy_group:
> - fsnotify_destroy_group(group);
> + fd = FD_ADD(f_flags,
> + anon_inode_getfile_fmode("[fanotify]", &fanotify_fops,
> + group, f_flags, FMODE_NONOTIFY));
> + if (fd >= 0)
> + retain_and_null_ptr(group);
> return fd;
> }
>
>
> --
> 2.47.3
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 04/47] fhandle: convert do_handle_open() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 04/47] fhandle: convert do_handle_open() " Christian Brauner
@ 2025-11-25 12:15 ` Jan Kara
0 siblings, 0 replies; 74+ messages in thread
From: Jan Kara @ 2025-11-25 12:15 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun 23-11-25 17:33:22, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Subject should have FD_ADD() but otherwise looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/fhandle.c | 30 +++++++++++++-----------------
> 1 file changed, 13 insertions(+), 17 deletions(-)
>
> diff --git a/fs/fhandle.c b/fs/fhandle.c
> index 052f9c9368fb..3de1547ec9d4 100644
> --- a/fs/fhandle.c
> +++ b/fs/fhandle.c
> @@ -404,32 +404,28 @@ static int handle_to_path(int mountdirfd, struct file_handle __user *ufh,
> return retval;
> }
>
> +static struct file *file_open_handle(struct path *path, int open_flag)
> +{
> + const struct export_operations *eops;
> +
> + eops = path->mnt->mnt_sb->s_export_op;
> + if (eops->open)
> + return eops->open(path, open_flag);
> +
> + return file_open_root(path, "", open_flag, 0);
> +}
> +
> static long do_handle_open(int mountdirfd, struct file_handle __user *ufh,
> int open_flag)
> {
> - long retval = 0;
> + long retval;
> struct path path __free(path_put) = {};
> - struct file *file;
> - const struct export_operations *eops;
>
> retval = handle_to_path(mountdirfd, ufh, &path, open_flag);
> if (retval)
> return retval;
>
> - CLASS(get_unused_fd, fd)(open_flag);
> - if (fd < 0)
> - return fd;
> -
> - eops = path.mnt->mnt_sb->s_export_op;
> - if (eops->open)
> - file = eops->open(&path, open_flag);
> - else
> - file = file_open_root(&path, "", open_flag, 0);
> - if (IS_ERR(file))
> - return PTR_ERR(file);
> -
> - fd_install(fd, file);
> - return take_fd(fd);
> + return FD_ADD(open_flag, file_open_handle(&path, open_flag));
> }
>
> /**
>
> --
> 2.47.3
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 02/47] anon_inodes: convert to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 02/47] anon_inodes: convert to FD_PREPARE() Christian Brauner
@ 2025-11-25 12:16 ` Jan Kara
0 siblings, 0 replies; 74+ messages in thread
From: Jan Kara @ 2025-11-25 12:16 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun 23-11-25 17:33:20, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Looks good (except for the subject). Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/anon_inodes.c | 23 ++---------------------
> 1 file changed, 2 insertions(+), 21 deletions(-)
>
> diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c
> index 180a458fc4f7..b8381c7fb636 100644
> --- a/fs/anon_inodes.c
> +++ b/fs/anon_inodes.c
> @@ -280,27 +280,8 @@ static int __anon_inode_getfd(const char *name,
> const struct inode *context_inode,
> bool make_inode)
> {
> - int error, fd;
> - struct file *file;
> -
> - error = get_unused_fd_flags(flags);
> - if (error < 0)
> - return error;
> - fd = error;
> -
> - file = __anon_inode_getfile(name, fops, priv, flags, context_inode,
> - make_inode);
> - if (IS_ERR(file)) {
> - error = PTR_ERR(file);
> - goto err_put_unused_fd;
> - }
> - fd_install(fd, file);
> -
> - return fd;
> -
> -err_put_unused_fd:
> - put_unused_fd(fd);
> - return error;
> + return FD_ADD(flags, __anon_inode_getfile(name, fops, priv, flags,
> + context_inode, make_inode));
> }
>
> /**
>
> --
> 2.47.3
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 03/47] eventfd: convert do_eventfd() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 03/47] eventfd: convert do_eventfd() " Christian Brauner
@ 2025-11-25 12:18 ` Jan Kara
0 siblings, 0 replies; 74+ messages in thread
From: Jan Kara @ 2025-11-25 12:18 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun 23-11-25 17:33:21, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/eventfd.c | 31 +++++++++++--------------------
> 1 file changed, 11 insertions(+), 20 deletions(-)
>
> diff --git a/fs/eventfd.c b/fs/eventfd.c
> index af42b2c7d235..3219e0d596fe 100644
> --- a/fs/eventfd.c
> +++ b/fs/eventfd.c
> @@ -378,9 +378,7 @@ EXPORT_SYMBOL_GPL(eventfd_ctx_fileget);
>
> static int do_eventfd(unsigned int count, int flags)
> {
> - struct eventfd_ctx *ctx;
> - struct file *file;
> - int fd;
> + struct eventfd_ctx *ctx __free(kfree) = NULL;
>
> /* Check the EFD_* constants for consistency. */
> BUILD_BUG_ON(EFD_CLOEXEC != O_CLOEXEC);
> @@ -398,26 +396,19 @@ static int do_eventfd(unsigned int count, int flags)
> init_waitqueue_head(&ctx->wqh);
> ctx->count = count;
> ctx->flags = flags;
> - ctx->id = ida_alloc(&eventfd_ida, GFP_KERNEL);
>
> flags &= EFD_SHARED_FCNTL_FLAGS;
> flags |= O_RDWR;
> - fd = get_unused_fd_flags(flags);
> - if (fd < 0)
> - goto err;
> -
> - file = anon_inode_getfile_fmode("[eventfd]", &eventfd_fops,
> - ctx, flags, FMODE_NOWAIT);
> - if (IS_ERR(file)) {
> - put_unused_fd(fd);
> - fd = PTR_ERR(file);
> - goto err;
> - }
> - fd_install(fd, file);
> - return fd;
> -err:
> - eventfd_free_ctx(ctx);
> - return fd;
> +
> + FD_PREPARE(fdf, flags,
> + anon_inode_getfile_fmode("[eventfd]", &eventfd_fops, ctx,
> + flags, FMODE_NOWAIT));
> + if (fdf.err)
> + return fdf.err;
> +
> + ctx->id = ida_alloc(&eventfd_ida, GFP_KERNEL);
> + retain_and_null_ptr(ctx);
> + return fd_publish(fdf);
> }
>
> SYSCALL_DEFINE2(eventfd2, unsigned int, count, int, flags)
>
> --
> 2.47.3
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 13/47] open: convert do_sys_openat2() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 13/47] open: convert do_sys_openat2() " Christian Brauner
@ 2025-11-25 12:20 ` Jan Kara
0 siblings, 0 replies; 74+ messages in thread
From: Jan Kara @ 2025-11-25 12:20 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun 23-11-25 17:33:31, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Looks good (except for the subject). Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/open.c | 17 +++--------------
> 1 file changed, 3 insertions(+), 14 deletions(-)
>
> diff --git a/fs/open.c b/fs/open.c
> index 3d64372ecc67..fa00860f4e4c 100644
> --- a/fs/open.c
> +++ b/fs/open.c
> @@ -1421,8 +1421,8 @@ static int do_sys_openat2(int dfd, const char __user *filename,
> struct open_how *how)
> {
> struct open_flags op;
> - struct filename *tmp;
> - int err, fd;
> + struct filename *tmp __free(putname);
> + int err;
>
> err = build_open_flags(how, &op);
> if (unlikely(err))
> @@ -1432,18 +1432,7 @@ static int do_sys_openat2(int dfd, const char __user *filename,
> if (IS_ERR(tmp))
> return PTR_ERR(tmp);
>
> - fd = get_unused_fd_flags(how->flags);
> - if (likely(fd >= 0)) {
> - struct file *f = do_filp_open(dfd, tmp, &op);
> - if (IS_ERR(f)) {
> - put_unused_fd(fd);
> - fd = PTR_ERR(f);
> - } else {
> - fd_install(fd, f);
> - }
> - }
> - putname(tmp);
> - return fd;
> + return FD_ADD(how->flags, do_filp_open(dfd, tmp, &op));
> }
>
> int do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
>
> --
> 2.47.3
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 44/47] file: convert replace_fd() to FD_PREPARE()
2025-11-23 16:34 ` [PATCH v4 44/47] file: convert replace_fd() " Christian Brauner
@ 2025-11-25 12:29 ` Jan Kara
0 siblings, 0 replies; 74+ messages in thread
From: Jan Kara @ 2025-11-25 12:29 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun 23-11-25 17:34:02, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
> ---
> fs/file.c | 19 ++++++++-----------
> 1 file changed, 8 insertions(+), 11 deletions(-)
>
> diff --git a/fs/file.c b/fs/file.c
> index 28743b742e3c..7ea33a617896 100644
> --- a/fs/file.c
> +++ b/fs/file.c
> @@ -1357,28 +1357,25 @@ int replace_fd(unsigned fd, struct file *file, unsigned flags)
> */
> int receive_fd(struct file *file, int __user *ufd, unsigned int o_flags)
> {
> - int new_fd;
> int error;
>
> error = security_file_receive(file);
> if (error)
> return error;
>
> - new_fd = get_unused_fd_flags(o_flags);
> - if (new_fd < 0)
> - return new_fd;
> + FD_PREPARE(fdf, o_flags, file);
> + if (fdf.err)
> + return fdf.err;
> + get_file(file);
It would seem more consistent with other call sites (and thus more
futureproof) to have:
FD_PREPARE(fdf, o_flags, get_file(file));
if (fdf.err)
return fdf.err;
Otherwise the patch looks good so feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 05/47] namespace: convert open_tree() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 05/47] namespace: convert open_tree() " Christian Brauner
@ 2025-11-25 12:32 ` Jan Kara
0 siblings, 0 replies; 74+ messages in thread
From: Jan Kara @ 2025-11-25 12:32 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun 23-11-25 17:33:23, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
> ---
> fs/namespace.c | 14 +-------------
> 1 file changed, 1 insertion(+), 13 deletions(-)
Nice. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index d82910f33dc4..3cf3fa27117d 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -3103,19 +3103,7 @@ static struct file *vfs_open_tree(int dfd, const char __user *filename, unsigned
>
> SYSCALL_DEFINE3(open_tree, int, dfd, const char __user *, filename, unsigned, flags)
> {
> - int fd;
> - struct file *file __free(fput) = NULL;
> -
> - file = vfs_open_tree(dfd, filename, flags);
> - if (IS_ERR(file))
> - return PTR_ERR(file);
> -
> - fd = get_unused_fd_flags(flags & O_CLOEXEC);
> - if (fd < 0)
> - return fd;
> -
> - fd_install(fd, no_free_ptr(file));
> - return fd;
> + return FD_ADD(flags, vfs_open_tree(dfd, filename, flags));
> }
>
> /*
>
> --
> 2.47.3
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 06/47] namespace: convert open_tree_attr() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 06/47] namespace: convert open_tree_attr() " Christian Brauner
@ 2025-11-25 12:33 ` Jan Kara
0 siblings, 0 replies; 74+ messages in thread
From: Jan Kara @ 2025-11-25 12:33 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun 23-11-25 17:33:24, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/namespace.c | 19 ++++++-------------
> 1 file changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 3cf3fa27117d..0c4024558c13 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -5023,19 +5023,17 @@ SYSCALL_DEFINE5(open_tree_attr, int, dfd, const char __user *, filename,
> unsigned, flags, struct mount_attr __user *, uattr,
> size_t, usize)
> {
> - struct file __free(fput) *file = NULL;
> - int fd;
> -
> if (!uattr && usize)
> return -EINVAL;
>
> - file = vfs_open_tree(dfd, filename, flags);
> - if (IS_ERR(file))
> - return PTR_ERR(file);
> + FD_PREPARE(fdf, flags, vfs_open_tree(dfd, filename, flags));
> + if (fdf.err)
> + return fdf.err;
>
> if (uattr) {
> - int ret;
> struct mount_kattr kattr = {};
> + struct file *file = fd_prepare_file(fdf);
> + int ret;
>
> if (flags & OPEN_TREE_CLONE)
> kattr.kflags = MOUNT_KATTR_IDMAP_REPLACE;
> @@ -5051,12 +5049,7 @@ SYSCALL_DEFINE5(open_tree_attr, int, dfd, const char __user *, filename,
> return ret;
> }
>
> - fd = get_unused_fd_flags(flags & O_CLOEXEC);
> - if (fd < 0)
> - return fd;
> -
> - fd_install(fd, no_free_ptr(file));
> - return fd;
> + return fd_publish(fdf);
> }
>
> int show_path(struct seq_file *m, struct dentry *root)
>
> --
> 2.47.3
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 07/47] namespace: convert fsmount() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 07/47] namespace: convert fsmount() " Christian Brauner
@ 2025-11-25 12:42 ` Jan Kara
0 siblings, 0 replies; 74+ messages in thread
From: Jan Kara @ 2025-11-25 12:42 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Sun 23-11-25 17:33:25, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/namespace.c | 55 +++++++++++++++++++++----------------------------------
> 1 file changed, 21 insertions(+), 34 deletions(-)
>
> diff --git a/fs/namespace.c b/fs/namespace.c
> index 0c4024558c13..f118fc318156 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -4273,8 +4273,7 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
> {
> struct mnt_namespace *ns;
> struct fs_context *fc;
> - struct file *file;
> - struct path newmount;
> + struct path newmount __free(path_put) = {};
> struct mount *mnt;
> unsigned int mnt_flags = 0;
> long ret;
> @@ -4312,33 +4311,32 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
>
> fc = fd_file(f)->private_data;
>
> - ret = mutex_lock_interruptible(&fc->uapi_mutex);
> - if (ret < 0)
> + ACQUIRE(mutex_intr, uapi_mutex)(&fc->uapi_mutex);
> + ret = ACQUIRE_ERR(mutex_intr, &uapi_mutex);
> + if (ret)
> return ret;
>
> /* There must be a valid superblock or we can't mount it */
> ret = -EINVAL;
> if (!fc->root)
> - goto err_unlock;
> + return ret;
>
> ret = -EPERM;
> if (mount_too_revealing(fc->root->d_sb, &mnt_flags)) {
> errorfcp(fc, "VFS", "Mount too revealing");
> - goto err_unlock;
> + return ret;
> }
>
> ret = -EBUSY;
> if (fc->phase != FS_CONTEXT_AWAITING_MOUNT)
> - goto err_unlock;
> + return ret;
>
> if (fc->sb_flags & SB_MANDLOCK)
> warn_mandlock();
>
> newmount.mnt = vfs_create_mount(fc);
> - if (IS_ERR(newmount.mnt)) {
> - ret = PTR_ERR(newmount.mnt);
> - goto err_unlock;
> - }
> + if (IS_ERR(newmount.mnt))
> + return PTR_ERR(newmount.mnt);
> newmount.dentry = dget(fc->root);
> newmount.mnt->mnt_flags = mnt_flags;
>
> @@ -4350,38 +4348,27 @@ SYSCALL_DEFINE3(fsmount, int, fs_fd, unsigned int, flags,
> vfs_clean_context(fc);
>
> ns = alloc_mnt_ns(current->nsproxy->mnt_ns->user_ns, true);
> - if (IS_ERR(ns)) {
> - ret = PTR_ERR(ns);
> - goto err_path;
> - }
> + if (IS_ERR(ns))
> + return PTR_ERR(ns);
> mnt = real_mount(newmount.mnt);
> ns->root = mnt;
> ns->nr_mounts = 1;
> mnt_add_to_ns(ns, mnt);
> mntget(newmount.mnt);
>
> - /* Attach to an apparent O_PATH fd with a note that we need to unmount
> - * it, not just simply put it.
> - */
> - file = dentry_open(&newmount, O_PATH, fc->cred);
> - if (IS_ERR(file)) {
> + FD_PREPARE(fdf, (flags & FSMOUNT_CLOEXEC) ? O_CLOEXEC : 0,
> + dentry_open(&newmount, O_PATH, fc->cred));
> + if (fdf.err) {
> dissolve_on_fput(newmount.mnt);
> - ret = PTR_ERR(file);
> - goto err_path;
> + return fdf.err;
> }
> - file->f_mode |= FMODE_NEED_UNMOUNT;
> -
> - ret = get_unused_fd_flags((flags & FSMOUNT_CLOEXEC) ? O_CLOEXEC : 0);
> - if (ret >= 0)
> - fd_install(ret, file);
> - else
> - fput(file);
>
> -err_path:
> - path_put(&newmount);
> -err_unlock:
> - mutex_unlock(&fc->uapi_mutex);
> - return ret;
> + /*
> + * Attach to an apparent O_PATH fd with a note that we
> + * need to unmount it, not just simply put it.
> + */
> + fd_prepare_file(fdf)->f_mode |= FMODE_NEED_UNMOUNT;
> + return fd_publish(fdf);
> }
>
> static inline int vfs_move_mount(const struct path *from_path,
>
> --
> 2.47.3
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 45/47] io_uring: convert io_create_mock_file() to FD_PREPARE()
2025-11-23 16:34 ` [PATCH v4 45/47] io_uring: convert io_create_mock_file() " Christian Brauner
@ 2025-11-25 16:38 ` Jens Axboe
0 siblings, 0 replies; 74+ messages in thread
From: Jens Axboe @ 2025-11-25 16:38 UTC (permalink / raw)
To: Christian Brauner, Linus Torvalds
Cc: Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein
On 11/23/25 9:34 AM, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
> ---
> io_uring/mock_file.c | 44 +++++++++++++++-----------------------------
> 1 file changed, 15 insertions(+), 29 deletions(-)
LGTM!
Reviewed-by: Jens Axboe <axboe@kernel.dk>
--
Jens Axboe
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 22/47] ipc: convert do_mq_open() to FD_PREPARE()
2025-11-23 16:33 ` [PATCH v4 22/47] ipc: convert do_mq_open() " Christian Brauner
@ 2025-11-25 22:30 ` Mark Brown
2025-11-26 0:05 ` Linus Torvalds
0 siblings, 1 reply; 74+ messages in thread
From: Mark Brown @ 2025-11-25 22:30 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
[-- Attachment #1: Type: text/plain, Size: 37291 bytes --]
On Sun, Nov 23, 2025 at 05:33:40PM +0100, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
I'm seeing a regression in -next in the LTP mq_open01 test which bisects
to this commit:
tst_test.c:1953: TINFO: LTP version: 20250530
tst_test.c:1956: TINFO: Tested kernel: 6.18.0-rc7-next-20251125 #1 SMP PREEMPT @1764061327 aarch64
tst_kconfig.c:88: TINFO: Parsing kernel config '/proc/config.gz'
tst_test.c:1774: TINFO: Overall timeout per run is 0h 05m 24s
mq_open01.c:226: TINFO: queue name "/test_mqueue"
mq_open01.c:255: TPASS: NORMAL returned: 4: SUCCESS (0)
mq_open01.c:226: TINFO: queue name "/test_mqueue"
mq_open01.c:255: TPASS: NORMAL returned: 4: SUCCESS (0)
mq_open01.c:226: TINFO: queue name "/caaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
mq_open01.c:255: TPASS: NORMAL returned: 4: SUCCESS (0)
mq_open01.c:226: TINFO: queue name "/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
mq_open01.c:272: TPASS: NORMAL returned: -1: ENAMETOOLONG (36)
mq_open01.c:226: TINFO: queue name ""
mq_open01.c:272: TPASS: NORMAL returned: -1: EINVAL (22)
mq_open01.c:226: TINFO: queue name "/test_mqueue"
mq_open01.c:272: TPASS: NORMAL returned: -1: EACCES (13)
mq_open01.c:226: TINFO: queue name "/test_mqueue"
mq_open01.c:272: TPASS: NORMAL returned: -1: EEXIST (17)
mq_open01.c:226: TINFO: queue name "/test_mqueue"
mq_open01.c:272: TPASS: NO_FILE returned: -1: EMFILE (24)
mq_open01.c:226: TINFO: queue name "/notexist"
mq_open01.c:272: TPASS: NORMAL returned: -1: ENOENT (2)
mq_open01.c:226: TINFO: queue name "/test_mqueue"
mq_open01.c:263: TFAIL: NO_SPACE expected errno: 13: EACCES (13)
which bisect to this patch. It's not clear to me if this is an overly
sensitive test or an actual issue.
BTW I do note that the subject says FD_PREPARE() but the patch uses
FD_ADD().
bisect log, including links to full logs from test jobs:
# bad: [92fd6e84175befa1775e5c0ab682938eca27c0b2] Add linux-next specific files for 20251125
# good: [07e9a68478302d35f3372ac8c9994d679a9cfdca] Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/misc/kernel.git
# good: [cb99656b7c4185953c9d272bbdab63c8aa651e6e] spi: Fix potential uninitialized variable in probe()
# good: [df919994d323c7c86e32fa2745730136d58ada12] ASoC: Intel: avs: Replace snprintf() with scnprintf()
# good: [670500b41e543c5cb09eb9f7f0e4e26c5b5fdf7e] regulator: pca9450: Fix error code in probe()
# good: [f1c668269ded16bea32a11d03f4584caa0c018c9] regulator: qcomm-labibb: replace use of system_wq with system_dfl_wq
# good: [3efee7362dbf896072af1c1aaeaf9fd6e235c591] ASoC: SDCA: Add stubs for FDL helper functions
# good: [43a3adb6dd39d98bf84e04569e7604be5e5c0d79] spi: spidev: add compatible for arduino spi mcu interface
# good: [3af1815a2f9caebfc666af3912e24d030a5368d5] ASoC: SDCA: Add basic SDCA function driver
# good: [33822d795ab93067d9a65f42003c0d01c65d4a9d] ASoC: cs35l56: Use SND_SOC_BYTES_E_ACC() for CAL_DATA_RB control
# good: [d5089fffe1db04a802b028c2ef4875be1ed452a3] ASoC: tas2781: Add tas2568/2574/5806m/5806md/5830 support
# good: [12d821bd13d42e6de3ecb1c13918b1f06a3ee213] regulator: Add FP9931/JD9930 driver
# good: [3045e29d248bde2a68da425498a656093ee0df69] firmware: cs_dsp: Append \n to debugfs string during read
# good: [bdf96e9135a0cf53a853a19c30fa11131a744062] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths
# good: [b871d9adffe5a64a1fd9edcb1aebbcc995b17901] regulator: make the subsystem aware of shared GPIOs
# good: [e2c48498a93404743e0565dcac29450fec02e6a3] ASoC: soc-core: Pre-check zero CPU/codec DAIs, handle early rtd->dais alloc failure
# good: [7a0a87712120329c034b0aae88bdaa05bd046f10] ASoC: wsa883x: drop GPIOD_FLAGS_BIT_NONEXCLUSIVE flag from GPIO lookup
# good: [d9813cd23d5a7b254cc1b1c1ea042634d8da62e6] spi: sophgo: Fix incorrect use of bus width value macros
# good: [e45979641a9a9dbb48fc77c5b36a5091a92e7227] ASoC: SOF: sof-client-probes: Replace snprintf() with scnprintf()
# good: [21e68bcb1b0c688c2d9ca0d457922febac650ac1] regulator: renesas-usb-vbus-regulator: Remove unused headers
# good: [d218ea171430e49412804efb794942dd121a8032] ASoC: mediatek: mt8189: add machine driver with nau8825
# good: [bd79452b39c21599e2cff42e9fbeb182656b6f6a] MAINTAINERS: adjust file entry in RISC-V MICROCHIP SUPPORT
# good: [96498e804cb6629e02747336a0a33e4955449732] spi: davinci: remove platform data header
# good: [ab61de9b78dda140573fb474af65f0e1ae13ff5b] mm/migrate, swap: drop usage of folio_index
# good: [0a63a0e7570b9b2631dfb8d836dc572709dce39e] mm/damon/tests/vaddr-kunit: handle alloc failures on damon_test_split_evenly_succ()
# good: [4422df6782eb7aa9725a3c09d9ba3c38ecc85df4] ASoC: ux500: mop500_ab8500: convert to snd_soc_dapm_xxx()
# good: [9e510e677090bb794b46348b10e1c8038286e00a] spi: aspeed: Add support for the AST2700 SPI controller
# good: [d5c8b7902a41625ea328b52c78ebe750fbf6fef7] ASoC: Intel: avs: Honor NHLT override when setting up a path
# good: [118eb2cb97b8fc0d515bb0449495959247db58f0] spi: bcm63xx: drop wrong casts in probe()
# good: [6402ddf3027d8975f135cf2b2014d6bbeb2d3436] MAINTAINERS: refer to trivial-codec.yaml in relevant sections
# good: [059f545832be85d29ac9ccc416a16f647aa78485] spi: add support for microchip "soft" spi controller
# good: [8ff3dcb0e8a8bf6c41f23ed4aa62d066d3948a10] ASoC: codecs: lpass-rx-macro: add SM6115 compatible
# good: [4e00135b2dd1d7924a58bffa551b6ceb3bd836f2] spi: spi-cadence: supports transmission with bits_per_word of 16 and 32
# good: [8d63e85c5b50f1dbfa0ccb214bd91fe5d7e2e860] firmware: cs_dsp: fix kernel-doc warnings in a header file
# good: [e65b871c9b5af9265aefc5b8cd34993586d93aab] ASoC: codecs: pm4125: Remove irq_chip on component unbind
# good: [123cd174a3782307787268adf45f22de4d290128] ASoC: Intel: atom: Replace strcpy() with strscpy()
# good: [1d562ba0aa7df81335bf96c02be77efe8d5bab87] spi: dt-bindings: nuvoton,npcm-pspi: Convert to DT schema
# good: [4d6e2211aeb932e096f673c88475016b1cc0f8ab] ASoC: Intel: boards: fix HDMI playback lookup when HDMI-In capture used
# good: [32172cf3cb543a04c41a1677c97a38e60cad05b6] ASoC: cs35l56: Allow restoring factory calibration through ALSA control
# good: [b3a5302484033331af37569f7277d00131694b57] ASoC: Intel: sof_rt5682: Add quirk override support
# good: [873bc94689d832878befbcadc10b6ad5bb4e0027] ASoC: Intel: sof_sdw: add codec speaker support for the SKU
# good: [772ada50282b0c80343c8989147db816961f571d] ASoC: cs35l56: Alter error codes for calibration routine
# good: [6985defd1d832f1dd9d1977a6a2cc2cef7632704] regmap: sdw-mbq: Reorder regmap_mbq_context struct for better packing
# good: [fb1ebb10468da414d57153ddebaab29c38ef1a78] regulator: core: disable supply if enabling main regulator fails
# good: [6951be397ca8b8b167c9f99b5a11c541148c38cb] ASoC: codecs: pm4125: remove duplicate code
# good: [2089f086303b773e181567fd8d5df3038bd85937] regulator: mt6363: Remove unneeded semicolon
# good: [4e92abd0a11b91af3742197a9ca962c3c00d0948] spi: imx: add i.MX51 ECSPI target mode support
# good: [abc9a349b87ac0fd3ba8787ca00971b59c2e1257] spi: fsl-qspi: support the SpacemiT K1 SoC
# good: [55d03b5b5bdd04daf9a35ce49db18d8bb488dffb] spi: imx: remove CLK calculation and check for target mode
# good: [1b0f3f9ee41ee2bdd206667f85ea2aa36dfe6e69] ASoC: SDCA: support Q7.8 volume format
# good: [6bd1ad97eb790570c167d4de4ca59fbc9c33722a] regulator: pf9453: Fix kernel doc for mux_poll()
# good: [3c36965df80801344850388592e95033eceea05b] regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators
# good: [655079ac8a7721ac215a0596e3f33b740e01144a] ASoC: qcom: q6asm: Use guard() for spin locks
# good: [aa897ffc396b48cc39eee133b6b43175d0df9eb5] ASoC: dt-bindings: ti,pcm1862: convert to dtschema
# good: [2f538ef9f6f7c3d700c68536f21447dfc598f8c8] spi: aspeed: Use devm_iounmap() to unmap devm_ioremap() memory
# good: [c4e68959af66df525d71db619ffe44af9178bb22] ASoC: dt-bindings: ti,tas2781: Add TAS5822 support
# good: [af9c8092d84244ca54ffb590435735f788e7a170] regmap: i3c: Use ARRAY_SIZE()
# good: [380fd29d57abe6679d87ec56babe65ddc5873a37] spi: tegra210-quad: Check hardware status on timeout
# good: [a4438f06b1db15ce3d831ce82b8767665638aa2a] PCI/TSM: Report active IDE streams
# good: [84194c66aaf78fed150edb217b9f341518b1cba2] ASoC: codecs: aw88261: pass pointer directly instead of passing the address
# good: [252abf2d07d33b1c70a59ba1c9395ba42bbd793e] regulator: Small cleanup in of_get_regulation_constraints()
# good: [2ecc8c089802e033d2e5204d21a9f467e2517df9] regulator: pf9453: remove unused I2C_LT register
# good: [ed5d499b5c9cc11dd3edae1a7a55db7dfa4f1bdc] regcache: maple: Split ->populate() from ->init()
# good: [e73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0] ASoC: soc-core: check ops & auto_selectable_formats in snd_soc_dai_get_fmt() to prevent dereference error
# good: [f1dfbc1b5cf8650ae9a0d543e5f5335fc0f478ce] ASoC: max98090/91: fixing the stream index
# good: [ecd0de438c1f0ee86cf8f6d5047965a2a181444b] spi: tle62x0: Add newline to sysfs attribute output
# good: [6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3] ASoC: codec: wm8400: replace printk() calls with dev_*() device aware logging
# good: [cf6bf51b53252284bafc7377a4d8dbf10f048b4d] ASoC: cs4271: Add support for the external mclk
# good: [20bcda681f8597e86070a4b3b12d1e4f541865d3] ASoC: codecs: va-macro: fix revision checking
# good: [8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce] ASoC: qcom: sc7280: make use of common helpers
# good: [28039efa4d8e8bbf98b066133a906bd4e307d496] MAINTAINERS: remove obsolete file entry in DIALOG SEMICONDUCTOR DRIVERS
# good: [e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8] regmap: warn users about uninitialized flat cache
# good: [62fb11fba0cc12ecb808fc57b16027b94bd1ba1a] arm64: dts: renesas: rzt2h/rzn2h-evk: Enable ADCs
# good: [66fecfa91deb536a12ddf3d878a99590d7900277] ASoC: spacemit: use `depends on` instead of `select`
# good: [f034c16a4663eaf3198dc18b201ba50533fb5b81] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
# good: [4a5ac6cd05a7e54f1585d7779464d6ed6272c134] ASoC: sun4i-spdif: Support SPDIF output on A523 family
# good: [4c33cef58965eb655a0ac8e243aa323581ec025f] regulator: pca9450: link regulator inputs to supply groups
# good: [ef042df96d0e1089764f39ede61bc8f140a4be00] ASoC: SDCA: Add HID button IRQ
# good: [4795375d8aa072e9aacb0b278e6203c6ca41816a] ASoC: cs-amp-lib-test: Add test cases for cs_amp_set_efi_calibration_data()
# good: [d29479abaded34b2b1dab2e17efe96a65eba3d61] ASoC: renesas: fsi: Constify struct fsi_stream_handler
# good: [01313661b248c5ba586acae09bff57077dbec0a5] regulator: Let raspberrypi drivers depend on ARM
# good: [e973dfe9259095fb509ab12658c68d46f0e439d7] ASoC: qcom: sm8250: add qrb2210-sndcard compatible string
# good: [e7434adf0c53a84d548226304cdb41c8818da1cb] ASoC: cs530x: Add SPI bus support for cs530x parts
# good: [77a58ba7c64ccca20616aa03599766ccb0d1a330] spi: spi-mem: Trace exec_op
# good: [c17fa4cbc546c431ccf13e9354d5d9c1cd247b7c] ASoC: sdw_utils: add name_prefix for rt1321 part id
# good: [2528c15f314ece50218d1273654f630d74109583] ASoC: max98090/91: adding DAPM routing for digital output for max98091
# good: [d054cc3a2ccfb19484f3b54d69b6e416832dc8f4] regulator: rpmh-regulator: Add RPMH regulator support for PMR735D
# good: [fd5ef3d69f8975bad16c437a337b5cb04c8217a2] spi: spi-qpic-snand: make qcom_spi_ecc_engine_ops_pipelined const
# good: [310bf433c01f78e0756fd5056a43118a2f77318c] ASoC: max98090/91: fixing a space
# good: [638bae3fb225a708dc67db613af62f6d14c4eff4] ASoC: max98090/91: added DAPM widget for digital output for max98091
# good: [32200f4828de9d7e6db379909898e718747f4e18] soc: amlogic: canvas: fix device leak on lookup
# good: [ecba655bf54a661ffe078856cd8dbc898270e4b5] ASoC: fsl_aud2htx: add IEC958_SUBFRAME_LE format in supported list
# good: [7e1906643a7374529af74b013bba35e4fa4e6ffc] ASoC: codecs: va-macro: Clean up on error path in probe()
# good: [d742ebcfe524dc54023f7c520d2ed2e4b7203c19] ASoC: soc.h: remove snd_soc_kcontrol_component()
# good: [fce217449075d59b29052b8cdac567f0f3e22641] ASoC: spacemit: add i2s support for K1 SoC
# good: [6658472a3e2de08197acfe099ba71ee0e2505ecf] ASoC: amd: amd_sdw: Propagate the PCI subsystem Vendor and Device IDs
# good: [0cc08c8130ac8f74419f99fe707dc193b7f79d86] spi: aspeed: Fix an IS_ERR() vs NULL bug in probe()
# good: [e8fd8080e7a9c8c577e5dec5bd6d486a3f14011c] media: i2c: max96717: Use %pe format specifier
# good: [0743acf746a81e0460a56fd5ff847d97fa7eb370] spi: airoha: buffer must be 0xff-ed before writing
# good: [1e570e77392f43a3cdab2849d1f81535f8a033e2] ASoC: mxs-saif: support usage with simple-audio-card
# good: [d77daa49085b067137d0adbe3263f75a7ee13a1b] spi: aspeed: fix spelling mistake "triming" -> "trimming"
# good: [15afe57a874eaf104bfbb61ec598fa31627f7b19] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs
# good: [fb25114cd760c13cf177d9ac37837fafcc9657b5] regulator: sy7636a: add gpios and input regulator
# good: [6621b0f118d500092f5f3d72ddddb22aeeb3c3a0] ASoC: codecs: rt5670: use SOC_VALUE_ENUM_SINGLE_DECL for DAC2 L/R MX-1B
# good: [65efe5404d151767653c7b7dd39bd2e7ad532c2d] regulator: rpmh-regulator: Add RPMH regulator support for Glymur
# good: [433e294c3c5b5d2020085a0e36c1cb47b694690a] regulator: core: forward undervoltage events downstream by default
# good: [0b0eb7702a9fa410755e86124b4b7cd36e7d1cb4] ASoC: replace use of system_wq with system_dfl_wq
# good: [bf770d6d2097a52d87f4d9c88d0b05bd3998d7de] x86/module: Improve relocation error messages
# good: [c2d420796a427dda71a2400909864e7f8e037fd4] elfnote: Change ELFNOTE() to use __UNIQUE_ID()
# good: [7e7e2c6e2a1cb250f8d03bb99eed01f6d982d5dd] ASoC: sof-function-topology-lib: escalate the log when missing function topoplogy
# good: [9797329220a2c6622411eb9ecf6a35b24ce09d04] ASoC: sof-function-topology-lib: escalate the log when missing function topoplogy
# good: [fe8cc44dd173cde5788ab4e3730ac61f3d316d9c] spi: dw: add target mode support
# good: [4d410ba9aa275e7990a270f63ce436990ace1bea] dt-bindings: sound: Update ADMAIF bindings for tegra264
# good: [64d87ccfae3326a9561fe41dc6073064a083e0df] spi: aspeed: Only map necessary address window region
# good: [6277a486a7faaa6c87f4bf1d59a2de233a093248] regulator: dt-bindings: Convert Dialog DA9211 Regulators to DT schema
# good: [b83fb1b14c06bdd765903ac852ba20a14e24f227] spi: offload: Add offset parameter
# good: [5e537031f322d55315cd384398b726a9a0748d47] ASoC: codecs: Fix the error of excessive semicolons
# good: [4412ab501677606436e5c49e41151a1e6eac7ac0] spi: dt-bindings: spi-qpic-snand: Add IPQ5332 compatible
# good: [7e1fe102c8517a402327c37685357fbe279b3278] drm/xe/guc: Track pending-enable source in submission state
# good: [cc7e1a9b596c9d9dc3324c056cf8162e9fca2765] drm/i915/irq: duplicate HAS_FBC() for irq error mask usage
# good: [6c177775dcc5e70a64ddf4ee842c66af498f2c7c] Merge branch 'next/drivers' into for-next
git bisect start '92fd6e84175befa1775e5c0ab682938eca27c0b2' '07e9a68478302d35f3372ac8c9994d679a9cfdca' 'cb99656b7c4185953c9d272bbdab63c8aa651e6e' 'df919994d323c7c86e32fa2745730136d58ada12' '670500b41e543c5cb09eb9f7f0e4e26c5b5fdf7e' 'f1c668269ded16bea32a11d03f4584caa0c018c9' '3efee7362dbf896072af1c1aaeaf9fd6e235c591' '43a3adb6dd39d98bf84e04569e7604be5e5c0d79' '3af1815a2f9caebfc666af3912e24d030a5368d5' '33822d795ab93067d9a65f42003c0d01c65d4a9d' 'd5089fffe1db04a802b028c2ef4875be1ed452a3' '12d821bd13d42e6de3ecb1c13918b1f06a3ee213' '3045e29d248bde2a68da425498a656093ee0df69' 'bdf96e9135a0cf53a853a19c30fa11131a744062' 'b871d9adffe5a64a1fd9edcb1aebbcc995b17901' 'e2c48498a93404743e0565dcac29450fec02e6a3' '7a0a87712120329c034b0aae88bdaa05bd046f10' 'd9813cd23d5a7b254cc1b1c1ea042634d8da62e6' 'e45979641a9a9dbb48fc77c5b36a5091a92e7227' '21e68bcb1b0c688c2d9ca0d457922febac650ac1' 'd218ea171430e49412804efb794942dd121a8032' 'bd79452b39c21599e2cff42e9fbeb182656b6f6a' '96498e804cb6629e02747336a0a33e4955449732' 'ab61de9b78dda140573fb474af65f0e1ae13ff5b' '0a63a0e7570b9b2631dfb8d836dc572709dce39e' '4422df6782eb7aa9725a3c09d9ba3c38ecc85df4' '9e510e677090bb794b46348b10e1c8038286e00a' 'd5c8b7902a41625ea328b52c78ebe750fbf6fef7' '118eb2cb97b8fc0d515bb0449495959247db58f0' '6402ddf3027d8975f135cf2b2014d6bbeb2d3436' '059f545832be85d29ac9ccc416a16f647aa78485' '8ff3dcb0e8a8bf6c41f23ed4aa62d066d3948a10' '4e00135b2dd1d7924a58bffa551b6ceb3bd836f2' '8d63e85c5b50f1dbfa0ccb214bd91fe5d7e2e860' 'e65b871c9b5af9265aefc5b8cd34993586d93aab' '123cd174a3782307787268adf45f22de4d290128' '1d562ba0aa7df81335bf96c02be77efe8d5bab87' '4d6e2211aeb932e096f673c88475016b1cc0f8ab' '32172cf3cb543a04c41a1677c97a38e60cad05b6' 'b3a5302484033331af37569f7277d00131694b57' '873bc94689d832878befbcadc10b6ad5bb4e0027' '772ada50282b0c80343c8989147db816961f571d' '6985defd1d832f1dd9d1977a6a2cc2cef7632704' 'fb1ebb10468da414d57153ddebaab29c38ef1a78' '6951be397ca8b8b167c9f99b5a11c541148c38cb' '2089f086303b773e181567fd8d5df3038bd85937' '4e92abd0a11b91af3742197a9ca962c3c00d0948' 'abc9a349b87ac0fd3ba8787ca00971b59c2e1257' '55d03b5b5bdd04daf9a35ce49db18d8bb488dffb' '1b0f3f9ee41ee2bdd206667f85ea2aa36dfe6e69' '6bd1ad97eb790570c167d4de4ca59fbc9c33722a' '3c36965df80801344850388592e95033eceea05b' '655079ac8a7721ac215a0596e3f33b740e01144a' 'aa897ffc396b48cc39eee133b6b43175d0df9eb5' '2f538ef9f6f7c3d700c68536f21447dfc598f8c8' 'c4e68959af66df525d71db619ffe44af9178bb22' 'af9c8092d84244ca54ffb590435735f788e7a170' '380fd29d57abe6679d87ec56babe65ddc5873a37' 'a4438f06b1db15ce3d831ce82b8767665638aa2a' '84194c66aaf78fed150edb217b9f341518b1cba2' '252abf2d07d33b1c70a59ba1c9395ba42bbd793e' '2ecc8c089802e033d2e5204d21a9f467e2517df9' 'ed5d499b5c9cc11dd3edae1a7a55db7dfa4f1bdc' 'e73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0' 'f1dfbc1b5cf8650ae9a0d543e5f5335fc0f478ce' 'ecd0de438c1f0ee86cf8f6d5047965a2a181444b' '6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3' 'cf6bf51b53252284bafc7377a4d8dbf10f048b4d' '20bcda681f8597e86070a4b3b12d1e4f541865d3' '8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce' '28039efa4d8e8bbf98b066133a906bd4e307d496' 'e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8' '62fb11fba0cc12ecb808fc57b16027b94bd1ba1a' '66fecfa91deb536a12ddf3d878a99590d7900277' 'f034c16a4663eaf3198dc18b201ba50533fb5b81' '4a5ac6cd05a7e54f1585d7779464d6ed6272c134' '4c33cef58965eb655a0ac8e243aa323581ec025f' 'ef042df96d0e1089764f39ede61bc8f140a4be00' '4795375d8aa072e9aacb0b278e6203c6ca41816a' 'd29479abaded34b2b1dab2e17efe96a65eba3d61' '01313661b248c5ba586acae09bff57077dbec0a5' 'e973dfe9259095fb509ab12658c68d46f0e439d7' 'e7434adf0c53a84d548226304cdb41c8818da1cb' '77a58ba7c64ccca20616aa03599766ccb0d1a330' 'c17fa4cbc546c431ccf13e9354d5d9c1cd247b7c' '2528c15f314ece50218d1273654f630d74109583' 'd054cc3a2ccfb19484f3b54d69b6e416832dc8f4' 'fd5ef3d69f8975bad16c437a337b5cb04c8217a2' '310bf433c01f78e0756fd5056a43118a2f77318c' '638bae3fb225a708dc67db613af62f6d14c4eff4' '32200f4828de9d7e6db379909898e718747f4e18' 'ecba655bf54a661ffe078856cd8dbc898270e4b5' '7e1906643a7374529af74b013bba35e4fa4e6ffc' 'd742ebcfe524dc54023f7c520d2ed2e4b7203c19' 'fce217449075d59b29052b8cdac567f0f3e22641' '6658472a3e2de08197acfe099ba71ee0e2505ecf' '0cc08c8130ac8f74419f99fe707dc193b7f79d86' 'e8fd8080e7a9c8c577e5dec5bd6d486a3f14011c' '0743acf746a81e0460a56fd5ff847d97fa7eb370' '1e570e77392f43a3cdab2849d1f81535f8a033e2' 'd77daa49085b067137d0adbe3263f75a7ee13a1b' '15afe57a874eaf104bfbb61ec598fa31627f7b19' 'fb25114cd760c13cf177d9ac37837fafcc9657b5' '6621b0f118d500092f5f3d72ddddb22aeeb3c3a0' '65efe5404d151767653c7b7dd39bd2e7ad532c2d' '433e294c3c5b5d2020085a0e36c1cb47b694690a' '0b0eb7702a9fa410755e86124b4b7cd36e7d1cb4' 'bf770d6d2097a52d87f4d9c88d0b05bd3998d7de' 'c2d420796a427dda71a2400909864e7f8e037fd4' '7e7e2c6e2a1cb250f8d03bb99eed01f6d982d5dd' '9797329220a2c6622411eb9ecf6a35b24ce09d04' 'fe8cc44dd173cde5788ab4e3730ac61f3d316d9c' '4d410ba9aa275e7990a270f63ce436990ace1bea' '64d87ccfae3326a9561fe41dc6073064a083e0df' '6277a486a7faaa6c87f4bf1d59a2de233a093248' 'b83fb1b14c06bdd765903ac852ba20a14e24f227' '5e537031f322d55315cd384398b726a9a0748d47' '4412ab501677606436e5c49e41151a1e6eac7ac0' '7e1fe102c8517a402327c37685357fbe279b3278' 'cc7e1a9b596c9d9dc3324c056cf8162e9fca2765' '6c177775dcc5e70a64ddf4ee842c66af498f2c7c'
# test job: [cb99656b7c4185953c9d272bbdab63c8aa651e6e] https://lava.sirena.org.uk/scheduler/job/2132768
# test job: [df919994d323c7c86e32fa2745730136d58ada12] https://lava.sirena.org.uk/scheduler/job/2121675
# test job: [670500b41e543c5cb09eb9f7f0e4e26c5b5fdf7e] https://lava.sirena.org.uk/scheduler/job/2121060
# test job: [f1c668269ded16bea32a11d03f4584caa0c018c9] https://lava.sirena.org.uk/scheduler/job/2113575
# test job: [3efee7362dbf896072af1c1aaeaf9fd6e235c591] https://lava.sirena.org.uk/scheduler/job/2115151
# test job: [43a3adb6dd39d98bf84e04569e7604be5e5c0d79] https://lava.sirena.org.uk/scheduler/job/2115059
# test job: [3af1815a2f9caebfc666af3912e24d030a5368d5] https://lava.sirena.org.uk/scheduler/job/2115418
# test job: [33822d795ab93067d9a65f42003c0d01c65d4a9d] https://lava.sirena.org.uk/scheduler/job/2112462
# test job: [d5089fffe1db04a802b028c2ef4875be1ed452a3] https://lava.sirena.org.uk/scheduler/job/2111808
# test job: [12d821bd13d42e6de3ecb1c13918b1f06a3ee213] https://lava.sirena.org.uk/scheduler/job/2112910
# test job: [3045e29d248bde2a68da425498a656093ee0df69] https://lava.sirena.org.uk/scheduler/job/2111757
# test job: [bdf96e9135a0cf53a853a19c30fa11131a744062] https://lava.sirena.org.uk/scheduler/job/2109772
# test job: [b871d9adffe5a64a1fd9edcb1aebbcc995b17901] https://lava.sirena.org.uk/scheduler/job/2107869
# test job: [e2c48498a93404743e0565dcac29450fec02e6a3] https://lava.sirena.org.uk/scheduler/job/2107331
# test job: [7a0a87712120329c034b0aae88bdaa05bd046f10] https://lava.sirena.org.uk/scheduler/job/2107505
# test job: [d9813cd23d5a7b254cc1b1c1ea042634d8da62e6] https://lava.sirena.org.uk/scheduler/job/2105371
# test job: [e45979641a9a9dbb48fc77c5b36a5091a92e7227] https://lava.sirena.org.uk/scheduler/job/2104424
# test job: [21e68bcb1b0c688c2d9ca0d457922febac650ac1] https://lava.sirena.org.uk/scheduler/job/2104496
# test job: [d218ea171430e49412804efb794942dd121a8032] https://lava.sirena.org.uk/scheduler/job/2104281
# test job: [bd79452b39c21599e2cff42e9fbeb182656b6f6a] https://lava.sirena.org.uk/scheduler/job/2104080
# test job: [96498e804cb6629e02747336a0a33e4955449732] https://lava.sirena.org.uk/scheduler/job/2099775
# test job: [ab61de9b78dda140573fb474af65f0e1ae13ff5b] https://lava.sirena.org.uk/scheduler/job/2107135
# test job: [0a63a0e7570b9b2631dfb8d836dc572709dce39e] https://lava.sirena.org.uk/scheduler/job/2107227
# test job: [4422df6782eb7aa9725a3c09d9ba3c38ecc85df4] https://lava.sirena.org.uk/scheduler/job/2097769
# test job: [9e510e677090bb794b46348b10e1c8038286e00a] https://lava.sirena.org.uk/scheduler/job/2093926
# test job: [d5c8b7902a41625ea328b52c78ebe750fbf6fef7] https://lava.sirena.org.uk/scheduler/job/2092750
# test job: [118eb2cb97b8fc0d515bb0449495959247db58f0] https://lava.sirena.org.uk/scheduler/job/2092501
# test job: [6402ddf3027d8975f135cf2b2014d6bbeb2d3436] https://lava.sirena.org.uk/scheduler/job/2086626
# test job: [059f545832be85d29ac9ccc416a16f647aa78485] https://lava.sirena.org.uk/scheduler/job/2086745
# test job: [8ff3dcb0e8a8bf6c41f23ed4aa62d066d3948a10] https://lava.sirena.org.uk/scheduler/job/2083097
# test job: [4e00135b2dd1d7924a58bffa551b6ceb3bd836f2] https://lava.sirena.org.uk/scheduler/job/2082513
# test job: [8d63e85c5b50f1dbfa0ccb214bd91fe5d7e2e860] https://lava.sirena.org.uk/scheduler/job/2082647
# test job: [e65b871c9b5af9265aefc5b8cd34993586d93aab] https://lava.sirena.org.uk/scheduler/job/2083140
# test job: [123cd174a3782307787268adf45f22de4d290128] https://lava.sirena.org.uk/scheduler/job/2078931
# test job: [1d562ba0aa7df81335bf96c02be77efe8d5bab87] https://lava.sirena.org.uk/scheduler/job/2078338
# test job: [4d6e2211aeb932e096f673c88475016b1cc0f8ab] https://lava.sirena.org.uk/scheduler/job/2078005
# test job: [32172cf3cb543a04c41a1677c97a38e60cad05b6] https://lava.sirena.org.uk/scheduler/job/2075070
# test job: [b3a5302484033331af37569f7277d00131694b57] https://lava.sirena.org.uk/scheduler/job/2074541
# test job: [873bc94689d832878befbcadc10b6ad5bb4e0027] https://lava.sirena.org.uk/scheduler/job/2074811
# test job: [772ada50282b0c80343c8989147db816961f571d] https://lava.sirena.org.uk/scheduler/job/2069227
# test job: [6985defd1d832f1dd9d1977a6a2cc2cef7632704] https://lava.sirena.org.uk/scheduler/job/2059096
# test job: [fb1ebb10468da414d57153ddebaab29c38ef1a78] https://lava.sirena.org.uk/scheduler/job/2059791
# test job: [6951be397ca8b8b167c9f99b5a11c541148c38cb] https://lava.sirena.org.uk/scheduler/job/2055762
# test job: [2089f086303b773e181567fd8d5df3038bd85937] https://lava.sirena.org.uk/scheduler/job/2058088
# test job: [4e92abd0a11b91af3742197a9ca962c3c00d0948] https://lava.sirena.org.uk/scheduler/job/2055840
# test job: [abc9a349b87ac0fd3ba8787ca00971b59c2e1257] https://lava.sirena.org.uk/scheduler/job/2054599
# test job: [55d03b5b5bdd04daf9a35ce49db18d8bb488dffb] https://lava.sirena.org.uk/scheduler/job/2053852
# test job: [1b0f3f9ee41ee2bdd206667f85ea2aa36dfe6e69] https://lava.sirena.org.uk/scheduler/job/2053505
# test job: [6bd1ad97eb790570c167d4de4ca59fbc9c33722a] https://lava.sirena.org.uk/scheduler/job/2053466
# test job: [3c36965df80801344850388592e95033eceea05b] https://lava.sirena.org.uk/scheduler/job/2049477
# test job: [655079ac8a7721ac215a0596e3f33b740e01144a] https://lava.sirena.org.uk/scheduler/job/2049691
# test job: [aa897ffc396b48cc39eee133b6b43175d0df9eb5] https://lava.sirena.org.uk/scheduler/job/2048778
# test job: [2f538ef9f6f7c3d700c68536f21447dfc598f8c8] https://lava.sirena.org.uk/scheduler/job/2048662
# test job: [c4e68959af66df525d71db619ffe44af9178bb22] https://lava.sirena.org.uk/scheduler/job/2044045
# test job: [af9c8092d84244ca54ffb590435735f788e7a170] https://lava.sirena.org.uk/scheduler/job/2043672
# test job: [380fd29d57abe6679d87ec56babe65ddc5873a37] https://lava.sirena.org.uk/scheduler/job/2044567
# test job: [a4438f06b1db15ce3d831ce82b8767665638aa2a] https://lava.sirena.org.uk/scheduler/job/2081108
# test job: [84194c66aaf78fed150edb217b9f341518b1cba2] https://lava.sirena.org.uk/scheduler/job/2038363
# test job: [252abf2d07d33b1c70a59ba1c9395ba42bbd793e] https://lava.sirena.org.uk/scheduler/job/2038539
# test job: [2ecc8c089802e033d2e5204d21a9f467e2517df9] https://lava.sirena.org.uk/scheduler/job/2038647
# test job: [ed5d499b5c9cc11dd3edae1a7a55db7dfa4f1bdc] https://lava.sirena.org.uk/scheduler/job/2029010
# test job: [e73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0] https://lava.sirena.org.uk/scheduler/job/2026440
# test job: [f1dfbc1b5cf8650ae9a0d543e5f5335fc0f478ce] https://lava.sirena.org.uk/scheduler/job/2025486
# test job: [ecd0de438c1f0ee86cf8f6d5047965a2a181444b] https://lava.sirena.org.uk/scheduler/job/2026128
# test job: [6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3] https://lava.sirena.org.uk/scheduler/job/2025859
# test job: [cf6bf51b53252284bafc7377a4d8dbf10f048b4d] https://lava.sirena.org.uk/scheduler/job/2022941
# test job: [20bcda681f8597e86070a4b3b12d1e4f541865d3] https://lava.sirena.org.uk/scheduler/job/2022962
# test job: [8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce] https://lava.sirena.org.uk/scheduler/job/2021463
# test job: [28039efa4d8e8bbf98b066133a906bd4e307d496] https://lava.sirena.org.uk/scheduler/job/2020286
# test job: [e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8] https://lava.sirena.org.uk/scheduler/job/2020185
# test job: [62fb11fba0cc12ecb808fc57b16027b94bd1ba1a] https://lava.sirena.org.uk/scheduler/job/2106794
# test job: [66fecfa91deb536a12ddf3d878a99590d7900277] https://lava.sirena.org.uk/scheduler/job/2015341
# test job: [f034c16a4663eaf3198dc18b201ba50533fb5b81] https://lava.sirena.org.uk/scheduler/job/2015423
# test job: [4a5ac6cd05a7e54f1585d7779464d6ed6272c134] https://lava.sirena.org.uk/scheduler/job/2011278
# test job: [4c33cef58965eb655a0ac8e243aa323581ec025f] https://lava.sirena.org.uk/scheduler/job/2009453
# test job: [ef042df96d0e1089764f39ede61bc8f140a4be00] https://lava.sirena.org.uk/scheduler/job/2010152
# test job: [4795375d8aa072e9aacb0b278e6203c6ca41816a] https://lava.sirena.org.uk/scheduler/job/2009687
# test job: [d29479abaded34b2b1dab2e17efe96a65eba3d61] https://lava.sirena.org.uk/scheduler/job/2008427
# test job: [01313661b248c5ba586acae09bff57077dbec0a5] https://lava.sirena.org.uk/scheduler/job/2008854
# test job: [e973dfe9259095fb509ab12658c68d46f0e439d7] https://lava.sirena.org.uk/scheduler/job/2008111
# test job: [e7434adf0c53a84d548226304cdb41c8818da1cb] https://lava.sirena.org.uk/scheduler/job/2007797
# test job: [77a58ba7c64ccca20616aa03599766ccb0d1a330] https://lava.sirena.org.uk/scheduler/job/2007347
# test job: [c17fa4cbc546c431ccf13e9354d5d9c1cd247b7c] https://lava.sirena.org.uk/scheduler/job/2004856
# test job: [2528c15f314ece50218d1273654f630d74109583] https://lava.sirena.org.uk/scheduler/job/1997633
# test job: [d054cc3a2ccfb19484f3b54d69b6e416832dc8f4] https://lava.sirena.org.uk/scheduler/job/1995736
# test job: [fd5ef3d69f8975bad16c437a337b5cb04c8217a2] https://lava.sirena.org.uk/scheduler/job/1996130
# test job: [310bf433c01f78e0756fd5056a43118a2f77318c] https://lava.sirena.org.uk/scheduler/job/1996059
# test job: [638bae3fb225a708dc67db613af62f6d14c4eff4] https://lava.sirena.org.uk/scheduler/job/1991850
# test job: [32200f4828de9d7e6db379909898e718747f4e18] https://lava.sirena.org.uk/scheduler/job/2106716
# test job: [ecba655bf54a661ffe078856cd8dbc898270e4b5] https://lava.sirena.org.uk/scheduler/job/1985174
# test job: [7e1906643a7374529af74b013bba35e4fa4e6ffc] https://lava.sirena.org.uk/scheduler/job/1978628
# test job: [d742ebcfe524dc54023f7c520d2ed2e4b7203c19] https://lava.sirena.org.uk/scheduler/job/1975988
# test job: [fce217449075d59b29052b8cdac567f0f3e22641] https://lava.sirena.org.uk/scheduler/job/1975641
# test job: [6658472a3e2de08197acfe099ba71ee0e2505ecf] https://lava.sirena.org.uk/scheduler/job/1973472
# test job: [0cc08c8130ac8f74419f99fe707dc193b7f79d86] https://lava.sirena.org.uk/scheduler/job/1965714
# test job: [e8fd8080e7a9c8c577e5dec5bd6d486a3f14011c] https://lava.sirena.org.uk/scheduler/job/1978820
# test job: [0743acf746a81e0460a56fd5ff847d97fa7eb370] https://lava.sirena.org.uk/scheduler/job/1964870
# test job: [1e570e77392f43a3cdab2849d1f81535f8a033e2] https://lava.sirena.org.uk/scheduler/job/1962304
# test job: [d77daa49085b067137d0adbe3263f75a7ee13a1b] https://lava.sirena.org.uk/scheduler/job/1964717
# test job: [15afe57a874eaf104bfbb61ec598fa31627f7b19] https://lava.sirena.org.uk/scheduler/job/1962971
# test job: [fb25114cd760c13cf177d9ac37837fafcc9657b5] https://lava.sirena.org.uk/scheduler/job/1961714
# test job: [6621b0f118d500092f5f3d72ddddb22aeeb3c3a0] https://lava.sirena.org.uk/scheduler/job/1959760
# test job: [65efe5404d151767653c7b7dd39bd2e7ad532c2d] https://lava.sirena.org.uk/scheduler/job/1959953
# test job: [433e294c3c5b5d2020085a0e36c1cb47b694690a] https://lava.sirena.org.uk/scheduler/job/1957700
# test job: [0b0eb7702a9fa410755e86124b4b7cd36e7d1cb4] https://lava.sirena.org.uk/scheduler/job/1957382
# test job: [bf770d6d2097a52d87f4d9c88d0b05bd3998d7de] https://lava.sirena.org.uk/scheduler/job/1984502
# test job: [c2d420796a427dda71a2400909864e7f8e037fd4] https://lava.sirena.org.uk/scheduler/job/1984566
# test job: [7e7e2c6e2a1cb250f8d03bb99eed01f6d982d5dd] https://lava.sirena.org.uk/scheduler/job/1957243
# test job: [9797329220a2c6622411eb9ecf6a35b24ce09d04] https://lava.sirena.org.uk/scheduler/job/1947384
# test job: [fe8cc44dd173cde5788ab4e3730ac61f3d316d9c] https://lava.sirena.org.uk/scheduler/job/1946045
# test job: [4d410ba9aa275e7990a270f63ce436990ace1bea] https://lava.sirena.org.uk/scheduler/job/1947757
# test job: [64d87ccfae3326a9561fe41dc6073064a083e0df] https://lava.sirena.org.uk/scheduler/job/1953765
# test job: [6277a486a7faaa6c87f4bf1d59a2de233a093248] https://lava.sirena.org.uk/scheduler/job/1947001
# test job: [b83fb1b14c06bdd765903ac852ba20a14e24f227] https://lava.sirena.org.uk/scheduler/job/1946839
# test job: [5e537031f322d55315cd384398b726a9a0748d47] https://lava.sirena.org.uk/scheduler/job/1946680
# test job: [4412ab501677606436e5c49e41151a1e6eac7ac0] https://lava.sirena.org.uk/scheduler/job/1946304
# test job: [7e1fe102c8517a402327c37685357fbe279b3278] https://lava.sirena.org.uk/scheduler/job/1982084
# test job: [cc7e1a9b596c9d9dc3324c056cf8162e9fca2765] https://lava.sirena.org.uk/scheduler/job/1981487
# test job: [6c177775dcc5e70a64ddf4ee842c66af498f2c7c] https://lava.sirena.org.uk/scheduler/job/2081200
# test job: [92fd6e84175befa1775e5c0ab682938eca27c0b2] https://lava.sirena.org.uk/scheduler/job/2134785
# bad: [92fd6e84175befa1775e5c0ab682938eca27c0b2] Add linux-next specific files for 20251125
git bisect bad 92fd6e84175befa1775e5c0ab682938eca27c0b2
# test job: [bfda4f7f7c8a71d3fa9e0e062f64e3e03b401ce0] https://lava.sirena.org.uk/scheduler/job/2134899
# bad: [bfda4f7f7c8a71d3fa9e0e062f64e3e03b401ce0] Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
git bisect bad bfda4f7f7c8a71d3fa9e0e062f64e3e03b401ce0
# test job: [614ad23e61af8a745bfdfe50b09870560e5f73f9] https://lava.sirena.org.uk/scheduler/job/2135009
# bad: [614ad23e61af8a745bfdfe50b09870560e5f73f9] Merge branch 'fs-next' of linux-next
git bisect bad 614ad23e61af8a745bfdfe50b09870560e5f73f9
# test job: [f9b99d86d8fde5007a7c52347efac13566f8c160] https://lava.sirena.org.uk/scheduler/job/2135145
# good: [f9b99d86d8fde5007a7c52347efac13566f8c160] Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap.git
git bisect good f9b99d86d8fde5007a7c52347efac13566f8c160
# test job: [6dcee998bc550ca1f4d93ada88ddf3ddf88278b5] https://lava.sirena.org.uk/scheduler/job/2135213
# bad: [6dcee998bc550ca1f4d93ada88ddf3ddf88278b5] Merge branch 'vfs.all' of https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
git bisect bad 6dcee998bc550ca1f4d93ada88ddf3ddf88278b5
# test job: [4d8cb2518d6f29e24b1df6609ee32cab7e76aa7c] https://lava.sirena.org.uk/scheduler/job/2135251
# bad: [4d8cb2518d6f29e24b1df6609ee32cab7e76aa7c] Merge branch 'vfs-6.19.fd_prepare' into vfs.all
git bisect bad 4d8cb2518d6f29e24b1df6609ee32cab7e76aa7c
# test job: [fbcf11d2838ae1df75ef10856e31fbbdd001baa5] https://lava.sirena.org.uk/scheduler/job/2135311
# good: [fbcf11d2838ae1df75ef10856e31fbbdd001baa5] Merge branch 'namespace-6.19' into vfs.all
git bisect good fbcf11d2838ae1df75ef10856e31fbbdd001baa5
# test job: [5d1eb038b7d7bc0262cb153f84a6cdec4b95ba16] https://lava.sirena.org.uk/scheduler/job/2135397
# good: [5d1eb038b7d7bc0262cb153f84a6cdec4b95ba16] Merge branch 'vfs-6.19.directory.delegations' into vfs.all
git bisect good 5d1eb038b7d7bc0262cb153f84a6cdec4b95ba16
# test job: [d6ef072d09b2341e606aeeaf14c3510dec329c63] https://lava.sirena.org.uk/scheduler/job/2135492
# good: [d6ef072d09b2341e606aeeaf14c3510dec329c63] ovl: reflow ovl_create_or_link()
git bisect good d6ef072d09b2341e606aeeaf14c3510dec329c63
# test job: [b27548e6abcc0d771eda10b8ed5aaac5d53ef421] https://lava.sirena.org.uk/scheduler/job/2135565
# bad: [b27548e6abcc0d771eda10b8ed5aaac5d53ef421] spufs: convert spufs_context_open() to FD_PREPARE()
git bisect bad b27548e6abcc0d771eda10b8ed5aaac5d53ef421
# test job: [6d6454e55b4c84edf4a7914dd0d7033a7b5d0839] https://lava.sirena.org.uk/scheduler/job/2135612
# good: [6d6454e55b4c84edf4a7914dd0d7033a7b5d0839] userfaultfd: convert new_userfaultfd() to FD_PREPARE()
git bisect good 6d6454e55b4c84edf4a7914dd0d7033a7b5d0839
# test job: [ea66cee99ff4a3e43a9a2356e018473f5dc69872] https://lava.sirena.org.uk/scheduler/job/2135809
# bad: [ea66cee99ff4a3e43a9a2356e018473f5dc69872] bpf: convert bpf_token_create() to FD_PREPARE()
git bisect bad ea66cee99ff4a3e43a9a2356e018473f5dc69872
# test job: [d67145b51ed0f07a9f68dfe82ec1543c930f2762] https://lava.sirena.org.uk/scheduler/job/2136116
# good: [d67145b51ed0f07a9f68dfe82ec1543c930f2762] dma: convert sync_file_ioctl_merge() to FD_PREPARE()
git bisect good d67145b51ed0f07a9f68dfe82ec1543c930f2762
# test job: [a8dc46d4c3038aaa6f6fee37e7a938bda1967abf] https://lava.sirena.org.uk/scheduler/job/2136588
# bad: [a8dc46d4c3038aaa6f6fee37e7a938bda1967abf] ipc: convert do_mq_open() to FD_ADD()
git bisect bad a8dc46d4c3038aaa6f6fee37e7a938bda1967abf
# test job: [fe3e2fc8236bff97cfd5eb8e69350c0b8567bed2] https://lava.sirena.org.uk/scheduler/job/2136813
# good: [fe3e2fc8236bff97cfd5eb8e69350c0b8567bed2] exec: convert begin_new_exec() to FD_PREPARE()
git bisect good fe3e2fc8236bff97cfd5eb8e69350c0b8567bed2
# first bad commit: [a8dc46d4c3038aaa6f6fee37e7a938bda1967abf] ipc: convert do_mq_open() to FD_ADD()
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 42/47] tty: convert ptm_open_peer() to FD_PREPARE()
2025-11-23 16:34 ` [PATCH v4 42/47] tty: convert ptm_open_peer() " Christian Brauner
@ 2025-11-25 22:39 ` Mark Brown
2025-11-26 13:35 ` Christian Brauner
0 siblings, 1 reply; 74+ messages in thread
From: Mark Brown @ 2025-11-25 22:39 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
[-- Attachment #1: Type: text/plain, Size: 34408 bytes --]
On Sun, Nov 23, 2025 at 05:34:00PM +0100, Christian Brauner wrote:
> Signed-off-by: Christian Brauner <brauner@kernel.org>
> - fd_install(fd, filp);
> + fd = FD_ADD(flags, dentry_open(&path, flags, current_cred()));
> + if (fd < 0)
> + mntput(path.mnt);
I'm seeing a regression in -next in the filesystems devpts_pts kselftest
which bisects to this patch:
# selftests: filesystems: devpts_pts
# Failed to perform TIOCGPTPEER ioctl
# Failed to unmount "/dev/pts": Device or resource busy
not ok 1 selftests: filesystems: devpts_pts # exit=1
Full log:
https://lava.sirena.org.uk/scheduler/job/2134811#L6956
This one seems more clearly like a real problem than the other issue in
the same series that I just reported, but I've only given this the most
superficial look so possibly it's a test issue. As with that one the
subject says FD_PREPARE() but the patch actually converts to FD_ADD().
bisect log:
# bad: [92fd6e84175befa1775e5c0ab682938eca27c0b2] Add linux-next specific files for 20251125
# good: [07e9a68478302d35f3372ac8c9994d679a9cfdca] Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/misc/kernel.git
# good: [cb99656b7c4185953c9d272bbdab63c8aa651e6e] spi: Fix potential uninitialized variable in probe()
# good: [df919994d323c7c86e32fa2745730136d58ada12] ASoC: Intel: avs: Replace snprintf() with scnprintf()
# good: [670500b41e543c5cb09eb9f7f0e4e26c5b5fdf7e] regulator: pca9450: Fix error code in probe()
# good: [3af1815a2f9caebfc666af3912e24d030a5368d5] ASoC: SDCA: Add basic SDCA function driver
# good: [3efee7362dbf896072af1c1aaeaf9fd6e235c591] ASoC: SDCA: Add stubs for FDL helper functions
# good: [f1c668269ded16bea32a11d03f4584caa0c018c9] regulator: qcomm-labibb: replace use of system_wq with system_dfl_wq
# good: [43a3adb6dd39d98bf84e04569e7604be5e5c0d79] spi: spidev: add compatible for arduino spi mcu interface
# good: [33822d795ab93067d9a65f42003c0d01c65d4a9d] ASoC: cs35l56: Use SND_SOC_BYTES_E_ACC() for CAL_DATA_RB control
# good: [d5089fffe1db04a802b028c2ef4875be1ed452a3] ASoC: tas2781: Add tas2568/2574/5806m/5806md/5830 support
# good: [12d821bd13d42e6de3ecb1c13918b1f06a3ee213] regulator: Add FP9931/JD9930 driver
# good: [3045e29d248bde2a68da425498a656093ee0df69] firmware: cs_dsp: Append \n to debugfs string during read
# good: [bdf96e9135a0cf53a853a19c30fa11131a744062] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths
# good: [e2c48498a93404743e0565dcac29450fec02e6a3] ASoC: soc-core: Pre-check zero CPU/codec DAIs, handle early rtd->dais alloc failure
# good: [7a0a87712120329c034b0aae88bdaa05bd046f10] ASoC: wsa883x: drop GPIOD_FLAGS_BIT_NONEXCLUSIVE flag from GPIO lookup
# good: [b871d9adffe5a64a1fd9edcb1aebbcc995b17901] regulator: make the subsystem aware of shared GPIOs
# good: [d9813cd23d5a7b254cc1b1c1ea042634d8da62e6] spi: sophgo: Fix incorrect use of bus width value macros
# good: [e45979641a9a9dbb48fc77c5b36a5091a92e7227] ASoC: SOF: sof-client-probes: Replace snprintf() with scnprintf()
# good: [d218ea171430e49412804efb794942dd121a8032] ASoC: mediatek: mt8189: add machine driver with nau8825
# good: [21e68bcb1b0c688c2d9ca0d457922febac650ac1] regulator: renesas-usb-vbus-regulator: Remove unused headers
# good: [bd79452b39c21599e2cff42e9fbeb182656b6f6a] MAINTAINERS: adjust file entry in RISC-V MICROCHIP SUPPORT
# good: [96498e804cb6629e02747336a0a33e4955449732] spi: davinci: remove platform data header
# good: [9e510e677090bb794b46348b10e1c8038286e00a] spi: aspeed: Add support for the AST2700 SPI controller
# good: [4422df6782eb7aa9725a3c09d9ba3c38ecc85df4] ASoC: ux500: mop500_ab8500: convert to snd_soc_dapm_xxx()
# good: [d5c8b7902a41625ea328b52c78ebe750fbf6fef7] ASoC: Intel: avs: Honor NHLT override when setting up a path
# good: [118eb2cb97b8fc0d515bb0449495959247db58f0] spi: bcm63xx: drop wrong casts in probe()
# good: [f7ae6d4ec6520a901787cbab273983e96d8516da] PCI/TSM: Add 'dsm' and 'bound' attributes for dependent functions
# good: [079115370d00c78ef69b31dd15def90adf2aa579] PCI/IDE: Initialize an ID for all IDE streams
# good: [059f545832be85d29ac9ccc416a16f647aa78485] spi: add support for microchip "soft" spi controller
# good: [6402ddf3027d8975f135cf2b2014d6bbeb2d3436] MAINTAINERS: refer to trivial-codec.yaml in relevant sections
# good: [4e00135b2dd1d7924a58bffa551b6ceb3bd836f2] spi: spi-cadence: supports transmission with bits_per_word of 16 and 32
# good: [8ff3dcb0e8a8bf6c41f23ed4aa62d066d3948a10] ASoC: codecs: lpass-rx-macro: add SM6115 compatible
# good: [8d63e85c5b50f1dbfa0ccb214bd91fe5d7e2e860] firmware: cs_dsp: fix kernel-doc warnings in a header file
# good: [e65b871c9b5af9265aefc5b8cd34993586d93aab] ASoC: codecs: pm4125: Remove irq_chip on component unbind
# good: [123cd174a3782307787268adf45f22de4d290128] ASoC: Intel: atom: Replace strcpy() with strscpy()
# good: [1d562ba0aa7df81335bf96c02be77efe8d5bab87] spi: dt-bindings: nuvoton,npcm-pspi: Convert to DT schema
# good: [4d6e2211aeb932e096f673c88475016b1cc0f8ab] ASoC: Intel: boards: fix HDMI playback lookup when HDMI-In capture used
# good: [32172cf3cb543a04c41a1677c97a38e60cad05b6] ASoC: cs35l56: Allow restoring factory calibration through ALSA control
# good: [873bc94689d832878befbcadc10b6ad5bb4e0027] ASoC: Intel: sof_sdw: add codec speaker support for the SKU
# good: [b3a5302484033331af37569f7277d00131694b57] ASoC: Intel: sof_rt5682: Add quirk override support
# good: [772ada50282b0c80343c8989147db816961f571d] ASoC: cs35l56: Alter error codes for calibration routine
# good: [fb1ebb10468da414d57153ddebaab29c38ef1a78] regulator: core: disable supply if enabling main regulator fails
# good: [6985defd1d832f1dd9d1977a6a2cc2cef7632704] regmap: sdw-mbq: Reorder regmap_mbq_context struct for better packing
# good: [6951be397ca8b8b167c9f99b5a11c541148c38cb] ASoC: codecs: pm4125: remove duplicate code
# good: [4e92abd0a11b91af3742197a9ca962c3c00d0948] spi: imx: add i.MX51 ECSPI target mode support
# good: [2089f086303b773e181567fd8d5df3038bd85937] regulator: mt6363: Remove unneeded semicolon
# good: [abc9a349b87ac0fd3ba8787ca00971b59c2e1257] spi: fsl-qspi: support the SpacemiT K1 SoC
# good: [6bd1ad97eb790570c167d4de4ca59fbc9c33722a] regulator: pf9453: Fix kernel doc for mux_poll()
# good: [55d03b5b5bdd04daf9a35ce49db18d8bb488dffb] spi: imx: remove CLK calculation and check for target mode
# good: [1b0f3f9ee41ee2bdd206667f85ea2aa36dfe6e69] ASoC: SDCA: support Q7.8 volume format
# good: [655079ac8a7721ac215a0596e3f33b740e01144a] ASoC: qcom: q6asm: Use guard() for spin locks
# good: [3c36965df80801344850388592e95033eceea05b] regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators
# good: [aa897ffc396b48cc39eee133b6b43175d0df9eb5] ASoC: dt-bindings: ti,pcm1862: convert to dtschema
# good: [2f538ef9f6f7c3d700c68536f21447dfc598f8c8] spi: aspeed: Use devm_iounmap() to unmap devm_ioremap() memory
# good: [c4e68959af66df525d71db619ffe44af9178bb22] ASoC: dt-bindings: ti,tas2781: Add TAS5822 support
# good: [af9c8092d84244ca54ffb590435735f788e7a170] regmap: i3c: Use ARRAY_SIZE()
# good: [380fd29d57abe6679d87ec56babe65ddc5873a37] spi: tegra210-quad: Check hardware status on timeout
# good: [2ecc8c089802e033d2e5204d21a9f467e2517df9] regulator: pf9453: remove unused I2C_LT register
# good: [252abf2d07d33b1c70a59ba1c9395ba42bbd793e] regulator: Small cleanup in of_get_regulation_constraints()
# good: [84194c66aaf78fed150edb217b9f341518b1cba2] ASoC: codecs: aw88261: pass pointer directly instead of passing the address
# good: [ed5d499b5c9cc11dd3edae1a7a55db7dfa4f1bdc] regcache: maple: Split ->populate() from ->init()
# good: [6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3] ASoC: codec: wm8400: replace printk() calls with dev_*() device aware logging
# good: [ecd0de438c1f0ee86cf8f6d5047965a2a181444b] spi: tle62x0: Add newline to sysfs attribute output
# good: [f1dfbc1b5cf8650ae9a0d543e5f5335fc0f478ce] ASoC: max98090/91: fixing the stream index
# good: [e73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0] ASoC: soc-core: check ops & auto_selectable_formats in snd_soc_dai_get_fmt() to prevent dereference error
# good: [20bcda681f8597e86070a4b3b12d1e4f541865d3] ASoC: codecs: va-macro: fix revision checking
# good: [8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce] ASoC: qcom: sc7280: make use of common helpers
# good: [cf6bf51b53252284bafc7377a4d8dbf10f048b4d] ASoC: cs4271: Add support for the external mclk
# good: [28039efa4d8e8bbf98b066133a906bd4e307d496] MAINTAINERS: remove obsolete file entry in DIALOG SEMICONDUCTOR DRIVERS
# good: [e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8] regmap: warn users about uninitialized flat cache
# good: [f034c16a4663eaf3198dc18b201ba50533fb5b81] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
# good: [66fecfa91deb536a12ddf3d878a99590d7900277] ASoC: spacemit: use `depends on` instead of `select`
# good: [4a5ac6cd05a7e54f1585d7779464d6ed6272c134] ASoC: sun4i-spdif: Support SPDIF output on A523 family
# good: [4795375d8aa072e9aacb0b278e6203c6ca41816a] ASoC: cs-amp-lib-test: Add test cases for cs_amp_set_efi_calibration_data()
# good: [ef042df96d0e1089764f39ede61bc8f140a4be00] ASoC: SDCA: Add HID button IRQ
# good: [4c33cef58965eb655a0ac8e243aa323581ec025f] regulator: pca9450: link regulator inputs to supply groups
# good: [77a58ba7c64ccca20616aa03599766ccb0d1a330] spi: spi-mem: Trace exec_op
# good: [01313661b248c5ba586acae09bff57077dbec0a5] regulator: Let raspberrypi drivers depend on ARM
# good: [d29479abaded34b2b1dab2e17efe96a65eba3d61] ASoC: renesas: fsi: Constify struct fsi_stream_handler
# good: [e7434adf0c53a84d548226304cdb41c8818da1cb] ASoC: cs530x: Add SPI bus support for cs530x parts
# good: [e973dfe9259095fb509ab12658c68d46f0e439d7] ASoC: qcom: sm8250: add qrb2210-sndcard compatible string
# good: [c17fa4cbc546c431ccf13e9354d5d9c1cd247b7c] ASoC: sdw_utils: add name_prefix for rt1321 part id
# good: [fd5ef3d69f8975bad16c437a337b5cb04c8217a2] spi: spi-qpic-snand: make qcom_spi_ecc_engine_ops_pipelined const
# good: [d054cc3a2ccfb19484f3b54d69b6e416832dc8f4] regulator: rpmh-regulator: Add RPMH regulator support for PMR735D
# good: [2528c15f314ece50218d1273654f630d74109583] ASoC: max98090/91: adding DAPM routing for digital output for max98091
# good: [310bf433c01f78e0756fd5056a43118a2f77318c] ASoC: max98090/91: fixing a space
# good: [638bae3fb225a708dc67db613af62f6d14c4eff4] ASoC: max98090/91: added DAPM widget for digital output for max98091
# good: [ecba655bf54a661ffe078856cd8dbc898270e4b5] ASoC: fsl_aud2htx: add IEC958_SUBFRAME_LE format in supported list
# good: [7e1906643a7374529af74b013bba35e4fa4e6ffc] ASoC: codecs: va-macro: Clean up on error path in probe()
# good: [d742ebcfe524dc54023f7c520d2ed2e4b7203c19] ASoC: soc.h: remove snd_soc_kcontrol_component()
# good: [6658472a3e2de08197acfe099ba71ee0e2505ecf] ASoC: amd: amd_sdw: Propagate the PCI subsystem Vendor and Device IDs
# good: [fce217449075d59b29052b8cdac567f0f3e22641] ASoC: spacemit: add i2s support for K1 SoC
# good: [0cc08c8130ac8f74419f99fe707dc193b7f79d86] spi: aspeed: Fix an IS_ERR() vs NULL bug in probe()
# good: [0743acf746a81e0460a56fd5ff847d97fa7eb370] spi: airoha: buffer must be 0xff-ed before writing
# good: [d77daa49085b067137d0adbe3263f75a7ee13a1b] spi: aspeed: fix spelling mistake "triming" -> "trimming"
# good: [15afe57a874eaf104bfbb61ec598fa31627f7b19] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs
# good: [1e570e77392f43a3cdab2849d1f81535f8a033e2] ASoC: mxs-saif: support usage with simple-audio-card
# good: [fb25114cd760c13cf177d9ac37837fafcc9657b5] regulator: sy7636a: add gpios and input regulator
# good: [6621b0f118d500092f5f3d72ddddb22aeeb3c3a0] ASoC: codecs: rt5670: use SOC_VALUE_ENUM_SINGLE_DECL for DAC2 L/R MX-1B
# good: [65efe5404d151767653c7b7dd39bd2e7ad532c2d] regulator: rpmh-regulator: Add RPMH regulator support for Glymur
# good: [0b0eb7702a9fa410755e86124b4b7cd36e7d1cb4] ASoC: replace use of system_wq with system_dfl_wq
# good: [433e294c3c5b5d2020085a0e36c1cb47b694690a] regulator: core: forward undervoltage events downstream by default
# good: [bf770d6d2097a52d87f4d9c88d0b05bd3998d7de] x86/module: Improve relocation error messages
# good: [c2d420796a427dda71a2400909864e7f8e037fd4] elfnote: Change ELFNOTE() to use __UNIQUE_ID()
# good: [7e7e2c6e2a1cb250f8d03bb99eed01f6d982d5dd] ASoC: sof-function-topology-lib: escalate the log when missing function topoplogy
# good: [9797329220a2c6622411eb9ecf6a35b24ce09d04] ASoC: sof-function-topology-lib: escalate the log when missing function topoplogy
# good: [64d87ccfae3326a9561fe41dc6073064a083e0df] spi: aspeed: Only map necessary address window region
# good: [4412ab501677606436e5c49e41151a1e6eac7ac0] spi: dt-bindings: spi-qpic-snand: Add IPQ5332 compatible
# good: [5e537031f322d55315cd384398b726a9a0748d47] ASoC: codecs: Fix the error of excessive semicolons
# good: [fe8cc44dd173cde5788ab4e3730ac61f3d316d9c] spi: dw: add target mode support
# good: [4d410ba9aa275e7990a270f63ce436990ace1bea] dt-bindings: sound: Update ADMAIF bindings for tegra264
# good: [b83fb1b14c06bdd765903ac852ba20a14e24f227] spi: offload: Add offset parameter
# good: [6277a486a7faaa6c87f4bf1d59a2de233a093248] regulator: dt-bindings: Convert Dialog DA9211 Regulators to DT schema
# good: [6c177775dcc5e70a64ddf4ee842c66af498f2c7c] Merge branch 'next/drivers' into for-next
git bisect start '92fd6e84175befa1775e5c0ab682938eca27c0b2' '07e9a68478302d35f3372ac8c9994d679a9cfdca' 'cb99656b7c4185953c9d272bbdab63c8aa651e6e' 'df919994d323c7c86e32fa2745730136d58ada12' '670500b41e543c5cb09eb9f7f0e4e26c5b5fdf7e' '3af1815a2f9caebfc666af3912e24d030a5368d5' '3efee7362dbf896072af1c1aaeaf9fd6e235c591' 'f1c668269ded16bea32a11d03f4584caa0c018c9' '43a3adb6dd39d98bf84e04569e7604be5e5c0d79' '33822d795ab93067d9a65f42003c0d01c65d4a9d' 'd5089fffe1db04a802b028c2ef4875be1ed452a3' '12d821bd13d42e6de3ecb1c13918b1f06a3ee213' '3045e29d248bde2a68da425498a656093ee0df69' 'bdf96e9135a0cf53a853a19c30fa11131a744062' 'e2c48498a93404743e0565dcac29450fec02e6a3' '7a0a87712120329c034b0aae88bdaa05bd046f10' 'b871d9adffe5a64a1fd9edcb1aebbcc995b17901' 'd9813cd23d5a7b254cc1b1c1ea042634d8da62e6' 'e45979641a9a9dbb48fc77c5b36a5091a92e7227' 'd218ea171430e49412804efb794942dd121a8032' '21e68bcb1b0c688c2d9ca0d457922febac650ac1' 'bd79452b39c21599e2cff42e9fbeb182656b6f6a' '96498e804cb6629e02747336a0a33e4955449732' '9e510e677090bb794b46348b10e1c8038286e00a' '4422df6782eb7aa9725a3c09d9ba3c38ecc85df4' 'd5c8b7902a41625ea328b52c78ebe750fbf6fef7' '118eb2cb97b8fc0d515bb0449495959247db58f0' 'f7ae6d4ec6520a901787cbab273983e96d8516da' '079115370d00c78ef69b31dd15def90adf2aa579' '059f545832be85d29ac9ccc416a16f647aa78485' '6402ddf3027d8975f135cf2b2014d6bbeb2d3436' '4e00135b2dd1d7924a58bffa551b6ceb3bd836f2' '8ff3dcb0e8a8bf6c41f23ed4aa62d066d3948a10' '8d63e85c5b50f1dbfa0ccb214bd91fe5d7e2e860' 'e65b871c9b5af9265aefc5b8cd34993586d93aab' '123cd174a3782307787268adf45f22de4d290128' '1d562ba0aa7df81335bf96c02be77efe8d5bab87' '4d6e2211aeb932e096f673c88475016b1cc0f8ab' '32172cf3cb543a04c41a1677c97a38e60cad05b6' '873bc94689d832878befbcadc10b6ad5bb4e0027' 'b3a5302484033331af37569f7277d00131694b57' '772ada50282b0c80343c8989147db816961f571d' 'fb1ebb10468da414d57153ddebaab29c38ef1a78' '6985defd1d832f1dd9d1977a6a2cc2cef7632704' '6951be397ca8b8b167c9f99b5a11c541148c38cb' '4e92abd0a11b91af3742197a9ca962c3c00d0948' '2089f086303b773e181567fd8d5df3038bd85937' 'abc9a349b87ac0fd3ba8787ca00971b59c2e1257' '6bd1ad97eb790570c167d4de4ca59fbc9c33722a' '55d03b5b5bdd04daf9a35ce49db18d8bb488dffb' '1b0f3f9ee41ee2bdd206667f85ea2aa36dfe6e69' '655079ac8a7721ac215a0596e3f33b740e01144a' '3c36965df80801344850388592e95033eceea05b' 'aa897ffc396b48cc39eee133b6b43175d0df9eb5' '2f538ef9f6f7c3d700c68536f21447dfc598f8c8' 'c4e68959af66df525d71db619ffe44af9178bb22' 'af9c8092d84244ca54ffb590435735f788e7a170' '380fd29d57abe6679d87ec56babe65ddc5873a37' '2ecc8c089802e033d2e5204d21a9f467e2517df9' '252abf2d07d33b1c70a59ba1c9395ba42bbd793e' '84194c66aaf78fed150edb217b9f341518b1cba2' 'ed5d499b5c9cc11dd3edae1a7a55db7dfa4f1bdc' '6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3' 'ecd0de438c1f0ee86cf8f6d5047965a2a181444b' 'f1dfbc1b5cf8650ae9a0d543e5f5335fc0f478ce' 'e73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0' '20bcda681f8597e86070a4b3b12d1e4f541865d3' '8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce' 'cf6bf51b53252284bafc7377a4d8dbf10f048b4d' '28039efa4d8e8bbf98b066133a906bd4e307d496' 'e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8' 'f034c16a4663eaf3198dc18b201ba50533fb5b81' '66fecfa91deb536a12ddf3d878a99590d7900277' '4a5ac6cd05a7e54f1585d7779464d6ed6272c134' '4795375d8aa072e9aacb0b278e6203c6ca41816a' 'ef042df96d0e1089764f39ede61bc8f140a4be00' '4c33cef58965eb655a0ac8e243aa323581ec025f' '77a58ba7c64ccca20616aa03599766ccb0d1a330' '01313661b248c5ba586acae09bff57077dbec0a5' 'd29479abaded34b2b1dab2e17efe96a65eba3d61' 'e7434adf0c53a84d548226304cdb41c8818da1cb' 'e973dfe9259095fb509ab12658c68d46f0e439d7' 'c17fa4cbc546c431ccf13e9354d5d9c1cd247b7c' 'fd5ef3d69f8975bad16c437a337b5cb04c8217a2' 'd054cc3a2ccfb19484f3b54d69b6e416832dc8f4' '2528c15f314ece50218d1273654f630d74109583' '310bf433c01f78e0756fd5056a43118a2f77318c' '638bae3fb225a708dc67db613af62f6d14c4eff4' 'ecba655bf54a661ffe078856cd8dbc898270e4b5' '7e1906643a7374529af74b013bba35e4fa4e6ffc' 'd742ebcfe524dc54023f7c520d2ed2e4b7203c19' '6658472a3e2de08197acfe099ba71ee0e2505ecf' 'fce217449075d59b29052b8cdac567f0f3e22641' '0cc08c8130ac8f74419f99fe707dc193b7f79d86' '0743acf746a81e0460a56fd5ff847d97fa7eb370' 'd77daa49085b067137d0adbe3263f75a7ee13a1b' '15afe57a874eaf104bfbb61ec598fa31627f7b19' '1e570e77392f43a3cdab2849d1f81535f8a033e2' 'fb25114cd760c13cf177d9ac37837fafcc9657b5' '6621b0f118d500092f5f3d72ddddb22aeeb3c3a0' '65efe5404d151767653c7b7dd39bd2e7ad532c2d' '0b0eb7702a9fa410755e86124b4b7cd36e7d1cb4' '433e294c3c5b5d2020085a0e36c1cb47b694690a' 'bf770d6d2097a52d87f4d9c88d0b05bd3998d7de' 'c2d420796a427dda71a2400909864e7f8e037fd4' '7e7e2c6e2a1cb250f8d03bb99eed01f6d982d5dd' '9797329220a2c6622411eb9ecf6a35b24ce09d04' '64d87ccfae3326a9561fe41dc6073064a083e0df' '4412ab501677606436e5c49e41151a1e6eac7ac0' '5e537031f322d55315cd384398b726a9a0748d47' 'fe8cc44dd173cde5788ab4e3730ac61f3d316d9c' '4d410ba9aa275e7990a270f63ce436990ace1bea' 'b83fb1b14c06bdd765903ac852ba20a14e24f227' '6277a486a7faaa6c87f4bf1d59a2de233a093248' '6c177775dcc5e70a64ddf4ee842c66af498f2c7c'
# test job: [cb99656b7c4185953c9d272bbdab63c8aa651e6e] https://lava.sirena.org.uk/scheduler/job/2132762
# test job: [df919994d323c7c86e32fa2745730136d58ada12] https://lava.sirena.org.uk/scheduler/job/2121710
# test job: [670500b41e543c5cb09eb9f7f0e4e26c5b5fdf7e] https://lava.sirena.org.uk/scheduler/job/2121053
# test job: [3af1815a2f9caebfc666af3912e24d030a5368d5] https://lava.sirena.org.uk/scheduler/job/2115465
# test job: [3efee7362dbf896072af1c1aaeaf9fd6e235c591] https://lava.sirena.org.uk/scheduler/job/2115125
# test job: [f1c668269ded16bea32a11d03f4584caa0c018c9] https://lava.sirena.org.uk/scheduler/job/2113592
# test job: [43a3adb6dd39d98bf84e04569e7604be5e5c0d79] https://lava.sirena.org.uk/scheduler/job/2115050
# test job: [33822d795ab93067d9a65f42003c0d01c65d4a9d] https://lava.sirena.org.uk/scheduler/job/2112459
# test job: [d5089fffe1db04a802b028c2ef4875be1ed452a3] https://lava.sirena.org.uk/scheduler/job/2111799
# test job: [12d821bd13d42e6de3ecb1c13918b1f06a3ee213] https://lava.sirena.org.uk/scheduler/job/2112898
# test job: [3045e29d248bde2a68da425498a656093ee0df69] https://lava.sirena.org.uk/scheduler/job/2111763
# test job: [bdf96e9135a0cf53a853a19c30fa11131a744062] https://lava.sirena.org.uk/scheduler/job/2109740
# test job: [e2c48498a93404743e0565dcac29450fec02e6a3] https://lava.sirena.org.uk/scheduler/job/2107365
# test job: [7a0a87712120329c034b0aae88bdaa05bd046f10] https://lava.sirena.org.uk/scheduler/job/2107534
# test job: [b871d9adffe5a64a1fd9edcb1aebbcc995b17901] https://lava.sirena.org.uk/scheduler/job/2107898
# test job: [d9813cd23d5a7b254cc1b1c1ea042634d8da62e6] https://lava.sirena.org.uk/scheduler/job/2105382
# test job: [e45979641a9a9dbb48fc77c5b36a5091a92e7227] https://lava.sirena.org.uk/scheduler/job/2104425
# test job: [d218ea171430e49412804efb794942dd121a8032] https://lava.sirena.org.uk/scheduler/job/2104309
# test job: [21e68bcb1b0c688c2d9ca0d457922febac650ac1] https://lava.sirena.org.uk/scheduler/job/2104503
# test job: [bd79452b39c21599e2cff42e9fbeb182656b6f6a] https://lava.sirena.org.uk/scheduler/job/2104088
# test job: [96498e804cb6629e02747336a0a33e4955449732] https://lava.sirena.org.uk/scheduler/job/2099747
# test job: [9e510e677090bb794b46348b10e1c8038286e00a] https://lava.sirena.org.uk/scheduler/job/2093874
# test job: [4422df6782eb7aa9725a3c09d9ba3c38ecc85df4] https://lava.sirena.org.uk/scheduler/job/2097746
# test job: [d5c8b7902a41625ea328b52c78ebe750fbf6fef7] https://lava.sirena.org.uk/scheduler/job/2092719
# test job: [118eb2cb97b8fc0d515bb0449495959247db58f0] https://lava.sirena.org.uk/scheduler/job/2092527
# test job: [f7ae6d4ec6520a901787cbab273983e96d8516da] https://lava.sirena.org.uk/scheduler/job/2122586
# test job: [079115370d00c78ef69b31dd15def90adf2aa579] https://lava.sirena.org.uk/scheduler/job/2121428
# test job: [059f545832be85d29ac9ccc416a16f647aa78485] https://lava.sirena.org.uk/scheduler/job/2086759
# test job: [6402ddf3027d8975f135cf2b2014d6bbeb2d3436] https://lava.sirena.org.uk/scheduler/job/2086593
# test job: [4e00135b2dd1d7924a58bffa551b6ceb3bd836f2] https://lava.sirena.org.uk/scheduler/job/2082522
# test job: [8ff3dcb0e8a8bf6c41f23ed4aa62d066d3948a10] https://lava.sirena.org.uk/scheduler/job/2083115
# test job: [8d63e85c5b50f1dbfa0ccb214bd91fe5d7e2e860] https://lava.sirena.org.uk/scheduler/job/2082575
# test job: [e65b871c9b5af9265aefc5b8cd34993586d93aab] https://lava.sirena.org.uk/scheduler/job/2083139
# test job: [123cd174a3782307787268adf45f22de4d290128] https://lava.sirena.org.uk/scheduler/job/2078963
# test job: [1d562ba0aa7df81335bf96c02be77efe8d5bab87] https://lava.sirena.org.uk/scheduler/job/2078345
# test job: [4d6e2211aeb932e096f673c88475016b1cc0f8ab] https://lava.sirena.org.uk/scheduler/job/2077998
# test job: [32172cf3cb543a04c41a1677c97a38e60cad05b6] https://lava.sirena.org.uk/scheduler/job/2075069
# test job: [873bc94689d832878befbcadc10b6ad5bb4e0027] https://lava.sirena.org.uk/scheduler/job/2074834
# test job: [b3a5302484033331af37569f7277d00131694b57] https://lava.sirena.org.uk/scheduler/job/2074543
# test job: [772ada50282b0c80343c8989147db816961f571d] https://lava.sirena.org.uk/scheduler/job/2069185
# test job: [fb1ebb10468da414d57153ddebaab29c38ef1a78] https://lava.sirena.org.uk/scheduler/job/2059783
# test job: [6985defd1d832f1dd9d1977a6a2cc2cef7632704] https://lava.sirena.org.uk/scheduler/job/2059123
# test job: [6951be397ca8b8b167c9f99b5a11c541148c38cb] https://lava.sirena.org.uk/scheduler/job/2055768
# test job: [4e92abd0a11b91af3742197a9ca962c3c00d0948] https://lava.sirena.org.uk/scheduler/job/2055839
# test job: [2089f086303b773e181567fd8d5df3038bd85937] https://lava.sirena.org.uk/scheduler/job/2058048
# test job: [abc9a349b87ac0fd3ba8787ca00971b59c2e1257] https://lava.sirena.org.uk/scheduler/job/2054610
# test job: [6bd1ad97eb790570c167d4de4ca59fbc9c33722a] https://lava.sirena.org.uk/scheduler/job/2053444
# test job: [55d03b5b5bdd04daf9a35ce49db18d8bb488dffb] https://lava.sirena.org.uk/scheduler/job/2053865
# test job: [1b0f3f9ee41ee2bdd206667f85ea2aa36dfe6e69] https://lava.sirena.org.uk/scheduler/job/2053663
# test job: [655079ac8a7721ac215a0596e3f33b740e01144a] https://lava.sirena.org.uk/scheduler/job/2049712
# test job: [3c36965df80801344850388592e95033eceea05b] https://lava.sirena.org.uk/scheduler/job/2049474
# test job: [aa897ffc396b48cc39eee133b6b43175d0df9eb5] https://lava.sirena.org.uk/scheduler/job/2048775
# test job: [2f538ef9f6f7c3d700c68536f21447dfc598f8c8] https://lava.sirena.org.uk/scheduler/job/2048626
# test job: [c4e68959af66df525d71db619ffe44af9178bb22] https://lava.sirena.org.uk/scheduler/job/2044018
# test job: [af9c8092d84244ca54ffb590435735f788e7a170] https://lava.sirena.org.uk/scheduler/job/2043675
# test job: [380fd29d57abe6679d87ec56babe65ddc5873a37] https://lava.sirena.org.uk/scheduler/job/2044558
# test job: [2ecc8c089802e033d2e5204d21a9f467e2517df9] https://lava.sirena.org.uk/scheduler/job/2038640
# test job: [252abf2d07d33b1c70a59ba1c9395ba42bbd793e] https://lava.sirena.org.uk/scheduler/job/2038545
# test job: [84194c66aaf78fed150edb217b9f341518b1cba2] https://lava.sirena.org.uk/scheduler/job/2038391
# test job: [ed5d499b5c9cc11dd3edae1a7a55db7dfa4f1bdc] https://lava.sirena.org.uk/scheduler/job/2029011
# test job: [6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3] https://lava.sirena.org.uk/scheduler/job/2025855
# test job: [ecd0de438c1f0ee86cf8f6d5047965a2a181444b] https://lava.sirena.org.uk/scheduler/job/2026095
# test job: [f1dfbc1b5cf8650ae9a0d543e5f5335fc0f478ce] https://lava.sirena.org.uk/scheduler/job/2025515
# test job: [e73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0] https://lava.sirena.org.uk/scheduler/job/2026430
# test job: [20bcda681f8597e86070a4b3b12d1e4f541865d3] https://lava.sirena.org.uk/scheduler/job/2022992
# test job: [8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce] https://lava.sirena.org.uk/scheduler/job/2021461
# test job: [cf6bf51b53252284bafc7377a4d8dbf10f048b4d] https://lava.sirena.org.uk/scheduler/job/2023022
# test job: [28039efa4d8e8bbf98b066133a906bd4e307d496] https://lava.sirena.org.uk/scheduler/job/2020298
# test job: [e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8] https://lava.sirena.org.uk/scheduler/job/2020171
# test job: [f034c16a4663eaf3198dc18b201ba50533fb5b81] https://lava.sirena.org.uk/scheduler/job/2015463
# test job: [66fecfa91deb536a12ddf3d878a99590d7900277] https://lava.sirena.org.uk/scheduler/job/2015316
# test job: [4a5ac6cd05a7e54f1585d7779464d6ed6272c134] https://lava.sirena.org.uk/scheduler/job/2011270
# test job: [4795375d8aa072e9aacb0b278e6203c6ca41816a] https://lava.sirena.org.uk/scheduler/job/2009695
# test job: [ef042df96d0e1089764f39ede61bc8f140a4be00] https://lava.sirena.org.uk/scheduler/job/2010161
# test job: [4c33cef58965eb655a0ac8e243aa323581ec025f] https://lava.sirena.org.uk/scheduler/job/2009455
# test job: [77a58ba7c64ccca20616aa03599766ccb0d1a330] https://lava.sirena.org.uk/scheduler/job/2007308
# test job: [01313661b248c5ba586acae09bff57077dbec0a5] https://lava.sirena.org.uk/scheduler/job/2008765
# test job: [d29479abaded34b2b1dab2e17efe96a65eba3d61] https://lava.sirena.org.uk/scheduler/job/2008428
# test job: [e7434adf0c53a84d548226304cdb41c8818da1cb] https://lava.sirena.org.uk/scheduler/job/2007796
# test job: [e973dfe9259095fb509ab12658c68d46f0e439d7] https://lava.sirena.org.uk/scheduler/job/2008129
# test job: [c17fa4cbc546c431ccf13e9354d5d9c1cd247b7c] https://lava.sirena.org.uk/scheduler/job/2000031
# test job: [fd5ef3d69f8975bad16c437a337b5cb04c8217a2] https://lava.sirena.org.uk/scheduler/job/1996145
# test job: [d054cc3a2ccfb19484f3b54d69b6e416832dc8f4] https://lava.sirena.org.uk/scheduler/job/1995770
# test job: [2528c15f314ece50218d1273654f630d74109583] https://lava.sirena.org.uk/scheduler/job/1997626
# test job: [310bf433c01f78e0756fd5056a43118a2f77318c] https://lava.sirena.org.uk/scheduler/job/1996060
# test job: [638bae3fb225a708dc67db613af62f6d14c4eff4] https://lava.sirena.org.uk/scheduler/job/1991896
# test job: [ecba655bf54a661ffe078856cd8dbc898270e4b5] https://lava.sirena.org.uk/scheduler/job/1985168
# test job: [7e1906643a7374529af74b013bba35e4fa4e6ffc] https://lava.sirena.org.uk/scheduler/job/1978655
# test job: [d742ebcfe524dc54023f7c520d2ed2e4b7203c19] https://lava.sirena.org.uk/scheduler/job/1975982
# test job: [6658472a3e2de08197acfe099ba71ee0e2505ecf] https://lava.sirena.org.uk/scheduler/job/1973471
# test job: [fce217449075d59b29052b8cdac567f0f3e22641] https://lava.sirena.org.uk/scheduler/job/1975680
# test job: [0cc08c8130ac8f74419f99fe707dc193b7f79d86] https://lava.sirena.org.uk/scheduler/job/1965719
# test job: [0743acf746a81e0460a56fd5ff847d97fa7eb370] https://lava.sirena.org.uk/scheduler/job/1964863
# test job: [d77daa49085b067137d0adbe3263f75a7ee13a1b] https://lava.sirena.org.uk/scheduler/job/1962771
# test job: [15afe57a874eaf104bfbb61ec598fa31627f7b19] https://lava.sirena.org.uk/scheduler/job/1962956
# test job: [1e570e77392f43a3cdab2849d1f81535f8a033e2] https://lava.sirena.org.uk/scheduler/job/1962292
# test job: [fb25114cd760c13cf177d9ac37837fafcc9657b5] https://lava.sirena.org.uk/scheduler/job/1960167
# test job: [6621b0f118d500092f5f3d72ddddb22aeeb3c3a0] https://lava.sirena.org.uk/scheduler/job/1959744
# test job: [65efe5404d151767653c7b7dd39bd2e7ad532c2d] https://lava.sirena.org.uk/scheduler/job/1959976
# test job: [0b0eb7702a9fa410755e86124b4b7cd36e7d1cb4] https://lava.sirena.org.uk/scheduler/job/1957385
# test job: [433e294c3c5b5d2020085a0e36c1cb47b694690a] https://lava.sirena.org.uk/scheduler/job/1957438
# test job: [bf770d6d2097a52d87f4d9c88d0b05bd3998d7de] https://lava.sirena.org.uk/scheduler/job/1990586
# test job: [c2d420796a427dda71a2400909864e7f8e037fd4] https://lava.sirena.org.uk/scheduler/job/1990667
# test job: [7e7e2c6e2a1cb250f8d03bb99eed01f6d982d5dd] https://lava.sirena.org.uk/scheduler/job/1954263
# test job: [9797329220a2c6622411eb9ecf6a35b24ce09d04] https://lava.sirena.org.uk/scheduler/job/1947395
# test job: [64d87ccfae3326a9561fe41dc6073064a083e0df] https://lava.sirena.org.uk/scheduler/job/1947254
# test job: [4412ab501677606436e5c49e41151a1e6eac7ac0] https://lava.sirena.org.uk/scheduler/job/1946284
# test job: [5e537031f322d55315cd384398b726a9a0748d47] https://lava.sirena.org.uk/scheduler/job/1946643
# test job: [fe8cc44dd173cde5788ab4e3730ac61f3d316d9c] https://lava.sirena.org.uk/scheduler/job/1946090
# test job: [4d410ba9aa275e7990a270f63ce436990ace1bea] https://lava.sirena.org.uk/scheduler/job/1947752
# test job: [b83fb1b14c06bdd765903ac852ba20a14e24f227] https://lava.sirena.org.uk/scheduler/job/1946838
# test job: [6277a486a7faaa6c87f4bf1d59a2de233a093248] https://lava.sirena.org.uk/scheduler/job/1947021
# test job: [6c177775dcc5e70a64ddf4ee842c66af498f2c7c] https://lava.sirena.org.uk/scheduler/job/2122930
# test job: [92fd6e84175befa1775e5c0ab682938eca27c0b2] https://lava.sirena.org.uk/scheduler/job/2134811
# bad: [92fd6e84175befa1775e5c0ab682938eca27c0b2] Add linux-next specific files for 20251125
git bisect bad 92fd6e84175befa1775e5c0ab682938eca27c0b2
# test job: [bfda4f7f7c8a71d3fa9e0e062f64e3e03b401ce0] https://lava.sirena.org.uk/scheduler/job/2134897
# bad: [bfda4f7f7c8a71d3fa9e0e062f64e3e03b401ce0] Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
git bisect bad bfda4f7f7c8a71d3fa9e0e062f64e3e03b401ce0
# test job: [27bc91de97549dcf3983f68c90e1d25244e75e67] https://lava.sirena.org.uk/scheduler/job/2135008
# good: [27bc91de97549dcf3983f68c90e1d25244e75e67] Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux.git
git bisect good 27bc91de97549dcf3983f68c90e1d25244e75e67
# test job: [11354ae4fd8605c56deed3aa9e17083a75209455] https://lava.sirena.org.uk/scheduler/job/2135187
# bad: [11354ae4fd8605c56deed3aa9e17083a75209455] Merge branch 'next' of git://linuxtv.org/media-ci/media-pending.git
git bisect bad 11354ae4fd8605c56deed3aa9e17083a75209455
# test job: [6dcee998bc550ca1f4d93ada88ddf3ddf88278b5] https://lava.sirena.org.uk/scheduler/job/2135222
# bad: [6dcee998bc550ca1f4d93ada88ddf3ddf88278b5] Merge branch 'vfs.all' of https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
git bisect bad 6dcee998bc550ca1f4d93ada88ddf3ddf88278b5
# test job: [4d8cb2518d6f29e24b1df6609ee32cab7e76aa7c] https://lava.sirena.org.uk/scheduler/job/2135273
# bad: [4d8cb2518d6f29e24b1df6609ee32cab7e76aa7c] Merge branch 'vfs-6.19.fd_prepare' into vfs.all
git bisect bad 4d8cb2518d6f29e24b1df6609ee32cab7e76aa7c
# test job: [fbcf11d2838ae1df75ef10856e31fbbdd001baa5] https://lava.sirena.org.uk/scheduler/job/2135310
# good: [fbcf11d2838ae1df75ef10856e31fbbdd001baa5] Merge branch 'namespace-6.19' into vfs.all
git bisect good fbcf11d2838ae1df75ef10856e31fbbdd001baa5
# test job: [5d1eb038b7d7bc0262cb153f84a6cdec4b95ba16] https://lava.sirena.org.uk/scheduler/job/2135396
# good: [5d1eb038b7d7bc0262cb153f84a6cdec4b95ba16] Merge branch 'vfs-6.19.directory.delegations' into vfs.all
git bisect good 5d1eb038b7d7bc0262cb153f84a6cdec4b95ba16
# test job: [d6ef072d09b2341e606aeeaf14c3510dec329c63] https://lava.sirena.org.uk/scheduler/job/2135491
# good: [d6ef072d09b2341e606aeeaf14c3510dec329c63] ovl: reflow ovl_create_or_link()
git bisect good d6ef072d09b2341e606aeeaf14c3510dec329c63
# test job: [b27548e6abcc0d771eda10b8ed5aaac5d53ef421] https://lava.sirena.org.uk/scheduler/job/2135564
# good: [b27548e6abcc0d771eda10b8ed5aaac5d53ef421] spufs: convert spufs_context_open() to FD_PREPARE()
git bisect good b27548e6abcc0d771eda10b8ed5aaac5d53ef421
# test job: [fd9bdc258e6208fb635c3d4a9980c143f77121f1] https://lava.sirena.org.uk/scheduler/job/2135723
# bad: [fd9bdc258e6208fb635c3d4a9980c143f77121f1] Merge patch series "file: FD_{ADD,PREPARE}()"
git bisect bad fd9bdc258e6208fb635c3d4a9980c143f77121f1
# test job: [c2d378132453fd94cec4e3cde29e768b698fb388] https://lava.sirena.org.uk/scheduler/job/2135963
# good: [c2d378132453fd94cec4e3cde29e768b698fb388] media: convert media_request_alloc() to FD_PREPARE()
git bisect good c2d378132453fd94cec4e3cde29e768b698fb388
# test job: [ce7194bb784d673e916315e1610d444d6dd03f10] https://lava.sirena.org.uk/scheduler/job/2136299
# bad: [ce7194bb784d673e916315e1610d444d6dd03f10] file: convert replace_fd() to FD_PREPARE()
git bisect bad ce7194bb784d673e916315e1610d444d6dd03f10
# test job: [d624684412e7f1530950d4ca9aa792d55a83c381] https://lava.sirena.org.uk/scheduler/job/2136587
# bad: [d624684412e7f1530950d4ca9aa792d55a83c381] tty: convert ptm_open_peer() to FD_ADD()
git bisect bad d624684412e7f1530950d4ca9aa792d55a83c381
# test job: [aa24d422e21f64f006988ad1f6a39013d7d085f5] https://lava.sirena.org.uk/scheduler/job/2136750
# good: [aa24d422e21f64f006988ad1f6a39013d7d085f5] ntsync: convert ntsync_obj_get_fd() to FD_PREPARE()
git bisect good aa24d422e21f64f006988ad1f6a39013d7d085f5
# first bad commit: [d624684412e7f1530950d4ca9aa792d55a83c381] tty: convert ptm_open_peer() to FD_ADD()
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 22/47] ipc: convert do_mq_open() to FD_PREPARE()
2025-11-25 22:30 ` Mark Brown
@ 2025-11-26 0:05 ` Linus Torvalds
2025-11-26 13:20 ` Christian Brauner
0 siblings, 1 reply; 74+ messages in thread
From: Linus Torvalds @ 2025-11-26 0:05 UTC (permalink / raw)
To: Mark Brown
Cc: Christian Brauner, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Tue, 25 Nov 2025 at 14:30, Mark Brown <broonie@kernel.org> wrote:
>
>
> It's not clear to me if this is an overly
> sensitive test or an actual issue.
I think these two cases are both "error handling done in a different
order", where the test expected to get EMFILE (or something like
that), but now the file open is done before, so it actually gets
EACCES.
I'm not sure it really matters, but the old code did seem to do the
file prepare first, and the
path.dentry = lookup_noperm(&QSTR(name->name), root);
afterwards.
And while I don't think the order *really* matters, I do think the old
order was better.
And I think it can be done that way.
So Christian, I think the proper solution is to not do that
"dentry_open()" in the FD_ADD() after doing all the other prep-work:
ret = FD_ADD(O_CLOEXEC, dentry_open(&path, oflag, current_cred()));
but instead make a new proper "handle_mq_open()" helper that does the whole
path.dentry = lookup_noperm(&QSTR(name->name), root);
...
ret = prepare_open(path.dentry, oflag, ro, mode, name, attr);
...
return dentry_open(&path, oflag, current_cred());
dance, and then do
ret = FD_ADD(O_CLOEXEC, handle_mq_open());
so that this all is done in the same order as it used to be done.
Hmm?
I think the same thing is true for the other failed test-case.
Linus
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 22/47] ipc: convert do_mq_open() to FD_PREPARE()
2025-11-26 0:05 ` Linus Torvalds
@ 2025-11-26 13:20 ` Christian Brauner
2025-11-26 16:10 ` Linus Torvalds
0 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-26 13:20 UTC (permalink / raw)
To: Linus Torvalds
Cc: Mark Brown, Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe
On Tue, Nov 25, 2025 at 04:05:20PM -0800, Linus Torvalds wrote:
> On Tue, 25 Nov 2025 at 14:30, Mark Brown <broonie@kernel.org> wrote:
> >
> >
> > It's not clear to me if this is an overly
> > sensitive test or an actual issue.
>
> I think these two cases are both "error handling done in a different
> order", where the test expected to get EMFILE (or something like
> that), but now the file open is done before, so it actually gets
> EACCES.
>
> I'm not sure it really matters, but the old code did seem to do the
> file prepare first, and the
>
> path.dentry = lookup_noperm(&QSTR(name->name), root);
>
> afterwards.
>
> And while I don't think the order *really* matters, I do think the old
> order was better.
>
> And I think it can be done that way.
>
> So Christian, I think the proper solution is to not do that
> "dentry_open()" in the FD_ADD() after doing all the other prep-work:
>
> ret = FD_ADD(O_CLOEXEC, dentry_open(&path, oflag, current_cred()));
>
> but instead make a new proper "handle_mq_open()" helper that does the whole
>
> path.dentry = lookup_noperm(&QSTR(name->name), root);
> ...
> ret = prepare_open(path.dentry, oflag, ro, mode, name, attr);
> ...
> return dentry_open(&path, oflag, current_cred());
>
> dance, and then do
>
> ret = FD_ADD(O_CLOEXEC, handle_mq_open());
>
> so that this all is done in the same order as it used to be done.
>
> Hmm?
Yeah, we sure can do that. Ok, reproduced and then added a fix.
> I think the same thing is true for the other failed test-case.
>
> Linus
Added the following which imho looks nicer as well:
commit b52154435037d501e73bf09a644dffede831ed05
Author: Christian Brauner <brauner@kernel.org>
ipc: preserve original file opening pattern
LTP seems to have assertions about what errnos are surfaced in what
order. I think that's often misguided but we can accomodate this here
and preserve the original order.
Fixes: https://lore.kernel.org/c41de645-8234-465f-a3be-f0385e3a163c@sirena.org.uk
Reported-by: Mark Brown <broonie@kernel.org>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index 8b9b53db67a2..d3a588d0dcf6 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -892,14 +892,35 @@ static int prepare_open(struct dentry *dentry, int oflag, int ro,
return inode_permission(&nop_mnt_idmap, d_inode(dentry), acc);
}
+static struct file *mqueue_file_open(struct filename *name,
+ struct vfsmount *mnt, int oflag, bool ro,
+ umode_t mode, struct mq_attr *attr)
+{
+ struct path path __free(path_put) = {};
+ struct dentry *dentry;
+ int ret;
+
+ dentry = lookup_noperm(&QSTR(name->name), mnt->mnt_root);
+ if (IS_ERR(dentry))
+ return ERR_CAST(dentry);
+
+ path.dentry = dentry;
+ path.mnt = mntget(mnt);
+
+ ret = prepare_open(path.dentry, oflag, ro, mode, name, attr);
+ if (ret)
+ return ERR_PTR(ret);
+
+ return dentry_open(&path, oflag, current_cred());
+}
+
static int do_mq_open(const char __user *u_name, int oflag, umode_t mode,
struct mq_attr *attr)
{
+ struct filename *name __free(putname) = NULL;;
struct vfsmount *mnt = current->nsproxy->ipc_ns->mq_mnt;
struct dentry *root = mnt->mnt_root;
- struct filename *name;
- struct path path;
- int ret;
+ int fd;
int ro;
audit_mq_open(oflag, mode, attr);
@@ -910,23 +931,11 @@ static int do_mq_open(const char __user *u_name, int oflag, umode_t mode,
ro = mnt_want_write(mnt); /* we'll drop it in any case */
inode_lock(d_inode(root));
- path.dentry = lookup_noperm(&QSTR(name->name), root);
- if (IS_ERR(path.dentry)) {
- ret = PTR_ERR(path.dentry);
- goto out_unlock;
- }
- path.mnt = mntget(mnt);
- ret = prepare_open(path.dentry, oflag, ro, mode, name, attr);
- if (!ret)
- ret = FD_ADD(O_CLOEXEC, dentry_open(&path, oflag, current_cred()));
- path_put(&path);
-
-out_unlock:
+ fd = FD_ADD(O_CLOEXEC, mqueue_file_open(name, mnt, oflag, ro, mode, attr));
inode_unlock(d_inode(root));
if (!ro)
mnt_drop_write(mnt);
- putname(name);
- return ret;
+ return fd;
}
SYSCALL_DEFINE4(mq_open, const char __user *, u_name, int, oflag, umode_t, mode,
^ permalink raw reply related [flat|nested] 74+ messages in thread
* Re: [PATCH v4 42/47] tty: convert ptm_open_peer() to FD_PREPARE()
2025-11-25 22:39 ` Mark Brown
@ 2025-11-26 13:35 ` Christian Brauner
2025-11-26 14:22 ` Mark Brown
0 siblings, 1 reply; 74+ messages in thread
From: Christian Brauner @ 2025-11-26 13:35 UTC (permalink / raw)
To: Mark Brown
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
On Tue, Nov 25, 2025 at 10:39:37PM +0000, Mark Brown wrote:
> On Sun, Nov 23, 2025 at 05:34:00PM +0100, Christian Brauner wrote:
> > Signed-off-by: Christian Brauner <brauner@kernel.org>
>
> > - fd_install(fd, filp);
> > + fd = FD_ADD(flags, dentry_open(&path, flags, current_cred()));
> > + if (fd < 0)
> > + mntput(path.mnt);
>
> I'm seeing a regression in -next in the filesystems devpts_pts kselftest
> which bisects to this patch:
>
> # selftests: filesystems: devpts_pts
> # Failed to perform TIOCGPTPEER ioctl
> # Failed to unmount "/dev/pts": Device or resource busy
Yeah, this is a dumb bug. I fixed that.
Adding:
commit 138027e74e9f602e3bb91112dd38840c7a5007e4
Author: Christian Brauner <brauner@kernel.org>
devpts: preserve original file opening pattern
LTP seems to have assertions about what errnos are surfaced in what
order. I think that's often misguided but we can accomodate this here
and preserve the original order.
This also makes sure to unconditionally release the reference on the
mount that we've taken after we opened the file.
Fixes: https://lore.kernel.org/37ac7af5-584f-4768-a462-4d1071c43eaf@sirena.org.uk
Fixes: b945a44e919a ("tty: convert ptm_open_peer() to FD_ADD()")
Reported-by: Mark Brown <broonie@kernel.org>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index e6249c2b5672..41c1d909525c 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -589,6 +589,23 @@ static inline void legacy_pty_init(void) { }
#ifdef CONFIG_UNIX98_PTYS
static struct cdev ptmx_cdev;
+static struct file *ptm_open_peer_file(struct file *master,
+ struct tty_struct *tty, int flags)
+{
+ struct path path;
+ struct file *file;
+
+ /* Compute the slave's path */
+ path.mnt = devpts_mntget(master, tty->driver_data);
+ if (IS_ERR(path.mnt))
+ return ERR_CAST(path.mnt);
+ path.dentry = tty->link->driver_data;
+
+ file = dentry_open(&path, flags, current_cred());
+ mntput(path.mnt);
+ return file;
+}
+
/**
* ptm_open_peer - open the peer of a pty
* @master: the open struct file of the ptmx device node
@@ -601,22 +618,10 @@ static struct cdev ptmx_cdev;
*/
int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
{
- int fd;
- struct path path;
-
if (tty->driver != ptm_driver)
return -EIO;
- /* Compute the slave's path */
- path.mnt = devpts_mntget(master, tty->driver_data);
- if (IS_ERR(path.mnt))
- return PTR_ERR(path.mnt);
- path.dentry = tty->link->driver_data;
-
- fd = FD_ADD(flags, dentry_open(&path, flags, current_cred()));
- if (fd < 0)
- mntput(path.mnt);
- return fd;
+ return FD_ADD(flags, ptm_open_peer_file(master, tty, flags));
}
static int pty_unix98_ioctl(struct tty_struct *tty,
> not ok 1 selftests: filesystems: devpts_pts # exit=1
>
> Full log:
>
> https://lava.sirena.org.uk/scheduler/job/2134811#L6956
>
> This one seems more clearly like a real problem than the other issue in
> the same series that I just reported, but I've only given this the most
> superficial look so possibly it's a test issue. As with that one the
> subject says FD_PREPARE() but the patch actually converts to FD_ADD().
>
> bisect log:
>
> # bad: [92fd6e84175befa1775e5c0ab682938eca27c0b2] Add linux-next specific files for 20251125
> # good: [07e9a68478302d35f3372ac8c9994d679a9cfdca] Merge branch 'for-linux-next-fixes' of https://gitlab.freedesktop.org/drm/misc/kernel.git
> # good: [cb99656b7c4185953c9d272bbdab63c8aa651e6e] spi: Fix potential uninitialized variable in probe()
> # good: [df919994d323c7c86e32fa2745730136d58ada12] ASoC: Intel: avs: Replace snprintf() with scnprintf()
> # good: [670500b41e543c5cb09eb9f7f0e4e26c5b5fdf7e] regulator: pca9450: Fix error code in probe()
> # good: [3af1815a2f9caebfc666af3912e24d030a5368d5] ASoC: SDCA: Add basic SDCA function driver
> # good: [3efee7362dbf896072af1c1aaeaf9fd6e235c591] ASoC: SDCA: Add stubs for FDL helper functions
> # good: [f1c668269ded16bea32a11d03f4584caa0c018c9] regulator: qcomm-labibb: replace use of system_wq with system_dfl_wq
> # good: [43a3adb6dd39d98bf84e04569e7604be5e5c0d79] spi: spidev: add compatible for arduino spi mcu interface
> # good: [33822d795ab93067d9a65f42003c0d01c65d4a9d] ASoC: cs35l56: Use SND_SOC_BYTES_E_ACC() for CAL_DATA_RB control
> # good: [d5089fffe1db04a802b028c2ef4875be1ed452a3] ASoC: tas2781: Add tas2568/2574/5806m/5806md/5830 support
> # good: [12d821bd13d42e6de3ecb1c13918b1f06a3ee213] regulator: Add FP9931/JD9930 driver
> # good: [3045e29d248bde2a68da425498a656093ee0df69] firmware: cs_dsp: Append \n to debugfs string during read
> # good: [bdf96e9135a0cf53a853a19c30fa11131a744062] ASoC: codecs: lpass-rx-macro: fix mute_stream affecting all paths
> # good: [e2c48498a93404743e0565dcac29450fec02e6a3] ASoC: soc-core: Pre-check zero CPU/codec DAIs, handle early rtd->dais alloc failure
> # good: [7a0a87712120329c034b0aae88bdaa05bd046f10] ASoC: wsa883x: drop GPIOD_FLAGS_BIT_NONEXCLUSIVE flag from GPIO lookup
> # good: [b871d9adffe5a64a1fd9edcb1aebbcc995b17901] regulator: make the subsystem aware of shared GPIOs
> # good: [d9813cd23d5a7b254cc1b1c1ea042634d8da62e6] spi: sophgo: Fix incorrect use of bus width value macros
> # good: [e45979641a9a9dbb48fc77c5b36a5091a92e7227] ASoC: SOF: sof-client-probes: Replace snprintf() with scnprintf()
> # good: [d218ea171430e49412804efb794942dd121a8032] ASoC: mediatek: mt8189: add machine driver with nau8825
> # good: [21e68bcb1b0c688c2d9ca0d457922febac650ac1] regulator: renesas-usb-vbus-regulator: Remove unused headers
> # good: [bd79452b39c21599e2cff42e9fbeb182656b6f6a] MAINTAINERS: adjust file entry in RISC-V MICROCHIP SUPPORT
> # good: [96498e804cb6629e02747336a0a33e4955449732] spi: davinci: remove platform data header
> # good: [9e510e677090bb794b46348b10e1c8038286e00a] spi: aspeed: Add support for the AST2700 SPI controller
> # good: [4422df6782eb7aa9725a3c09d9ba3c38ecc85df4] ASoC: ux500: mop500_ab8500: convert to snd_soc_dapm_xxx()
> # good: [d5c8b7902a41625ea328b52c78ebe750fbf6fef7] ASoC: Intel: avs: Honor NHLT override when setting up a path
> # good: [118eb2cb97b8fc0d515bb0449495959247db58f0] spi: bcm63xx: drop wrong casts in probe()
> # good: [f7ae6d4ec6520a901787cbab273983e96d8516da] PCI/TSM: Add 'dsm' and 'bound' attributes for dependent functions
> # good: [079115370d00c78ef69b31dd15def90adf2aa579] PCI/IDE: Initialize an ID for all IDE streams
> # good: [059f545832be85d29ac9ccc416a16f647aa78485] spi: add support for microchip "soft" spi controller
> # good: [6402ddf3027d8975f135cf2b2014d6bbeb2d3436] MAINTAINERS: refer to trivial-codec.yaml in relevant sections
> # good: [4e00135b2dd1d7924a58bffa551b6ceb3bd836f2] spi: spi-cadence: supports transmission with bits_per_word of 16 and 32
> # good: [8ff3dcb0e8a8bf6c41f23ed4aa62d066d3948a10] ASoC: codecs: lpass-rx-macro: add SM6115 compatible
> # good: [8d63e85c5b50f1dbfa0ccb214bd91fe5d7e2e860] firmware: cs_dsp: fix kernel-doc warnings in a header file
> # good: [e65b871c9b5af9265aefc5b8cd34993586d93aab] ASoC: codecs: pm4125: Remove irq_chip on component unbind
> # good: [123cd174a3782307787268adf45f22de4d290128] ASoC: Intel: atom: Replace strcpy() with strscpy()
> # good: [1d562ba0aa7df81335bf96c02be77efe8d5bab87] spi: dt-bindings: nuvoton,npcm-pspi: Convert to DT schema
> # good: [4d6e2211aeb932e096f673c88475016b1cc0f8ab] ASoC: Intel: boards: fix HDMI playback lookup when HDMI-In capture used
> # good: [32172cf3cb543a04c41a1677c97a38e60cad05b6] ASoC: cs35l56: Allow restoring factory calibration through ALSA control
> # good: [873bc94689d832878befbcadc10b6ad5bb4e0027] ASoC: Intel: sof_sdw: add codec speaker support for the SKU
> # good: [b3a5302484033331af37569f7277d00131694b57] ASoC: Intel: sof_rt5682: Add quirk override support
> # good: [772ada50282b0c80343c8989147db816961f571d] ASoC: cs35l56: Alter error codes for calibration routine
> # good: [fb1ebb10468da414d57153ddebaab29c38ef1a78] regulator: core: disable supply if enabling main regulator fails
> # good: [6985defd1d832f1dd9d1977a6a2cc2cef7632704] regmap: sdw-mbq: Reorder regmap_mbq_context struct for better packing
> # good: [6951be397ca8b8b167c9f99b5a11c541148c38cb] ASoC: codecs: pm4125: remove duplicate code
> # good: [4e92abd0a11b91af3742197a9ca962c3c00d0948] spi: imx: add i.MX51 ECSPI target mode support
> # good: [2089f086303b773e181567fd8d5df3038bd85937] regulator: mt6363: Remove unneeded semicolon
> # good: [abc9a349b87ac0fd3ba8787ca00971b59c2e1257] spi: fsl-qspi: support the SpacemiT K1 SoC
> # good: [6bd1ad97eb790570c167d4de4ca59fbc9c33722a] regulator: pf9453: Fix kernel doc for mux_poll()
> # good: [55d03b5b5bdd04daf9a35ce49db18d8bb488dffb] spi: imx: remove CLK calculation and check for target mode
> # good: [1b0f3f9ee41ee2bdd206667f85ea2aa36dfe6e69] ASoC: SDCA: support Q7.8 volume format
> # good: [655079ac8a7721ac215a0596e3f33b740e01144a] ASoC: qcom: q6asm: Use guard() for spin locks
> # good: [3c36965df80801344850388592e95033eceea05b] regulator: Add support for MediaTek MT6363 SPMI PMIC Regulators
> # good: [aa897ffc396b48cc39eee133b6b43175d0df9eb5] ASoC: dt-bindings: ti,pcm1862: convert to dtschema
> # good: [2f538ef9f6f7c3d700c68536f21447dfc598f8c8] spi: aspeed: Use devm_iounmap() to unmap devm_ioremap() memory
> # good: [c4e68959af66df525d71db619ffe44af9178bb22] ASoC: dt-bindings: ti,tas2781: Add TAS5822 support
> # good: [af9c8092d84244ca54ffb590435735f788e7a170] regmap: i3c: Use ARRAY_SIZE()
> # good: [380fd29d57abe6679d87ec56babe65ddc5873a37] spi: tegra210-quad: Check hardware status on timeout
> # good: [2ecc8c089802e033d2e5204d21a9f467e2517df9] regulator: pf9453: remove unused I2C_LT register
> # good: [252abf2d07d33b1c70a59ba1c9395ba42bbd793e] regulator: Small cleanup in of_get_regulation_constraints()
> # good: [84194c66aaf78fed150edb217b9f341518b1cba2] ASoC: codecs: aw88261: pass pointer directly instead of passing the address
> # good: [ed5d499b5c9cc11dd3edae1a7a55db7dfa4f1bdc] regcache: maple: Split ->populate() from ->init()
> # good: [6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3] ASoC: codec: wm8400: replace printk() calls with dev_*() device aware logging
> # good: [ecd0de438c1f0ee86cf8f6d5047965a2a181444b] spi: tle62x0: Add newline to sysfs attribute output
> # good: [f1dfbc1b5cf8650ae9a0d543e5f5335fc0f478ce] ASoC: max98090/91: fixing the stream index
> # good: [e73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0] ASoC: soc-core: check ops & auto_selectable_formats in snd_soc_dai_get_fmt() to prevent dereference error
> # good: [20bcda681f8597e86070a4b3b12d1e4f541865d3] ASoC: codecs: va-macro: fix revision checking
> # good: [8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce] ASoC: qcom: sc7280: make use of common helpers
> # good: [cf6bf51b53252284bafc7377a4d8dbf10f048b4d] ASoC: cs4271: Add support for the external mclk
> # good: [28039efa4d8e8bbf98b066133a906bd4e307d496] MAINTAINERS: remove obsolete file entry in DIALOG SEMICONDUCTOR DRIVERS
> # good: [e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8] regmap: warn users about uninitialized flat cache
> # good: [f034c16a4663eaf3198dc18b201ba50533fb5b81] ASoC: spacemit: add failure check for spacemit_i2s_init_dai()
> # good: [66fecfa91deb536a12ddf3d878a99590d7900277] ASoC: spacemit: use `depends on` instead of `select`
> # good: [4a5ac6cd05a7e54f1585d7779464d6ed6272c134] ASoC: sun4i-spdif: Support SPDIF output on A523 family
> # good: [4795375d8aa072e9aacb0b278e6203c6ca41816a] ASoC: cs-amp-lib-test: Add test cases for cs_amp_set_efi_calibration_data()
> # good: [ef042df96d0e1089764f39ede61bc8f140a4be00] ASoC: SDCA: Add HID button IRQ
> # good: [4c33cef58965eb655a0ac8e243aa323581ec025f] regulator: pca9450: link regulator inputs to supply groups
> # good: [77a58ba7c64ccca20616aa03599766ccb0d1a330] spi: spi-mem: Trace exec_op
> # good: [01313661b248c5ba586acae09bff57077dbec0a5] regulator: Let raspberrypi drivers depend on ARM
> # good: [d29479abaded34b2b1dab2e17efe96a65eba3d61] ASoC: renesas: fsi: Constify struct fsi_stream_handler
> # good: [e7434adf0c53a84d548226304cdb41c8818da1cb] ASoC: cs530x: Add SPI bus support for cs530x parts
> # good: [e973dfe9259095fb509ab12658c68d46f0e439d7] ASoC: qcom: sm8250: add qrb2210-sndcard compatible string
> # good: [c17fa4cbc546c431ccf13e9354d5d9c1cd247b7c] ASoC: sdw_utils: add name_prefix for rt1321 part id
> # good: [fd5ef3d69f8975bad16c437a337b5cb04c8217a2] spi: spi-qpic-snand: make qcom_spi_ecc_engine_ops_pipelined const
> # good: [d054cc3a2ccfb19484f3b54d69b6e416832dc8f4] regulator: rpmh-regulator: Add RPMH regulator support for PMR735D
> # good: [2528c15f314ece50218d1273654f630d74109583] ASoC: max98090/91: adding DAPM routing for digital output for max98091
> # good: [310bf433c01f78e0756fd5056a43118a2f77318c] ASoC: max98090/91: fixing a space
> # good: [638bae3fb225a708dc67db613af62f6d14c4eff4] ASoC: max98090/91: added DAPM widget for digital output for max98091
> # good: [ecba655bf54a661ffe078856cd8dbc898270e4b5] ASoC: fsl_aud2htx: add IEC958_SUBFRAME_LE format in supported list
> # good: [7e1906643a7374529af74b013bba35e4fa4e6ffc] ASoC: codecs: va-macro: Clean up on error path in probe()
> # good: [d742ebcfe524dc54023f7c520d2ed2e4b7203c19] ASoC: soc.h: remove snd_soc_kcontrol_component()
> # good: [6658472a3e2de08197acfe099ba71ee0e2505ecf] ASoC: amd: amd_sdw: Propagate the PCI subsystem Vendor and Device IDs
> # good: [fce217449075d59b29052b8cdac567f0f3e22641] ASoC: spacemit: add i2s support for K1 SoC
> # good: [0cc08c8130ac8f74419f99fe707dc193b7f79d86] spi: aspeed: Fix an IS_ERR() vs NULL bug in probe()
> # good: [0743acf746a81e0460a56fd5ff847d97fa7eb370] spi: airoha: buffer must be 0xff-ed before writing
> # good: [d77daa49085b067137d0adbe3263f75a7ee13a1b] spi: aspeed: fix spelling mistake "triming" -> "trimming"
> # good: [15afe57a874eaf104bfbb61ec598fa31627f7b19] ASoC: dt-bindings: qcom: Add Kaanapali LPASS macro codecs
> # good: [1e570e77392f43a3cdab2849d1f81535f8a033e2] ASoC: mxs-saif: support usage with simple-audio-card
> # good: [fb25114cd760c13cf177d9ac37837fafcc9657b5] regulator: sy7636a: add gpios and input regulator
> # good: [6621b0f118d500092f5f3d72ddddb22aeeb3c3a0] ASoC: codecs: rt5670: use SOC_VALUE_ENUM_SINGLE_DECL for DAC2 L/R MX-1B
> # good: [65efe5404d151767653c7b7dd39bd2e7ad532c2d] regulator: rpmh-regulator: Add RPMH regulator support for Glymur
> # good: [0b0eb7702a9fa410755e86124b4b7cd36e7d1cb4] ASoC: replace use of system_wq with system_dfl_wq
> # good: [433e294c3c5b5d2020085a0e36c1cb47b694690a] regulator: core: forward undervoltage events downstream by default
> # good: [bf770d6d2097a52d87f4d9c88d0b05bd3998d7de] x86/module: Improve relocation error messages
> # good: [c2d420796a427dda71a2400909864e7f8e037fd4] elfnote: Change ELFNOTE() to use __UNIQUE_ID()
> # good: [7e7e2c6e2a1cb250f8d03bb99eed01f6d982d5dd] ASoC: sof-function-topology-lib: escalate the log when missing function topoplogy
> # good: [9797329220a2c6622411eb9ecf6a35b24ce09d04] ASoC: sof-function-topology-lib: escalate the log when missing function topoplogy
> # good: [64d87ccfae3326a9561fe41dc6073064a083e0df] spi: aspeed: Only map necessary address window region
> # good: [4412ab501677606436e5c49e41151a1e6eac7ac0] spi: dt-bindings: spi-qpic-snand: Add IPQ5332 compatible
> # good: [5e537031f322d55315cd384398b726a9a0748d47] ASoC: codecs: Fix the error of excessive semicolons
> # good: [fe8cc44dd173cde5788ab4e3730ac61f3d316d9c] spi: dw: add target mode support
> # good: [4d410ba9aa275e7990a270f63ce436990ace1bea] dt-bindings: sound: Update ADMAIF bindings for tegra264
> # good: [b83fb1b14c06bdd765903ac852ba20a14e24f227] spi: offload: Add offset parameter
> # good: [6277a486a7faaa6c87f4bf1d59a2de233a093248] regulator: dt-bindings: Convert Dialog DA9211 Regulators to DT schema
> # good: [6c177775dcc5e70a64ddf4ee842c66af498f2c7c] Merge branch 'next/drivers' into for-next
> git bisect start '92fd6e84175befa1775e5c0ab682938eca27c0b2' '07e9a68478302d35f3372ac8c9994d679a9cfdca' 'cb99656b7c4185953c9d272bbdab63c8aa651e6e' 'df919994d323c7c86e32fa2745730136d58ada12' '670500b41e543c5cb09eb9f7f0e4e26c5b5fdf7e' '3af1815a2f9caebfc666af3912e24d030a5368d5' '3efee7362dbf896072af1c1aaeaf9fd6e235c591' 'f1c668269ded16bea32a11d03f4584caa0c018c9' '43a3adb6dd39d98bf84e04569e7604be5e5c0d79' '33822d795ab93067d9a65f42003c0d01c65d4a9d' 'd5089fffe1db04a802b028c2ef4875be1ed452a3' '12d821bd13d42e6de3ecb1c13918b1f06a3ee213' '3045e29d248bde2a68da425498a656093ee0df69' 'bdf96e9135a0cf53a853a19c30fa11131a744062' 'e2c48498a93404743e0565dcac29450fec02e6a3' '7a0a87712120329c034b0aae88bdaa05bd046f10' 'b871d9adffe5a64a1fd9edcb1aebbcc995b17901' 'd9813cd23d5a7b254cc1b1c1ea042634d8da62e6' 'e45979641a9a9dbb48fc77c5b36a5091a92e7227' 'd218ea171430e49412804efb794942dd121a8032' '21e68bcb1b0c688c2d9ca0d457922febac650ac1' 'bd79452b39c21599e2cff42e9fbeb182656b6f6a' '96498e804cb6629e02747336a0a33e4955449732' '9e510e677090bb794b46348b10e1c8038286e00a' '4422df6782eb7aa9725a3c09d9ba3c38ecc85df4' 'd5c8b7902a41625ea328b52c78ebe750fbf6fef7' '118eb2cb97b8fc0d515bb0449495959247db58f0' 'f7ae6d4ec6520a901787cbab273983e96d8516da' '079115370d00c78ef69b31dd15def90adf2aa579' '059f545832be85d29ac9ccc416a16f647aa78485' '6402ddf3027d8975f135cf2b2014d6bbeb2d3436' '4e00135b2dd1d7924a58bffa551b6ceb3bd836f2' '8ff3dcb0e8a8bf6c41f23ed4aa62d066d3948a10' '8d63e85c5b50f1dbfa0ccb214bd91fe5d7e2e860' 'e65b871c9b5af9265aefc5b8cd34993586d93aab' '123cd174a3782307787268adf45f22de4d290128' '1d562ba0aa7df81335bf96c02be77efe8d5bab87' '4d6e2211aeb932e096f673c88475016b1cc0f8ab' '32172cf3cb543a04c41a1677c97a38e60cad05b6' '873bc94689d832878befbcadc10b6ad5bb4e0027' 'b3a5302484033331af37569f7277d00131694b57' '772ada50282b0c80343c8989147db816961f571d' 'fb1ebb10468da414d57153ddebaab29c38ef1a78' '6985defd1d832f1dd9d1977a6a2cc2cef7632704' '6951be397ca8b8b167c9f99b5a11c541148c38cb' '4e92abd0a11b91af3742197a9ca962c3c00d0948' '2089f086303b773e181567fd8d5df3038bd85937' 'abc9a349b87ac0fd3ba8787ca00971b59c2e1257' '6bd1ad97eb790570c167d4de4ca59fbc9c33722a' '55d03b5b5bdd04daf9a35ce49db18d8bb488dffb' '1b0f3f9ee41ee2bdd206667f85ea2aa36dfe6e69' '655079ac8a7721ac215a0596e3f33b740e01144a' '3c36965df80801344850388592e95033eceea05b' 'aa897ffc396b48cc39eee133b6b43175d0df9eb5' '2f538ef9f6f7c3d700c68536f21447dfc598f8c8' 'c4e68959af66df525d71db619ffe44af9178bb22' 'af9c8092d84244ca54ffb590435735f788e7a170' '380fd29d57abe6679d87ec56babe65ddc5873a37' '2ecc8c089802e033d2e5204d21a9f467e2517df9' '252abf2d07d33b1c70a59ba1c9395ba42bbd793e' '84194c66aaf78fed150edb217b9f341518b1cba2' 'ed5d499b5c9cc11dd3edae1a7a55db7dfa4f1bdc' '6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3' 'ecd0de438c1f0ee86cf8f6d5047965a2a181444b' 'f1dfbc1b5cf8650ae9a0d543e5f5335fc0f478ce' 'e73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0' '20bcda681f8597e86070a4b3b12d1e4f541865d3' '8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce' 'cf6bf51b53252284bafc7377a4d8dbf10f048b4d' '28039efa4d8e8bbf98b066133a906bd4e307d496' 'e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8' 'f034c16a4663eaf3198dc18b201ba50533fb5b81' '66fecfa91deb536a12ddf3d878a99590d7900277' '4a5ac6cd05a7e54f1585d7779464d6ed6272c134' '4795375d8aa072e9aacb0b278e6203c6ca41816a' 'ef042df96d0e1089764f39ede61bc8f140a4be00' '4c33cef58965eb655a0ac8e243aa323581ec025f' '77a58ba7c64ccca20616aa03599766ccb0d1a330' '01313661b248c5ba586acae09bff57077dbec0a5' 'd29479abaded34b2b1dab2e17efe96a65eba3d61' 'e7434adf0c53a84d548226304cdb41c8818da1cb' 'e973dfe9259095fb509ab12658c68d46f0e439d7' 'c17fa4cbc546c431ccf13e9354d5d9c1cd247b7c' 'fd5ef3d69f8975bad16c437a337b5cb04c8217a2' 'd054cc3a2ccfb19484f3b54d69b6e416832dc8f4' '2528c15f314ece50218d1273654f630d74109583' '310bf433c01f78e0756fd5056a43118a2f77318c' '638bae3fb225a708dc67db613af62f6d14c4eff4' 'ecba655bf54a661ffe078856cd8dbc898270e4b5' '7e1906643a7374529af74b013bba35e4fa4e6ffc' 'd742ebcfe524dc54023f7c520d2ed2e4b7203c19' '6658472a3e2de08197acfe099ba71ee0e2505ecf' 'fce217449075d59b29052b8cdac567f0f3e22641' '0cc08c8130ac8f74419f99fe707dc193b7f79d86' '0743acf746a81e0460a56fd5ff847d97fa7eb370' 'd77daa49085b067137d0adbe3263f75a7ee13a1b' '15afe57a874eaf104bfbb61ec598fa31627f7b19' '1e570e77392f43a3cdab2849d1f81535f8a033e2' 'fb25114cd760c13cf177d9ac37837fafcc9657b5' '6621b0f118d500092f5f3d72ddddb22aeeb3c3a0' '65efe5404d151767653c7b7dd39bd2e7ad532c2d' '0b0eb7702a9fa410755e86124b4b7cd36e7d1cb4' '433e294c3c5b5d2020085a0e36c1cb47b694690a' 'bf770d6d2097a52d87f4d9c88d0b05bd3998d7de' 'c2d420796a427dda71a2400909864e7f8e037fd4' '7e7e2c6e2a1cb250f8d03bb99eed01f6d982d5dd' '9797329220a2c6622411eb9ecf6a35b24ce09d04' '64d87ccfae3326a9561fe41dc6073064a083e0df' '4412ab501677606436e5c49e41151a1e6eac7ac0' '5e537031f322d55315cd384398b726a9a0748d47' 'fe8cc44dd173cde5788ab4e3730ac61f3d316d9c' '4d410ba9aa275e7990a270f63ce436990ace1bea' 'b83fb1b14c06bdd765903ac852ba20a14e24f227' '6277a486a7faaa6c87f4bf1d59a2de233a093248' '6c177775dcc5e70a64ddf4ee842c66af498f2c7c'
> # test job: [cb99656b7c4185953c9d272bbdab63c8aa651e6e] https://lava.sirena.org.uk/scheduler/job/2132762
> # test job: [df919994d323c7c86e32fa2745730136d58ada12] https://lava.sirena.org.uk/scheduler/job/2121710
> # test job: [670500b41e543c5cb09eb9f7f0e4e26c5b5fdf7e] https://lava.sirena.org.uk/scheduler/job/2121053
> # test job: [3af1815a2f9caebfc666af3912e24d030a5368d5] https://lava.sirena.org.uk/scheduler/job/2115465
> # test job: [3efee7362dbf896072af1c1aaeaf9fd6e235c591] https://lava.sirena.org.uk/scheduler/job/2115125
> # test job: [f1c668269ded16bea32a11d03f4584caa0c018c9] https://lava.sirena.org.uk/scheduler/job/2113592
> # test job: [43a3adb6dd39d98bf84e04569e7604be5e5c0d79] https://lava.sirena.org.uk/scheduler/job/2115050
> # test job: [33822d795ab93067d9a65f42003c0d01c65d4a9d] https://lava.sirena.org.uk/scheduler/job/2112459
> # test job: [d5089fffe1db04a802b028c2ef4875be1ed452a3] https://lava.sirena.org.uk/scheduler/job/2111799
> # test job: [12d821bd13d42e6de3ecb1c13918b1f06a3ee213] https://lava.sirena.org.uk/scheduler/job/2112898
> # test job: [3045e29d248bde2a68da425498a656093ee0df69] https://lava.sirena.org.uk/scheduler/job/2111763
> # test job: [bdf96e9135a0cf53a853a19c30fa11131a744062] https://lava.sirena.org.uk/scheduler/job/2109740
> # test job: [e2c48498a93404743e0565dcac29450fec02e6a3] https://lava.sirena.org.uk/scheduler/job/2107365
> # test job: [7a0a87712120329c034b0aae88bdaa05bd046f10] https://lava.sirena.org.uk/scheduler/job/2107534
> # test job: [b871d9adffe5a64a1fd9edcb1aebbcc995b17901] https://lava.sirena.org.uk/scheduler/job/2107898
> # test job: [d9813cd23d5a7b254cc1b1c1ea042634d8da62e6] https://lava.sirena.org.uk/scheduler/job/2105382
> # test job: [e45979641a9a9dbb48fc77c5b36a5091a92e7227] https://lava.sirena.org.uk/scheduler/job/2104425
> # test job: [d218ea171430e49412804efb794942dd121a8032] https://lava.sirena.org.uk/scheduler/job/2104309
> # test job: [21e68bcb1b0c688c2d9ca0d457922febac650ac1] https://lava.sirena.org.uk/scheduler/job/2104503
> # test job: [bd79452b39c21599e2cff42e9fbeb182656b6f6a] https://lava.sirena.org.uk/scheduler/job/2104088
> # test job: [96498e804cb6629e02747336a0a33e4955449732] https://lava.sirena.org.uk/scheduler/job/2099747
> # test job: [9e510e677090bb794b46348b10e1c8038286e00a] https://lava.sirena.org.uk/scheduler/job/2093874
> # test job: [4422df6782eb7aa9725a3c09d9ba3c38ecc85df4] https://lava.sirena.org.uk/scheduler/job/2097746
> # test job: [d5c8b7902a41625ea328b52c78ebe750fbf6fef7] https://lava.sirena.org.uk/scheduler/job/2092719
> # test job: [118eb2cb97b8fc0d515bb0449495959247db58f0] https://lava.sirena.org.uk/scheduler/job/2092527
> # test job: [f7ae6d4ec6520a901787cbab273983e96d8516da] https://lava.sirena.org.uk/scheduler/job/2122586
> # test job: [079115370d00c78ef69b31dd15def90adf2aa579] https://lava.sirena.org.uk/scheduler/job/2121428
> # test job: [059f545832be85d29ac9ccc416a16f647aa78485] https://lava.sirena.org.uk/scheduler/job/2086759
> # test job: [6402ddf3027d8975f135cf2b2014d6bbeb2d3436] https://lava.sirena.org.uk/scheduler/job/2086593
> # test job: [4e00135b2dd1d7924a58bffa551b6ceb3bd836f2] https://lava.sirena.org.uk/scheduler/job/2082522
> # test job: [8ff3dcb0e8a8bf6c41f23ed4aa62d066d3948a10] https://lava.sirena.org.uk/scheduler/job/2083115
> # test job: [8d63e85c5b50f1dbfa0ccb214bd91fe5d7e2e860] https://lava.sirena.org.uk/scheduler/job/2082575
> # test job: [e65b871c9b5af9265aefc5b8cd34993586d93aab] https://lava.sirena.org.uk/scheduler/job/2083139
> # test job: [123cd174a3782307787268adf45f22de4d290128] https://lava.sirena.org.uk/scheduler/job/2078963
> # test job: [1d562ba0aa7df81335bf96c02be77efe8d5bab87] https://lava.sirena.org.uk/scheduler/job/2078345
> # test job: [4d6e2211aeb932e096f673c88475016b1cc0f8ab] https://lava.sirena.org.uk/scheduler/job/2077998
> # test job: [32172cf3cb543a04c41a1677c97a38e60cad05b6] https://lava.sirena.org.uk/scheduler/job/2075069
> # test job: [873bc94689d832878befbcadc10b6ad5bb4e0027] https://lava.sirena.org.uk/scheduler/job/2074834
> # test job: [b3a5302484033331af37569f7277d00131694b57] https://lava.sirena.org.uk/scheduler/job/2074543
> # test job: [772ada50282b0c80343c8989147db816961f571d] https://lava.sirena.org.uk/scheduler/job/2069185
> # test job: [fb1ebb10468da414d57153ddebaab29c38ef1a78] https://lava.sirena.org.uk/scheduler/job/2059783
> # test job: [6985defd1d832f1dd9d1977a6a2cc2cef7632704] https://lava.sirena.org.uk/scheduler/job/2059123
> # test job: [6951be397ca8b8b167c9f99b5a11c541148c38cb] https://lava.sirena.org.uk/scheduler/job/2055768
> # test job: [4e92abd0a11b91af3742197a9ca962c3c00d0948] https://lava.sirena.org.uk/scheduler/job/2055839
> # test job: [2089f086303b773e181567fd8d5df3038bd85937] https://lava.sirena.org.uk/scheduler/job/2058048
> # test job: [abc9a349b87ac0fd3ba8787ca00971b59c2e1257] https://lava.sirena.org.uk/scheduler/job/2054610
> # test job: [6bd1ad97eb790570c167d4de4ca59fbc9c33722a] https://lava.sirena.org.uk/scheduler/job/2053444
> # test job: [55d03b5b5bdd04daf9a35ce49db18d8bb488dffb] https://lava.sirena.org.uk/scheduler/job/2053865
> # test job: [1b0f3f9ee41ee2bdd206667f85ea2aa36dfe6e69] https://lava.sirena.org.uk/scheduler/job/2053663
> # test job: [655079ac8a7721ac215a0596e3f33b740e01144a] https://lava.sirena.org.uk/scheduler/job/2049712
> # test job: [3c36965df80801344850388592e95033eceea05b] https://lava.sirena.org.uk/scheduler/job/2049474
> # test job: [aa897ffc396b48cc39eee133b6b43175d0df9eb5] https://lava.sirena.org.uk/scheduler/job/2048775
> # test job: [2f538ef9f6f7c3d700c68536f21447dfc598f8c8] https://lava.sirena.org.uk/scheduler/job/2048626
> # test job: [c4e68959af66df525d71db619ffe44af9178bb22] https://lava.sirena.org.uk/scheduler/job/2044018
> # test job: [af9c8092d84244ca54ffb590435735f788e7a170] https://lava.sirena.org.uk/scheduler/job/2043675
> # test job: [380fd29d57abe6679d87ec56babe65ddc5873a37] https://lava.sirena.org.uk/scheduler/job/2044558
> # test job: [2ecc8c089802e033d2e5204d21a9f467e2517df9] https://lava.sirena.org.uk/scheduler/job/2038640
> # test job: [252abf2d07d33b1c70a59ba1c9395ba42bbd793e] https://lava.sirena.org.uk/scheduler/job/2038545
> # test job: [84194c66aaf78fed150edb217b9f341518b1cba2] https://lava.sirena.org.uk/scheduler/job/2038391
> # test job: [ed5d499b5c9cc11dd3edae1a7a55db7dfa4f1bdc] https://lava.sirena.org.uk/scheduler/job/2029011
> # test job: [6ef8e042cdcaabe3e3c68592ba8bfbaee2fa10a3] https://lava.sirena.org.uk/scheduler/job/2025855
> # test job: [ecd0de438c1f0ee86cf8f6d5047965a2a181444b] https://lava.sirena.org.uk/scheduler/job/2026095
> # test job: [f1dfbc1b5cf8650ae9a0d543e5f5335fc0f478ce] https://lava.sirena.org.uk/scheduler/job/2025515
> # test job: [e73b743bfe8a6ff4e05b5657d3f7586a17ac3ba0] https://lava.sirena.org.uk/scheduler/job/2026430
> # test job: [20bcda681f8597e86070a4b3b12d1e4f541865d3] https://lava.sirena.org.uk/scheduler/job/2022992
> # test job: [8fdb030fe283c84fd8d378c97ad0f32d6cdec6ce] https://lava.sirena.org.uk/scheduler/job/2021461
> # test job: [cf6bf51b53252284bafc7377a4d8dbf10f048b4d] https://lava.sirena.org.uk/scheduler/job/2023022
> # test job: [28039efa4d8e8bbf98b066133a906bd4e307d496] https://lava.sirena.org.uk/scheduler/job/2020298
> # test job: [e062bdfdd6adbb2dee7751d054c1d8df63ddb8b8] https://lava.sirena.org.uk/scheduler/job/2020171
> # test job: [f034c16a4663eaf3198dc18b201ba50533fb5b81] https://lava.sirena.org.uk/scheduler/job/2015463
> # test job: [66fecfa91deb536a12ddf3d878a99590d7900277] https://lava.sirena.org.uk/scheduler/job/2015316
> # test job: [4a5ac6cd05a7e54f1585d7779464d6ed6272c134] https://lava.sirena.org.uk/scheduler/job/2011270
> # test job: [4795375d8aa072e9aacb0b278e6203c6ca41816a] https://lava.sirena.org.uk/scheduler/job/2009695
> # test job: [ef042df96d0e1089764f39ede61bc8f140a4be00] https://lava.sirena.org.uk/scheduler/job/2010161
> # test job: [4c33cef58965eb655a0ac8e243aa323581ec025f] https://lava.sirena.org.uk/scheduler/job/2009455
> # test job: [77a58ba7c64ccca20616aa03599766ccb0d1a330] https://lava.sirena.org.uk/scheduler/job/2007308
> # test job: [01313661b248c5ba586acae09bff57077dbec0a5] https://lava.sirena.org.uk/scheduler/job/2008765
> # test job: [d29479abaded34b2b1dab2e17efe96a65eba3d61] https://lava.sirena.org.uk/scheduler/job/2008428
> # test job: [e7434adf0c53a84d548226304cdb41c8818da1cb] https://lava.sirena.org.uk/scheduler/job/2007796
> # test job: [e973dfe9259095fb509ab12658c68d46f0e439d7] https://lava.sirena.org.uk/scheduler/job/2008129
> # test job: [c17fa4cbc546c431ccf13e9354d5d9c1cd247b7c] https://lava.sirena.org.uk/scheduler/job/2000031
> # test job: [fd5ef3d69f8975bad16c437a337b5cb04c8217a2] https://lava.sirena.org.uk/scheduler/job/1996145
> # test job: [d054cc3a2ccfb19484f3b54d69b6e416832dc8f4] https://lava.sirena.org.uk/scheduler/job/1995770
> # test job: [2528c15f314ece50218d1273654f630d74109583] https://lava.sirena.org.uk/scheduler/job/1997626
> # test job: [310bf433c01f78e0756fd5056a43118a2f77318c] https://lava.sirena.org.uk/scheduler/job/1996060
> # test job: [638bae3fb225a708dc67db613af62f6d14c4eff4] https://lava.sirena.org.uk/scheduler/job/1991896
> # test job: [ecba655bf54a661ffe078856cd8dbc898270e4b5] https://lava.sirena.org.uk/scheduler/job/1985168
> # test job: [7e1906643a7374529af74b013bba35e4fa4e6ffc] https://lava.sirena.org.uk/scheduler/job/1978655
> # test job: [d742ebcfe524dc54023f7c520d2ed2e4b7203c19] https://lava.sirena.org.uk/scheduler/job/1975982
> # test job: [6658472a3e2de08197acfe099ba71ee0e2505ecf] https://lava.sirena.org.uk/scheduler/job/1973471
> # test job: [fce217449075d59b29052b8cdac567f0f3e22641] https://lava.sirena.org.uk/scheduler/job/1975680
> # test job: [0cc08c8130ac8f74419f99fe707dc193b7f79d86] https://lava.sirena.org.uk/scheduler/job/1965719
> # test job: [0743acf746a81e0460a56fd5ff847d97fa7eb370] https://lava.sirena.org.uk/scheduler/job/1964863
> # test job: [d77daa49085b067137d0adbe3263f75a7ee13a1b] https://lava.sirena.org.uk/scheduler/job/1962771
> # test job: [15afe57a874eaf104bfbb61ec598fa31627f7b19] https://lava.sirena.org.uk/scheduler/job/1962956
> # test job: [1e570e77392f43a3cdab2849d1f81535f8a033e2] https://lava.sirena.org.uk/scheduler/job/1962292
> # test job: [fb25114cd760c13cf177d9ac37837fafcc9657b5] https://lava.sirena.org.uk/scheduler/job/1960167
> # test job: [6621b0f118d500092f5f3d72ddddb22aeeb3c3a0] https://lava.sirena.org.uk/scheduler/job/1959744
> # test job: [65efe5404d151767653c7b7dd39bd2e7ad532c2d] https://lava.sirena.org.uk/scheduler/job/1959976
> # test job: [0b0eb7702a9fa410755e86124b4b7cd36e7d1cb4] https://lava.sirena.org.uk/scheduler/job/1957385
> # test job: [433e294c3c5b5d2020085a0e36c1cb47b694690a] https://lava.sirena.org.uk/scheduler/job/1957438
> # test job: [bf770d6d2097a52d87f4d9c88d0b05bd3998d7de] https://lava.sirena.org.uk/scheduler/job/1990586
> # test job: [c2d420796a427dda71a2400909864e7f8e037fd4] https://lava.sirena.org.uk/scheduler/job/1990667
> # test job: [7e7e2c6e2a1cb250f8d03bb99eed01f6d982d5dd] https://lava.sirena.org.uk/scheduler/job/1954263
> # test job: [9797329220a2c6622411eb9ecf6a35b24ce09d04] https://lava.sirena.org.uk/scheduler/job/1947395
> # test job: [64d87ccfae3326a9561fe41dc6073064a083e0df] https://lava.sirena.org.uk/scheduler/job/1947254
> # test job: [4412ab501677606436e5c49e41151a1e6eac7ac0] https://lava.sirena.org.uk/scheduler/job/1946284
> # test job: [5e537031f322d55315cd384398b726a9a0748d47] https://lava.sirena.org.uk/scheduler/job/1946643
> # test job: [fe8cc44dd173cde5788ab4e3730ac61f3d316d9c] https://lava.sirena.org.uk/scheduler/job/1946090
> # test job: [4d410ba9aa275e7990a270f63ce436990ace1bea] https://lava.sirena.org.uk/scheduler/job/1947752
> # test job: [b83fb1b14c06bdd765903ac852ba20a14e24f227] https://lava.sirena.org.uk/scheduler/job/1946838
> # test job: [6277a486a7faaa6c87f4bf1d59a2de233a093248] https://lava.sirena.org.uk/scheduler/job/1947021
> # test job: [6c177775dcc5e70a64ddf4ee842c66af498f2c7c] https://lava.sirena.org.uk/scheduler/job/2122930
> # test job: [92fd6e84175befa1775e5c0ab682938eca27c0b2] https://lava.sirena.org.uk/scheduler/job/2134811
> # bad: [92fd6e84175befa1775e5c0ab682938eca27c0b2] Add linux-next specific files for 20251125
> git bisect bad 92fd6e84175befa1775e5c0ab682938eca27c0b2
> # test job: [bfda4f7f7c8a71d3fa9e0e062f64e3e03b401ce0] https://lava.sirena.org.uk/scheduler/job/2134897
> # bad: [bfda4f7f7c8a71d3fa9e0e062f64e3e03b401ce0] Merge branch 'master' of https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git
> git bisect bad bfda4f7f7c8a71d3fa9e0e062f64e3e03b401ce0
> # test job: [27bc91de97549dcf3983f68c90e1d25244e75e67] https://lava.sirena.org.uk/scheduler/job/2135008
> # good: [27bc91de97549dcf3983f68c90e1d25244e75e67] Merge branch 'next' of https://git.kernel.org/pub/scm/linux/kernel/git/uml/linux.git
> git bisect good 27bc91de97549dcf3983f68c90e1d25244e75e67
> # test job: [11354ae4fd8605c56deed3aa9e17083a75209455] https://lava.sirena.org.uk/scheduler/job/2135187
> # bad: [11354ae4fd8605c56deed3aa9e17083a75209455] Merge branch 'next' of git://linuxtv.org/media-ci/media-pending.git
> git bisect bad 11354ae4fd8605c56deed3aa9e17083a75209455
> # test job: [6dcee998bc550ca1f4d93ada88ddf3ddf88278b5] https://lava.sirena.org.uk/scheduler/job/2135222
> # bad: [6dcee998bc550ca1f4d93ada88ddf3ddf88278b5] Merge branch 'vfs.all' of https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
> git bisect bad 6dcee998bc550ca1f4d93ada88ddf3ddf88278b5
> # test job: [4d8cb2518d6f29e24b1df6609ee32cab7e76aa7c] https://lava.sirena.org.uk/scheduler/job/2135273
> # bad: [4d8cb2518d6f29e24b1df6609ee32cab7e76aa7c] Merge branch 'vfs-6.19.fd_prepare' into vfs.all
> git bisect bad 4d8cb2518d6f29e24b1df6609ee32cab7e76aa7c
> # test job: [fbcf11d2838ae1df75ef10856e31fbbdd001baa5] https://lava.sirena.org.uk/scheduler/job/2135310
> # good: [fbcf11d2838ae1df75ef10856e31fbbdd001baa5] Merge branch 'namespace-6.19' into vfs.all
> git bisect good fbcf11d2838ae1df75ef10856e31fbbdd001baa5
> # test job: [5d1eb038b7d7bc0262cb153f84a6cdec4b95ba16] https://lava.sirena.org.uk/scheduler/job/2135396
> # good: [5d1eb038b7d7bc0262cb153f84a6cdec4b95ba16] Merge branch 'vfs-6.19.directory.delegations' into vfs.all
> git bisect good 5d1eb038b7d7bc0262cb153f84a6cdec4b95ba16
> # test job: [d6ef072d09b2341e606aeeaf14c3510dec329c63] https://lava.sirena.org.uk/scheduler/job/2135491
> # good: [d6ef072d09b2341e606aeeaf14c3510dec329c63] ovl: reflow ovl_create_or_link()
> git bisect good d6ef072d09b2341e606aeeaf14c3510dec329c63
> # test job: [b27548e6abcc0d771eda10b8ed5aaac5d53ef421] https://lava.sirena.org.uk/scheduler/job/2135564
> # good: [b27548e6abcc0d771eda10b8ed5aaac5d53ef421] spufs: convert spufs_context_open() to FD_PREPARE()
> git bisect good b27548e6abcc0d771eda10b8ed5aaac5d53ef421
> # test job: [fd9bdc258e6208fb635c3d4a9980c143f77121f1] https://lava.sirena.org.uk/scheduler/job/2135723
> # bad: [fd9bdc258e6208fb635c3d4a9980c143f77121f1] Merge patch series "file: FD_{ADD,PREPARE}()"
> git bisect bad fd9bdc258e6208fb635c3d4a9980c143f77121f1
> # test job: [c2d378132453fd94cec4e3cde29e768b698fb388] https://lava.sirena.org.uk/scheduler/job/2135963
> # good: [c2d378132453fd94cec4e3cde29e768b698fb388] media: convert media_request_alloc() to FD_PREPARE()
> git bisect good c2d378132453fd94cec4e3cde29e768b698fb388
> # test job: [ce7194bb784d673e916315e1610d444d6dd03f10] https://lava.sirena.org.uk/scheduler/job/2136299
> # bad: [ce7194bb784d673e916315e1610d444d6dd03f10] file: convert replace_fd() to FD_PREPARE()
> git bisect bad ce7194bb784d673e916315e1610d444d6dd03f10
> # test job: [d624684412e7f1530950d4ca9aa792d55a83c381] https://lava.sirena.org.uk/scheduler/job/2136587
> # bad: [d624684412e7f1530950d4ca9aa792d55a83c381] tty: convert ptm_open_peer() to FD_ADD()
> git bisect bad d624684412e7f1530950d4ca9aa792d55a83c381
> # test job: [aa24d422e21f64f006988ad1f6a39013d7d085f5] https://lava.sirena.org.uk/scheduler/job/2136750
> # good: [aa24d422e21f64f006988ad1f6a39013d7d085f5] ntsync: convert ntsync_obj_get_fd() to FD_PREPARE()
> git bisect good aa24d422e21f64f006988ad1f6a39013d7d085f5
> # first bad commit: [d624684412e7f1530950d4ca9aa792d55a83c381] tty: convert ptm_open_peer() to FD_ADD()
^ permalink raw reply related [flat|nested] 74+ messages in thread
* Re: [PATCH v4 42/47] tty: convert ptm_open_peer() to FD_PREPARE()
2025-11-26 13:35 ` Christian Brauner
@ 2025-11-26 14:22 ` Mark Brown
0 siblings, 0 replies; 74+ messages in thread
From: Mark Brown @ 2025-11-26 14:22 UTC (permalink / raw)
To: Christian Brauner
Cc: Linus Torvalds, Alexander Viro, Jan Kara, linux-fsdevel,
Jeff Layton, Amir Goldstein, Jens Axboe
[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]
On Wed, Nov 26, 2025 at 02:35:33PM +0100, Christian Brauner wrote:
> On Tue, Nov 25, 2025 at 10:39:37PM +0000, Mark Brown wrote:
> > I'm seeing a regression in -next in the filesystems devpts_pts kselftest
> > which bisects to this patch:
> >
> > # selftests: filesystems: devpts_pts
> > # Failed to perform TIOCGPTPEER ioctl
> > # Failed to unmount "/dev/pts": Device or resource busy
>
> Yeah, this is a dumb bug. I fixed that.
>
> Adding:
>
> commit 138027e74e9f602e3bb91112dd38840c7a5007e4
> Author: Christian Brauner <brauner@kernel.org>
>
> devpts: preserve original file opening pattern
>
> LTP seems to have assertions about what errnos are surfaced in what
> order. I think that's often misguided but we can accomodate this here
> and preserve the original order.
>
> This also makes sure to unconditionally release the reference on the
> mount that we've taken after we opened the file.
With this kselftest one the return code that's affected appears to be
the ABI for determining if the ioctl() is supported:
#ifdef TIOCGPTPEER
slave = ioctl(master, TIOCGPTPEER, O_RDWR | O_NOCTTY | O_CLOEXEC);
#endif
if (slave < 0) {
if (errno == EINVAL) {
fprintf(stderr, "TIOCGPTPEER is not supported. "
"Skipping test.\n");
fret = KSFT_SKIP;
} else {
fprintf(stderr,
"Failed to perform TIOCGPTPEER ioctl\n");
fret = EXIT_FAILURE;
}
goto do_cleanup;
}
which seems sensible enough and reasonable to test for, even if -EINVAL
isn't a great return code for this usage (I'll send a patch
fixing/removing the !TOCGPTPEER case).
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 74+ messages in thread
* Re: [PATCH v4 22/47] ipc: convert do_mq_open() to FD_PREPARE()
2025-11-26 13:20 ` Christian Brauner
@ 2025-11-26 16:10 ` Linus Torvalds
0 siblings, 0 replies; 74+ messages in thread
From: Linus Torvalds @ 2025-11-26 16:10 UTC (permalink / raw)
To: Christian Brauner
Cc: Mark Brown, Alexander Viro, Jan Kara, linux-fsdevel, Jeff Layton,
Amir Goldstein, Jens Axboe
On Wed, 26 Nov 2025 at 05:21, Christian Brauner <brauner@kernel.org> wrote:
>
> Added the following which imho looks nicer as well:
Yeah, I think that's a prettier pattern to have all the open logic in
that function called by FD_ADD(). So LGTM,
Linus
^ permalink raw reply [flat|nested] 74+ messages in thread
end of thread, other threads:[~2025-11-26 16:11 UTC | newest]
Thread overview: 74+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-23 16:33 [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Christian Brauner
2025-11-23 16:33 ` [PATCH v4 01/47] file: add FD_{ADD,PREPARE}() Christian Brauner
2025-11-24 15:03 ` Jason Gunthorpe
2025-11-23 16:33 ` [PATCH v4 02/47] anon_inodes: convert to FD_PREPARE() Christian Brauner
2025-11-25 12:16 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 03/47] eventfd: convert do_eventfd() " Christian Brauner
2025-11-25 12:18 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 04/47] fhandle: convert do_handle_open() " Christian Brauner
2025-11-25 12:15 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 05/47] namespace: convert open_tree() " Christian Brauner
2025-11-25 12:32 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 06/47] namespace: convert open_tree_attr() " Christian Brauner
2025-11-25 12:33 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 07/47] namespace: convert fsmount() " Christian Brauner
2025-11-25 12:42 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 08/47] fanotify: convert fanotify_init() " Christian Brauner
2025-11-24 17:13 ` Amir Goldstein
2025-11-25 12:13 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 09/47] nsfs: convert open_namespace() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 10/47] nsfs: convert ns_ioctl() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 11/47] autofs: convert autofs_dev_ioctl_open_mountpoint() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 12/47] eventpoll: convert do_epoll_create() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 13/47] open: convert do_sys_openat2() " Christian Brauner
2025-11-25 12:20 ` Jan Kara
2025-11-23 16:33 ` [PATCH v4 14/47] signalfd: convert do_signalfd4() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 15/47] timerfd: convert timerfd_create() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 16/47] userfaultfd: convert new_userfaultfd() " Christian Brauner
2025-11-25 11:24 ` Mike Rapoport
2025-11-23 16:33 ` [PATCH v4 17/47] xfs: convert xfs_open_by_handle() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 18/47] dma: convert dma_buf_fd() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 19/47] af_unix: convert unix_file_open() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 20/47] dma: convert sync_file_ioctl_merge() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 21/47] exec: convert begin_new_exec() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 22/47] ipc: convert do_mq_open() " Christian Brauner
2025-11-25 22:30 ` Mark Brown
2025-11-26 0:05 ` Linus Torvalds
2025-11-26 13:20 ` Christian Brauner
2025-11-26 16:10 ` Linus Torvalds
2025-11-23 16:33 ` [PATCH v4 23/47] bpf: convert bpf_iter_new_fd() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 24/47] bpf: convert bpf_token_create() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 25/47] memfd: convert memfd_create() " Christian Brauner
2025-11-25 11:30 ` Mike Rapoport
2025-11-23 16:33 ` [PATCH v4 26/47] secretmem: convert memfd_secret() " Christian Brauner
2025-11-25 11:21 ` Mike Rapoport
2025-11-23 16:33 ` [PATCH v4 27/47] net/handshake: convert handshake_nl_accept_doit() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 28/47] net/kcm: convert kcm_ioctl() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 29/47] net/sctp: convert sctp_getsockopt_peeloff_common() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 30/47] net/socket: convert sock_map_fd() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 31/47] net/socket: convert __sys_accept4_file() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 32/47] spufs: convert spufs_context_open() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 33/47] papr-hvpipe: convert papr_hvpipe_dev_create_handle() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 34/47] spufs: convert spufs_gang_open() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 35/47] pseries: convert papr_platform_dump_create_handle() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 36/47] pseries: port papr_rtas_setup_file_interface() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 37/47] dma: port sw_sync_ioctl_create_fence() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 38/47] gpio: convert linehandle_create() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 39/47] hv: convert mshv_ioctl_create_partition() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 40/47] media: convert media_request_alloc() " Christian Brauner
2025-11-23 16:33 ` [PATCH v4 41/47] ntsync: convert ntsync_obj_get_fd() " Christian Brauner
2025-11-23 16:34 ` [PATCH v4 42/47] tty: convert ptm_open_peer() " Christian Brauner
2025-11-25 22:39 ` Mark Brown
2025-11-26 13:35 ` Christian Brauner
2025-11-26 14:22 ` Mark Brown
2025-11-23 16:34 ` [PATCH v4 43/47] vfio: convert vfio_group_ioctl_get_device_fd() " Christian Brauner
2025-11-24 14:52 ` Jason Gunthorpe
2025-11-23 16:34 ` [PATCH v4 44/47] file: convert replace_fd() " Christian Brauner
2025-11-25 12:29 ` Jan Kara
2025-11-23 16:34 ` [PATCH v4 45/47] io_uring: convert io_create_mock_file() " Christian Brauner
2025-11-25 16:38 ` Jens Axboe
2025-11-23 16:34 ` [PATCH v4 46/47] kvm: convert kvm_arch_supports_gmem_init_shared() " Christian Brauner
2025-11-23 16:34 ` [PATCH v4 47/47] kvm: convert kvm_vcpu_ioctl_get_stats_fd() " Christian Brauner
2025-11-23 16:43 ` [PATCH v4 00/47] file: FD_{ADD,PREPARE}() Linus Torvalds
2025-11-23 16:46 ` Linus Torvalds
2025-11-23 22:53 ` Christian Brauner
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).