From: Jens Axboe <axboe@kernel.dk>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org,
Carlos Maiolino <cmaiolino@redhat.com>,
linux-fsdevel@vger.kernel.org,
syzbot+2b9e54155c8c25d8d165@syzkaller.appspotmail.com
Subject: Re: [PATCH V2] block: add bio_truncate to fix guard_bio_eod
Date: Sat, 28 Dec 2019 09:45:15 -0700 [thread overview]
Message-ID: <bcc25948-7250-7c82-a764-91ce4c938185@kernel.dk> (raw)
In-Reply-To: <20191227230548.20079-1-ming.lei@redhat.com>
On 12/27/19 4:05 PM, Ming Lei wrote:
> Some filesystem, such as vfat, may send bio which crosses device boundary,
> and the worse thing is that the IO request starting within device boundaries
> can contain more than one segment past EOD.
>
> Commit dce30ca9e3b6 ("fs: fix guard_bio_eod to check for real EOD errors")
> tries to fix this issue by returning -EIO for this situation. However,
> this way lets fs user code lose chance to handle -EIO, then sync_inodes_sb()
> may hang for ever.
>
> Also the current truncating on last segment is dangerous by updating the
> last bvec, given bvec table becomes not immutable any more, and fs bio
> users may not retrieve the truncated pages via bio_for_each_segment_all() in
> its .end_io callback.
>
> Fixes this issue by supporting multi-segment truncating. And the
> approach is simpler:
>
> - just update bio size since block layer can make correct bvec with
> the updated bio size. Then bvec table becomes really immutable.
>
> - zero all truncated segments for read bio
Applied, thanks.
--
Jens Axboe
next prev parent reply other threads:[~2019-12-28 16:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-27 23:05 [PATCH V2] block: add bio_truncate to fix guard_bio_eod Ming Lei
2019-12-28 16:45 ` Jens Axboe [this message]
2020-01-08 13:37 ` Christoph Hellwig
2020-01-09 2:05 ` Ming Lei
2020-01-09 7:17 ` Christoph Hellwig
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=bcc25948-7250-7c82-a764-91ce4c938185@kernel.dk \
--to=axboe@kernel.dk \
--cc=cmaiolino@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=syzbot+2b9e54155c8c25d8d165@syzkaller.appspotmail.com \
/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).