Skip to content

Commit

Permalink
xfs: fix iclog allocation size
Browse files Browse the repository at this point in the history
Properly allocate the space for the bio_vecs instead of just one byte
per bio_vec.

Fixes: 79b54d9 ("xfs: use bios directly to write log buffers")
Reported-by: syzbot+b75afdbe271a0d7ac4f6@syzkaller.appspotmail.com
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
  • Loading branch information
Christoph Hellwig authored and Darrick J. Wong committed Jun 29, 2019
1 parent 250d4b4 commit 89b171a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 89b171a

Please sign in to comment.