From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH 2/2] iov_iter: fix iov_iter_type
Date: Sat, 27 Apr 2019 06:13:23 +0800 [thread overview]
Message-ID: <20190426221322.GA31470@ming.t460p> (raw)
In-Reply-To: <20190426124435.GA12339@infradead.org>
On Fri, Apr 26, 2019 at 05:44:35AM -0700, Christoph Hellwig wrote:
> On Fri, Apr 26, 2019 at 06:45:21PM +0800, Ming Lei wrote:
> > 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);
>
> The way we handle i->type is a complete mess. I think we need
> three different values:
>
> .rw (can be READ or WRITE)
> .type (ITER_IOVEC, ITER_KVEC, ITER_BVEC, ITER_PIPE, ITER_DISCARD)
> .flags (ITER_BVEC_FLAG_NO_REF)
>
> .type seems to be worth an u8 on its own. And at least as long
> as we have space rw and flags should probably be their own u8 aswell,
> although we could use accessors to fold them.
I agree we need a cleanup, which might be a bit bigger change. It should
be clean to convert them into bit fields.
This issue is quite serious, system ram can easily be leaked completely,
so could we fix the issue by the easy way first?
Thanks,
Ming
next prev parent reply other threads:[~2019-04-26 22:13 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 ` [PATCH 2/2] iov_iter: fix iov_iter_type Ming Lei
2019-04-26 12:44 ` Christoph Hellwig
2019-04-26 22:13 ` Ming Lei [this message]
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=20190426221322.GA31470@ming.t460p \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).