mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-26 04:16:39 +00:00
bcachefs: Handle ec_buf not being page aligned when allocating bio
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
21629f5368
commit
16e671037a
1 changed files with 4 additions and 1 deletions
|
@ -461,7 +461,10 @@ static struct bio *bch2_write_bio_alloc(struct bch_fs *c,
|
|||
struct bio *bio;
|
||||
unsigned output_available =
|
||||
min(wp->sectors_free << 9, src->bi_iter.bi_size);
|
||||
unsigned pages = DIV_ROUND_UP(output_available, PAGE_SIZE);
|
||||
unsigned pages = DIV_ROUND_UP(output_available +
|
||||
(buf
|
||||
? ((unsigned long) buf & (PAGE_SIZE - 1))
|
||||
: 0), PAGE_SIZE);
|
||||
|
||||
bio = bio_alloc_bioset(NULL, pages, 0,
|
||||
GFP_NOIO, &c->bio_write);
|
||||
|
|
Loading…
Reference in a new issue