diff options
author | Song Liu <songliubraving@fb.com> | 2015-12-21 20:23:41 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.com> | 2015-12-21 21:50:03 +0100 |
commit | 6fe4c6160399c94a15eda6092371e0ac9a38a4bc (patch) | |
tree | b6a0271c5055980ca80c2745eb0b07d33ec49f17 /Detail.c | |
parent | Add --update=force-no-bbl. (diff) | |
download | mdadm-6fe4c6160399c94a15eda6092371e0ac9a38a4bc.tar.xz mdadm-6fe4c6160399c94a15eda6092371e0ac9a38a4bc.zip |
move journal to end of --detail list
As we give journal device raid_disk of 0, the output of --detail is:
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
5 8 24 0 journal /dev/sdb8
1 8 18 1 active sync /dev/sdb2
2 8 19 2 active sync /dev/sdb3
3 8 21 3 active sync /dev/sdb5
4 8 23 - spare /dev/sdb7
This patch makes it back to:
Number Major Minor RaidDevice State
0 8 17 0 active sync /dev/sdb1
1 8 18 1 active sync /dev/sdb2
2 8 19 2 active sync /dev/sdb3
3 8 21 3 active sync /dev/sdb5
4 8 23 - spare /dev/sdb7
5 8 24 - journal /dev/sdb8
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: NeilBrown <neilb@suse.com>
Diffstat (limited to 'Detail.c')
-rw-r--r-- | Detail.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -326,7 +326,8 @@ int Detail(char *dev, struct context *c) && disks[disk.raid_disk*2].state == (1<<MD_DISK_REMOVED)) disks[disk.raid_disk*2] = disk; else if (disk.raid_disk >= 0 && disk.raid_disk < array.raid_disks - && disks[disk.raid_disk*2+1].state == (1<<MD_DISK_REMOVED)) + && disks[disk.raid_disk*2+1].state == (1<<MD_DISK_REMOVED) + && !(disk.state & (1<<MD_DISK_JOURNAL))) disks[disk.raid_disk*2+1] = disk; else if (next < max_disks*2) disks[next++] = disk; @@ -621,7 +622,7 @@ This is pretty boring if (disk.number < 0) printf(" - %5d %5d - ", disk.major, disk.minor); - else if (disk.raid_disk < 0) + else if (disk.raid_disk < 0 || disk.state & (1<<MD_DISK_JOURNAL)) printf(" %5d %5d %5d - ", disk.number, disk.major, disk.minor); else if (disk.number < 0) |