Commit cb728484 authored by Mikuláš Patočka's avatar Mikuláš Patočka Committed by Mike Snitzer
Browse files

dm writecache: fix performance degradation in ssd mode

Fix a thinko in ssd_commit_superblock. region.count is in sectors, not
bytes. This bug doesn't corrupt data, but it causes performance
Signed-off-by: Mikuláš Patočka's avatarMikulas Patocka <>
Fixes: dc8a01ae

 ("dm writecache: optimize superblock write")
Cc: # v5.7+
Reported-by: J. Bruce Fields's avatarJ. Bruce Fields <>
Signed-off-by: Mike Snitzer's avatarMike Snitzer <>
parent 09d85f8d
......@@ -523,7 +523,7 @@ static void ssd_commit_superblock(struct dm_writecache *wc)
region.bdev = wc->ssd_dev->bdev;
region.sector = 0;
region.count = PAGE_SIZE;
region.count = PAGE_SIZE >> SECTOR_SHIFT;
if (unlikely(region.sector + region.count > wc->metadata_sectors))
region.count = wc->metadata_sectors - region.sector;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment