From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 568F82594B5 for ; Tue, 7 Jan 2025 08:28:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.119 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736238522; cv=none; b=IZRQsrKGB1uwXtbeWVxFxhyHdLgJomia6yI/aYqf2Uv9KhAFqxAbgrS9k+0IClAJIiI57KTuDkBqOFzDEcn2HDA7HC+ClBhxGWRq50y7xEDcWDXJss30Zl4KW7RCVR/s9zvu/olCmPjDduW1EsdUMJilewdwGQG2S9ewX6nbFWQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736238522; c=relaxed/simple; bh=ipWEcl/uUvWLfj2nPZYIo7DkXMV2M54kce0UDzieAAg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GdMXhR3pX57GYDNAJrFmTM+Ih9DUQ8ssoHaf3gXZ0A3QMvE5zCZElOjhwxDXzNdyLDg/C8rtBWSEN9cj3zokJNoREQ/94fkNK9pYNxwLmhgQQiLYVRe5/aU7VGXyRl1EH5u1wKEyfrzOovpQe0qNjCNl7/SZ03sh9eZwQ7ILawE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=Nr8Iu7hB; arc=none smtp.client-ip=115.124.30.119 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="Nr8Iu7hB" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1736238511; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=DfBJpSrl9oJXWPx5aFxJyiA8n3Wju7yxjpoh7g4Ono8=; b=Nr8Iu7hBho9V7tawjJdLSZXAV+vu7BKdmY0B7n2hQmkLljuV8ew2RtVw+uz+1sYN0ia4EeaEPD4soY6G4YHNEmLNbWP/Hc2WqPyqO/Db72uYFlUUNkRy0jKgdck3uL+fS3ph6HXXksF12BddnSGZwrYAMkWX06M5P9+2ObRcrp8= Received: from x31i01179.sqa.na131.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0WNA-Fid_1736238506 cluster:ay36) by smtp.aliyun-inc.com; Tue, 07 Jan 2025 16:28:30 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Gao Xiang Subject: [PATCH] erofs: shorten bvecs[] for file-backed mounts Date: Tue, 7 Jan 2025 16:28:25 +0800 Message-ID: <20250107082825.74242-1-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.43.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit BIO_MAX_VECS is too large for __GFP_NOFAIL allocation. We could use a mempool (since BIO can always proceed), but it seems overly complicated for now. Signed-off-by: Gao Xiang --- fs/erofs/fileio.c | 4 ++-- 1 file 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 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; -- 2.43.5