Skip to content

Commit 9f74ae8

Browse files
committed
erofs: shorten bvecs[] for file-backed mounts
BIO_MAX_VECS is too large for __GFP_NOFAIL allocation. We could use a mempool (since BIOs can always proceed), but it seems overly complicated for now. Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 54ab25d commit 9f74ae8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/erofs/fileio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <trace/events/erofs.h>
77

88
struct erofs_fileio_rq {
9-
struct bio_vec bvecs[BIO_MAX_VECS];
9+
struct bio_vec bvecs[16];
1010
struct bio bio;
1111
struct kiocb iocb;
1212
struct super_block *sb;
@@ -68,7 +68,7 @@ static struct erofs_fileio_rq *erofs_fileio_rq_alloc(struct erofs_map_dev *mdev)
6868
struct erofs_fileio_rq *rq = kzalloc(sizeof(*rq),
6969
GFP_KERNEL | __GFP_NOFAIL);
7070

71-
bio_init(&rq->bio, NULL, rq->bvecs, BIO_MAX_VECS, REQ_OP_READ);
71+
bio_init(&rq->bio, NULL, rq->bvecs, ARRAY_SIZE(rq->bvecs), REQ_OP_READ);
7272
rq->iocb.ki_filp = mdev->m_dif->file;
7373
rq->sb = mdev->m_sb;
7474
return rq;

0 commit comments

Comments
 (0)