« Previous | Next » 

Revision 7c2bbf4a

ID7c2bbf4aa66ca5a9fc2ca147e0e6cb6f407a3aa2

Added by Hu Tao over 10 years ago

qcow2: check for NULL l2meta

In the case of a metadata preallocation with a large cluster size,
qcow2_alloc_cluster_offset() can allocate nothing and returns a
NULL l2meta. This patch checks for it and link2 l2 with only valid
l2meta.

Replace 9 and 512 with BDRV_SECTOR_BITS, BDRV_SECTOR_SIZE
respectively while at the function.

Signed-off-by: Hu Tao <>
Reviewed-by: Max Reitz <>
Reviewed-by: Benoit Canet <>
Signed-off-by: Kevin Wolf <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences