imsm: correct offset for 4k disks in --examine output
PATCH 1/3 imsm: correct offset for 4k disks in --examine output
"Sector Offset" field in Examine output was always printed in 512 byte sectors. Update it to support 4096 sector size.
--- super-intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
super-intel.c +1 -1
@@ -1663,7 +1663,7 @@ static void print_imsm_dev(struct intel_super *super, (unsigned long long )sz *512 / super->sector_size, human_size(sz * 512));printf (" Sector Offset : %llu\n" , -pba_of_lba0 (map)); +pba_of_lba0 (map) *512 / super->sector_size);printf (" Num Stripes : %llu\n" ,num_data_stripes (map)); printf(" Chunk Size : %u KiB",
Signature · 1 line
2.27.0
PATCH 2/3 Remove Spare drives line from details for external metadata
Arrays with external metadata do not have spare disks directly assigned to volumes; spare disks belong to containers and are moved to arrays when the array is degraded/reshaping. Thus, the display of zero spare disks in volume details is incorrect and can be confusing.
--- Detail.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Detail.c +2 -1
@@ -548,7 +548,8 @@ int Detail(char *dev, struct context *c) array.working_disks);if (array.raid_disks) {printf (" Failed Devices : %d\n" , array.failed_disks); -printf (" Spare Devices : %d\n" , array.spare_disks); +if (!external) +printf (" Spare Devices : %d\n" , array.spare_disks); }printf ("\n" );if (array.level ==5 ) {
Signature · 1 line
2.27.0
PATCH 3/3 Don't associate spares with other arrays during RAID Examine
In reply to Oleksandr ShchirskyiSpares in imsm belong to containers, not volumes, and must go into a separate container when assembling the RAID.
Remove association spares with other arrays and make Examine print separate containers for spares.
Auto assemble without config file already works like this. So make creating a config file and assembling from it consistent with auto assemble.
With this change, mdadm -Es will add this line to output if spares are found:
ARRAY metadata=imsm UUID=00000000:00000000:00000000:00000000
--- Examine.c | 2 +- super-intel.c | 74 +++++++++++++-------------------------------------- 2 files changed, 20 insertions(+), 56 deletions(-)
Examine.c +1 -1
@@ -166,7 +166,7 @@ int Examine(struct mddev_dev *devlist,int newline =0 ; ap->st->ss->brief_examine_super (ap->st, c->verbose >0 ); -if (ap->spares) +if (ap->spares && !ap->st->ss->external) newline +=printf (" spares=%d" , ap->spares);if (c->verbose >0 ) { newline +=printf (" devices" );
super-intel.c +19 -55
124 lines not on this page · raw message
Signature · 1 line
2.27.0
Quoted 7 lines · Oleksandr Shchirskyi
"Sector Offset" field in Examine output was always printed in 512 byte sectors. Update it to support 4096 sector size.
Signed-off-by Oleksandr Shchirskyi <[email protected]>--- super-intel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied (3x)
Thanks,
Jes