[PATCH 1/2] DDF: add_to_super_ddf: leave invalid secondary_lba untouched

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the current DDF structure doesn't have a secondary header,
don't set it.

Signed-off-by: Martin Wilck <mwilck@xxxxxxxx>
---
 super-ddf.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/super-ddf.c b/super-ddf.c
index 002b271..3e13ff0 100644
--- a/super-ddf.c
+++ b/super-ddf.c
@@ -2822,8 +2822,9 @@ static int add_to_super_ddf(struct supertype *st,
 	} while (0)
 	__calc_lba(dd, ddf->dlist, workspace_lba, 32);
 	__calc_lba(dd, ddf->dlist, primary_lba, 16);
-	if (ddf->dlist == NULL ||
-	    be64_to_cpu(ddf->dlist->secondary_lba) != ~(__u64)0)
+	if (be64_to_cpu(ddf->active->secondary_lba) == ~(__u64)0)
+		dd->secondary_lba = ddf->active->secondary_lba;
+	else
 		__calc_lba(dd, ddf->dlist, secondary_lba, 32);
 	pde->config_size = dd->workspace_lba;
 
-- 
1.7.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux