diff options
author | Gao Xiang <hsiangkao@linux.alibaba.com> | 2025-01-07 16:28:25 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2025-01-17 03:18:55 +0800 |
commit | 9f74ae8c9ac97a79f9d45c92bd8ac8598e17f21f (patch) | |
tree | a8861984bbb23a597f41a5094c2401d0dcbdaa75 | |
parent | 54ab25d03eab652a321c3d1566edc2b050d83f2f (diff) |
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 <chao@kernel.org>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20250107082825.74242-1-hsiangkao@linux.alibaba.com
-rw-r--r-- | fs/erofs/fileio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/erofs/fileio.c b/fs/erofs/fileio.c index 33f8539dda4a..0ffd1c63beeb 100644 --- a/fs/erofs/fileio.c +++ b/fs/erofs/fileio.c @@ -6,7 +6,7 @@ #include <trace/events/erofs.h> struct erofs_fileio_rq { - struct bio_vec bvecs[BIO_MAX_VECS]; + struct bio_vec bvecs[16]; struct bio bio; struct kiocb iocb; struct super_block *sb; @@ -68,7 +68,7 @@ static struct erofs_fileio_rq *erofs_fileio_rq_alloc(struct erofs_map_dev *mdev) struct erofs_fileio_rq *rq = kzalloc(sizeof(*rq), GFP_KERNEL | __GFP_NOFAIL); - bio_init(&rq->bio, NULL, rq->bvecs, BIO_MAX_VECS, REQ_OP_READ); + bio_init(&rq->bio, NULL, rq->bvecs, ARRAY_SIZE(rq->bvecs), REQ_OP_READ); rq->iocb.ki_filp = mdev->m_dif->file; rq->sb = mdev->m_sb; return rq; |