All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Busch <kbusch@meta.com>
To: <viro@zeniv.linux.org.uk>, <axboe@kernel.dk>, <io-uring@vger.kernel.org>
Cc: <asml.silence@gmail.com>, <linux-fsdevel@vger.kernel.org>,
	Keith Busch <kbusch@kernel.org>
Subject: [PATCH 4/4] iov_iter: move iter_ubuf check inside restore WARN
Date: Mon, 7 Nov 2022 09:56:10 -0800	[thread overview]
Message-ID: <20221107175610.349807-5-kbusch@meta.com> (raw)
In-Reply-To: <20221107175610.349807-1-kbusch@meta.com>

From: Keith Busch <kbusch@kernel.org>

io_uring is using iter_ubuf types for single vector requests. We expect
state restore may happen for this type now, and it is already handled
correctly, so move the check inside the warning to suppress it.

Signed-off-by: Keith Busch <kbusch@kernel.org>
---
 lib/iov_iter.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index 07adf18e5e40..aa192a386bd7 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1880,8 +1880,8 @@ int import_ubuf(int rw, void __user *buf, size_t len, struct iov_iter *i)
  */
 void iov_iter_restore(struct iov_iter *i, struct iov_iter_state *state)
 {
-	if (WARN_ON_ONCE(!iov_iter_is_bvec(i) && !iter_is_iovec(i)) &&
-			 !iov_iter_is_kvec(i) && !iter_is_ubuf(i))
+	if (WARN_ON_ONCE(!iov_iter_is_bvec(i) && !iter_is_iovec(i) &&
+			 !iter_is_ubuf(i)) && !iov_iter_is_kvec(i))
 		return;
 	i->iov_offset = state->iov_offset;
 	i->count = state->count;
-- 
2.30.2


  parent reply	other threads:[~2022-11-07 18:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-07 17:56 [PATCH 0/4] io_uring: use ITER_UBUF Keith Busch
2022-11-07 17:56 ` [PATCH 1/4] iov: add import_ubuf() Keith Busch
2022-11-08  6:55   ` Christoph Hellwig
2022-11-08 16:05     ` Keith Busch
2022-11-07 17:56 ` [PATCH 2/4] io_uring: switch network send/recv to ITER_UBUF Keith Busch
2022-11-07 17:56 ` [PATCH 3/4] io_uring: use ubuf for single range imports for read/write Keith Busch
2022-11-07 17:56 ` Keith Busch [this message]
2022-11-08  6:54 ` [PATCH 0/4] io_uring: use ITER_UBUF Christoph Hellwig
2022-11-08 20:25   ` Keith Busch

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=20221107175610.349807-5-kbusch@meta.com \
    --to=kbusch@meta.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=kbusch@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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.