Re: [PATCH v2 4/5] io_uring: add fsetxattr and setxattr support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/1/21 05:51, Stefan Roesch wrote:
This adds support to io_uring for the fsetxattr and setxattr API.

io_uring part (4/5 and 5/5) look sane, just one comments below

Signed-off-by: Stefan Roesch <shr@xxxxxx>
---
  fs/io_uring.c                 | 174 ++++++++++++++++++++++++++++++++++
  include/uapi/linux/io_uring.h |   6 +-
  2 files changed, 179 insertions(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 568729677e25..9d977bf243fd 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
[...]
+static int io_fsetxattr_prep(struct io_kiocb *req,
+			const struct io_uring_sqe *sqe)
+{
+	if (!req->file)
+		return -EBADF;

No need, io_init_req() will fail the request if it can't get a file.
Same for fgetxattr.


+
+	return __io_setxattr_prep(req, sqe, file_mnt_user_ns(req->file));
+}
+

--
Pavel Begunkov



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux