From: Breno Leitao <leitao@debian.org>
To: Tony Solomonik <tony.solomonik@gmail.com>
Cc: axboe@kernel.dk, asml.silence@gmail.com, io-uring@vger.kernel.org
Subject: Re: [PATCH 1/2] io_uring: add support for truncate
Date: Mon, 22 Jan 2024 11:56:59 -0800 [thread overview]
Message-ID: <Za7Ii2O0Jjfb6rz9@gmail.com> (raw)
In-Reply-To: <20240122193732.23217-1-tony.solomonik@gmail.com>
Hello Tony,
On Mon, Jan 22, 2024 at 09:37:31PM +0200, Tony Solomonik wrote:
> +int io_truncate_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
> +{
> + struct io_trunc *tr = io_kiocb_to_cmd(req, struct io_trunc);
> +
> + if (sqe->off || sqe->rw_flags || sqe->buf_index || sqe->splice_fd_in)
> + return -EINVAL;
> + if (unlikely(req->flags & REQ_F_FIXED_FILE))
> + return -EBADF;
> +
> + tr->pathname = u64_to_user_ptr(READ_ONCE(sqe->addr));
> + tr->len = READ_ONCE(sqe->len);
sqe->len is 32 bits. I _think_ loff_t is or could be 64-bits. Isn't it
possible to use a u64 here? Maybe sqe->off or sqe->addr?
next prev parent reply other threads:[~2024-01-22 19:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 19:37 [PATCH 1/2] io_uring: add support for truncate Tony Solomonik
2024-01-22 19:37 ` [PATCH 2/2] io_uring: add support for ftruncate Tony Solomonik
2024-01-22 20:12 ` Jens Axboe
2024-01-22 19:56 ` Breno Leitao [this message]
2024-01-22 20:10 ` [PATCH 1/2] io_uring: add support for truncate Jens Axboe
2024-01-22 20:12 ` Gabriel Krisman Bertazi
2024-01-22 20:22 ` Jens Axboe
2024-01-22 20:21 ` Jens Axboe
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=Za7Ii2O0Jjfb6rz9@gmail.com \
--to=leitao@debian.org \
--cc=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=tony.solomonik@gmail.com \
/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.