Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 89b171ac authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong
Browse files

xfs: fix iclog allocation size



Properly allocate the space for the bio_vecs instead of just one byte
per bio_vec.

Fixes: 79b54d9b ("xfs: use bios directly to write log buffers")
Reported-by: default avatar <syzbot+b75afdbe271a0d7ac4f6@syzkaller.appspotmail.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 250d4b4c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1411,7 +1411,8 @@ xlog_alloc_log(
	 */
	ASSERT(log->l_iclog_size >= 4096);
	for (i = 0; i < log->l_iclog_bufs; i++) {
		size_t bvec_size = howmany(log->l_iclog_size, PAGE_SIZE);
		size_t bvec_size = howmany(log->l_iclog_size, PAGE_SIZE) *
				sizeof(struct bio_vec);

		iclog = kmem_zalloc(sizeof(*iclog) + bvec_size, KM_MAYFAIL);
		if (!iclog)