Skip to contentSkip to conversation

dm raid: constructor fails on non-zero incompat_features

PATCH New [email protected] 1 participant 1 message Aug 3, 2016 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dm raid: constructor fails on non-zero incompat_features

From: Heinz Mauelshagen <[email protected]>

When lvm2 userspace requests a RaidLV repair, it sets the rebuild constructor flag on the new, replaced DataLVs but does not clear the respective MetaLVs. Hence the superblock loaded from such new MetaLVs may have a non-zero incompat_features member and the constructor will fail on checking it to be zero.

Solve by initializing the incompat_features member properly.

---
 drivers/md/dm-raid.c | 1 +
 1 file changed, 1 insertion(+)
drivers/md/dm-raid.c +1 -0
index 8498354..2b1279c 100644
@@ -1960,6 +1960,7 @@ static void super_sync(struct mddev *mddev, struct md_rdev *rdev)
 	sb->data_offset = cpu_to_le64(rdev->data_offset);
 	sb->new_data_offset = cpu_to_le64(rdev->new_data_offset);
 	sb->sectors = cpu_to_le64(rdev->sectors);
+	sb->incompat_features = cpu_to_le32(0);
 
 	/* Zero out the rest of the payload after the size of the superblock */
 	memset(sb + 1, 0, rdev->sb_size - sizeof(*sb));
Signature · 1 line
2.5.5