diff options
author | Christoph Hellwig <hch@lst.de> | 2019-06-28 19:31:36 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2019-06-28 21:02:45 -0700 |
commit | 89b171acb222dc5283c66a1e99f2ac835eab0a3c (patch) | |
tree | 2f43955b6eb43dc6932b7b75ec7eddc162ea1d0e /fs/xfs | |
parent | 250d4b4c409778bc44577dfc59909935c92fd006 (diff) |
xfs: fix iclog allocation size
Properly allocate the space for the bio_vecs instead of just one byte
per bio_vec.
Fixes: 79b54d9bfcdcd0a ("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>
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_log.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 92cd44ac4dd3..cbaf348f1c93 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -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) |