Skip to contentSkip to conversation

dm space map disk: fix sm_disk_count_is_more_than_one()

PATCH New Mike Snitzer 1 participant 1 message Feb 12, 2015 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm space map disk: fix sm_disk_count_is_more_than_one()

dm_tm_shadow_block() is the only caller of dm_sm_count_is_more_than_one() which only ever operates on a metadata space-map. So in practice, sm_disk_count_is_more_than_one() isn't actually used (which explains why this bug never amounted to anything).

But fix sm_disk_count_is_more_than_one() to properly set *result and return 0.

---
 drivers/md/persistent-data/dm-space-map-disk.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/persistent-data/dm-space-map-disk.c +3 -1
index cfbf961..ebb280a 100644
@@ -78,7 +78,9 @@ static int sm_disk_count_is_more_than_one(struct dm_space_map *sm, dm_block_t b,
 	if (r)
 		return r;
 
-	return count > 1;
+	*result = count > 1;
+
+	return 0;
 }
 
 static int sm_disk_set_count(struct dm_space_map *sm, dm_block_t b,
Signature · 1 line
1.9.3 (Apple Git-50)