diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2019-10-20 00:22:03 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:30 -0400 |
commit | a94407434b7a3b577a7605f0bd999d98acad6d23 (patch) | |
tree | 62cdd6694ec86f532bb3c29798de9fb841ed1938 /fs/bcachefs | |
parent | 71603f1ffe03d2409d591e4647377a415376a6b9 (diff) |
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: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/fs-io.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/fs-io.c b/fs/bcachefs/fs-io.c index 9914f6ee2aa2..a3fb60383725 100644 --- a/fs/bcachefs/fs-io.c +++ b/fs/bcachefs/fs-io.c @@ -1151,6 +1151,7 @@ do_io: if (w->io && (w->io->op.res.nr_replicas != nr_replicas_this_write || 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)) bch2_writepage_do_io(w); |