All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org, Ming Lei <ming.lei@redhat.com>
Subject: [PATCH 2/2] iov_iter: fix iov_iter_type
Date: Fri, 26 Apr 2019 18:45:21 +0800	[thread overview]
Message-ID: <20190426104521.30602-3-ming.lei@redhat.com> (raw)
In-Reply-To: <20190426104521.30602-1-ming.lei@redhat.com>

Commit 875f1d0769cd ("iov_iter: add ITER_BVEC_FLAG_NO_REF flag")
introduces one extra flag of ITER_BVEC_FLAG_NO_REF, and this flag
is stored into iter->type.

However, iov_iter_type() doesn't consider the new added flag, fix
it by masking this flag in iov_iter_type().

Fixes: 875f1d0769cd ("iov_iter: add ITER_BVEC_FLAG_NO_REF flag")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 include/linux/uio.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/uio.h b/include/linux/uio.h
index f184af1999a8..2d0131ad4604 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -60,7 +60,7 @@ struct iov_iter {
 
 static inline enum iter_type iov_iter_type(const struct iov_iter *i)
 {
-	return i->type & ~(READ | WRITE);
+	return i->type & ~(READ | WRITE | ITER_BVEC_FLAG_NO_REF);
 }
 
 static inline bool iter_is_iovec(const struct iov_iter *i)
-- 
2.9.5


  parent reply	other threads:[~2019-04-26 10:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-26 10:45 [PATCH 0/2] block/iov_iter: fix two issues related with BIO_NO_PAGE_REF Ming Lei
2019-04-26 10:45 ` [PATCH 1/2] block: fix handling for BIO_NO_PAGE_REF Ming Lei
2019-04-26 14:59   ` Christoph Hellwig
2019-04-26 10:45 ` Ming Lei [this message]
2019-04-26 12:44   ` [PATCH 2/2] iov_iter: fix iov_iter_type Christoph Hellwig
2019-04-26 22:13     ` Ming Lei
2019-04-27  6:02       ` Christoph Hellwig
2019-05-01  9:16 ` [PATCH 0/2] block/iov_iter: fix two issues related with BIO_NO_PAGE_REF Ming Lei
2019-05-01 12:50 ` 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=20190426104521.30602-3-ming.lei@redhat.com \
    --to=ming.lei@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /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.