From: Pavel Begunkov <asml.silence@gmail.com>
To: Sidong Yang <sidong.yang@furiosa.ai>,
Jens Axboe <axboe@kernel.dk>, Josef Bacik <josef@toxicpanda.com>,
David Sterba <dsterba@suse.com>
Cc: io-uring@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-btrfs@vger.kernel.org
Subject: Re: [RFC PATCH 2/2] btrfs: ioctl: use registered buffer for IORING_URING_CMD_FIXED
Date: Tue, 11 Mar 2025 12:55:48 +0000 [thread overview]
Message-ID: <58181ba7-dcb5-4faa-a03a-8ff88cbffc24@gmail.com> (raw)
In-Reply-To: <20250311114053.216359-3-sidong.yang@furiosa.ai>
On 3/11/25 11:40, Sidong Yang wrote:
> This patch supports IORING_URING_CMD_FIXED flags in io-uring cmd. It
> means that user provided buf_index in sqe that is registered before
> submitting requests. In this patch, btrfs_uring_encoded_read() makes
> iov_iter bvec type by checking the io-uring cmd flag. And there is
> additional iou_vec field in btrfs_uring_priv for remaining bvecs
> lifecycle.
>
> Signed-off-by: Sidong Yang <sidong.yang@furiosa.ai>
> ---
> fs/btrfs/ioctl.c | 26 +++++++++++++++++++++-----
> 1 file changed, 21 insertions(+), 5 deletions(-)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 6c18bad53cd3..586671eea622 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -4643,6 +4643,7 @@ struct btrfs_uring_priv {
> struct page **pages;
> unsigned long nr_pages;
> struct kiocb iocb;
> + struct iou_vec iou_vec;
This structure should not be leaked out of core io_uring ...
> struct iovec *iov;
> struct iov_iter iter;
> struct extent_state *cached_state;
> @@ -4711,6 +4712,8 @@ static void btrfs_uring_read_finished(struct io_uring_cmd *cmd, unsigned int iss
>
> kfree(priv->pages);
> kfree(priv->iov);
> + if (priv->iou_vec.iovec)
> + kfree(priv->iou_vec.iovec);
... exactly because if this. This line relies on details it
shouldn't.
--
Pavel Begunkov
next prev parent reply other threads:[~2025-03-11 12:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 11:40 [RFC PATCH 0/2] introduce io_uring_cmd_import_fixed_vec Sidong Yang
2025-03-11 11:40 ` [RFC PATCH 1/2] io_uring: cmd: " Sidong Yang
2025-03-11 13:08 ` Pavel Begunkov
2025-03-12 3:08 ` Sidong Yang
2025-03-12 9:59 ` kernel test robot
2025-03-12 10:10 ` kernel test robot
2025-03-11 11:40 ` [RFC PATCH 2/2] btrfs: ioctl: use registered buffer for IORING_URING_CMD_FIXED Sidong Yang
2025-03-11 12:55 ` Pavel Begunkov [this message]
2025-03-12 3:05 ` Sidong Yang
2025-03-12 11:11 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58181ba7-dcb5-4faa-a03a-8ff88cbffc24@gmail.com \
--to=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=dsterba@suse.com \
--cc=io-uring@vger.kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sidong.yang@furiosa.ai \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.