All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: fix iclog allocation size
@ 2019-06-27 14:39 Christoph Hellwig
  2019-06-27 15:13 ` Darrick J. Wong
  2019-06-28 22:02 ` Luis Chamberlain
  0 siblings, 2 replies; 7+ messages in thread
From: Christoph Hellwig @ 2019-06-27 14:39 UTC (permalink / raw)
  To: linux-xfs; +Cc: syzbot+b75afdbe271a0d7ac4f6

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

Fixes: 991fc1d2e65e ("xfs: use bios directly to write log buffers")
Reported-by: syzbot+b75afdbe271a0d7ac4f6@syzkaller.appspotmail.com
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_log.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 0f849b4095d6..e230f3c18ceb 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1415,7 +1415,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)
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-06-28 22:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-27 14:39 [PATCH] xfs: fix iclog allocation size Christoph Hellwig
2019-06-27 15:13 ` Darrick J. Wong
2019-06-28 22:02 ` Luis Chamberlain
2019-06-28 22:19   ` Darrick J. Wong
2019-06-28 22:23     ` Luis Chamberlain
2019-06-28 22:25       ` Darrick J. Wong
2019-06-28 22:32         ` Luis Chamberlain

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.