projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21629f5
)
bcachefs: Handle ec_buf not being page aligned when allocating bio
author
Kent Overstreet
<kent.overstreet@gmail.com>
Thu, 22 Aug 2019 20:41:50 +0000
(16:41 -0400)
committer
Kent Overstreet
<kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:25 +0000
(17:08 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/io.c
patch
|
blob
|
history
diff --git
a/fs/bcachefs/io.c
b/fs/bcachefs/io.c
index 5db83374403b83534f4c46925c2695a94d57146a..117d1faa99f2e4a56506013cc3f288f4603ffa5a 100644
(file)
--- a/
fs/bcachefs/io.c
+++ b/
fs/bcachefs/io.c
@@
-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);