From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jan Kara <jack@suse.cz>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
linux-fsdevel@vger.kernel.org,
Matthew Bobrowski <mbobrowski@mbobrowski.org>,
Eric Biggers <ebiggers@kernel.org>
Subject: Re: [PATCH 2/2] iomap: Do not create fake iter in iomap_dio_bio_actor()
Date: Mon, 25 Nov 2019 09:18:39 +0100 [thread overview]
Message-ID: <20191125081839.GA1797@quack2.suse.cz> (raw)
In-Reply-To: <20191122132658.GB12183@infradead.org>
On Fri 22-11-19 05:26:58, Christoph Hellwig wrote:
> > - /*
> > - * Operate on a partial iter trimmed to the extent we were called for.
> > - * We'll update the iter in the dio once we're done with this extent.
> > - */
> > - iter = *dio->submit.iter;
> > - iov_iter_truncate(&iter, length);
> > + /* Operate on a partial iter trimmed to the extent we were called for */
> > + iov_iter_truncate(dio->submit.iter, length);
>
> I think the comment could be kept a little more verbose given that the
> scheme isn't exactly obvious. Also I'd move the initialization of
> orig_count here to keep it all together. E.g.
>
> /*
> * Save the original count and trim the iter to just the extent we
> * are operating on right now. The iter will be re-expanded once
> * we are done.
> */
> orig_count = iov_iter_count(dio->submit.iter);
> iov_iter_truncate(dio->submit.iter, length);
>
> >
> > - nr_pages = iov_iter_npages(&iter, BIO_MAX_PAGES);
> > - if (nr_pages <= 0)
> > + nr_pages = iov_iter_npages(dio->submit.iter, BIO_MAX_PAGES);
> > + if (nr_pages <= 0) {
> > + iov_iter_reexpand(dio->submit.iter, orig_count);
> > return nr_pages;
> > + }
>
> Can we stick to a single iov_iter_reexpand call? E.g. turn this into
>
> if (nr_pages <= 0) {
> ret = nr_pages;
> goto out;
> }
>
> and then have the out label at the very end call iov_iter_reexpand.
>
> > iomap_dio_zero(dio, iomap, pos, fs_block_size - pad);
> > }
> > + /* Undo iter limitation to current extent */
> > + iov_iter_reexpand(dio->submit.iter, orig_count - copied);
> > return copied ? copied : ret;
>
> In iomap-for-next this is:
>
> if (copied)
> return copied;
> return ret;
>
> so please rebase to iomap-for-next for the next spin.
OK, I can see Darrick has already picked up the first patch so I'll just
respin this second one with the updates you've asked for. Thanks for
review!
Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2019-11-25 8:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-21 16:15 [PATCH 0/2] iomap: Fix leakage of pipe pages while splicing Jan Kara
2019-11-21 16:15 ` [PATCH 1/2] iomap: Fix pipe page leakage during splicing Jan Kara
2019-11-21 23:55 ` Darrick J. Wong
2019-11-22 6:04 ` Matthew Bobrowski
2019-11-22 10:47 ` Jan Kara
2019-11-22 13:17 ` Christoph Hellwig
2019-11-21 16:15 ` [PATCH 2/2] iomap: Do not create fake iter in iomap_dio_bio_actor() Jan Kara
2019-11-22 0:02 ` Darrick J. Wong
2019-11-22 12:11 ` Jan Kara
2019-11-22 13:26 ` Christoph Hellwig
2019-11-25 8:18 ` Jan Kara [this message]
2019-11-21 16:58 ` [PATCH 0/2] iomap: Fix leakage of pipe pages while splicing Darrick J. Wong
2019-11-21 17:15 ` Jan Kara
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=20191125081839.GA1797@quack2.suse.cz \
--to=jack@suse.cz \
--cc=darrick.wong@oracle.com \
--cc=ebiggers@kernel.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mbobrowski@mbobrowski.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).