Commit a9440743 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Limit bios in writepages path to 256M

This works around a bug where bio_full() doesn't check for
bio->bi_iter.bi_size overflowing - and, we don't really want to build
bios that are that big anyways.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 71603f1f
...@@ -1151,6 +1151,7 @@ static int __bch2_writepage(struct folio *folio, ...@@ -1151,6 +1151,7 @@ static int __bch2_writepage(struct folio *folio,
if (w->io && if (w->io &&
(w->io->op.res.nr_replicas != nr_replicas_this_write || (w->io->op.res.nr_replicas != nr_replicas_this_write ||
bio_full(&w->io->op.wbio.bio, PAGE_SIZE) || bio_full(&w->io->op.wbio.bio, PAGE_SIZE) ||
w->io->op.wbio.bio.bi_iter.bi_size >= (256U << 20) ||
bio_end_sector(&w->io->op.wbio.bio) != sector)) bio_end_sector(&w->io->op.wbio.bio) != sector))
bch2_writepage_do_io(w); bch2_writepage_do_io(w);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment