From: Qu Wenruo <wqu@suse.de>
To: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
Linux FS Devel <linux-fsdevel@vger.kernel.org>
Subject: About `bio->bi_iter.bi_size` at write endio time
Date: Tue, 15 Jun 2021 15:22:59 +0800 [thread overview]
Message-ID: <18cbcd0b-8c49-00b8-558b-5d74b3664b85@suse.de> (raw)
Hi,
Recently I got a strange case where for write bio, at its endio time, I
got bio->bi_iter.bi_size == 0, but bio_for_each_segment_all() reports we
still have some bv_len.
And obviously, when the bio get submitted, its bi_size is not 0.
This is especially common for REQ_OP_ZONE_APPEND bio, but I also get
rare bi_size == 0 at endio time, for REQ_OP_WRITE too.
So I guess bi_size at endio time is no longer reliable due to bio
merging/splitting?
Thus the only correct way to get how large a bio really is, is through
bio_for_each_segment_all()?
Thanks,
Qu
next reply other threads:[~2021-06-15 7:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-15 7:22 Qu Wenruo [this message]
2021-06-15 8:37 ` About `bio->bi_iter.bi_size` at write endio time Ming Lei
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=18cbcd0b-8c49-00b8-558b-5d74b3664b85@suse.de \
--to=wqu@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-fsdevel@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).