* [PATCH] mdadm: put journal device in right place of --detail
@ 2016-08-12 0:14 Song Liu
2016-08-12 14:59 ` Jes Sorensen
0 siblings, 1 reply; 2+ messages in thread
From: Song Liu @ 2016-08-12 0:14 UTC (permalink / raw)
To: linux-raid; +Cc: yizhan, Song Liu, Shaohua Li
When there is failed HDDs, journal device showed in wrong place
of --detail:
Number Major Minor RaidDevice State
4 8 24 - 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
0 8 17 - faulty /dev/sdb1
This patch fixed the output as:
Number Major Minor RaidDevice State
- 0 0 0 removed
1 8 18 1 active sync /dev/sdb2
2 8 19 2 active sync /dev/sdb3
3 8 21 3 active sync /dev/sdb5
0 8 17 - faulty /dev/sdb1
4 8 24 - journal /dev/sdb8
Reported-by: Yi Zhang <yizhan@redhat.com>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Shaohua Li <shli@fb.com>
---
Detail.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Detail.c b/Detail.c
index 7a984c8..925e479 100644
--- a/Detail.c
+++ b/Detail.c
@@ -323,7 +323,8 @@ int Detail(char *dev, struct context *c)
if (disk.major == 0 && disk.minor == 0)
continue;
if (disk.raid_disk >= 0 && disk.raid_disk < array.raid_disks
- && disks[disk.raid_disk*2].state == (1<<MD_DISK_REMOVED))
+ && disks[disk.raid_disk*2].state == (1<<MD_DISK_REMOVED)
+ && ((disk.state & (1<<MD_DISK_JOURNAL)) == 0))
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)
--
2.8.0.rc2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mdadm: put journal device in right place of --detail
2016-08-12 0:14 [PATCH] mdadm: put journal device in right place of --detail Song Liu
@ 2016-08-12 14:59 ` Jes Sorensen
0 siblings, 0 replies; 2+ messages in thread
From: Jes Sorensen @ 2016-08-12 14:59 UTC (permalink / raw)
To: Song Liu; +Cc: linux-raid, yizhan, Shaohua Li
Song Liu <songliubraving@fb.com> writes:
> When there is failed HDDs, journal device showed in wrong place
> of --detail:
>
> Number Major Minor RaidDevice State
> 4 8 24 - 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
>
> 0 8 17 - faulty /dev/sdb1
>
> This patch fixed the output as:
>
> Number Major Minor RaidDevice State
> - 0 0 0 removed
> 1 8 18 1 active sync /dev/sdb2
> 2 8 19 2 active sync /dev/sdb3
> 3 8 21 3 active sync /dev/sdb5
>
> 0 8 17 - faulty /dev/sdb1
> 4 8 24 - journal /dev/sdb8
>
> Reported-by: Yi Zhang <yizhan@redhat.com>
> Signed-off-by: Song Liu <songliubraving@fb.com>
> Signed-off-by: Shaohua Li <shli@fb.com>
> ---
> Detail.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied, thanks!
Jes
PS: If you CC me directly in mdadm patches I am likely to see them
faster, ie. before I get to the linux-raid list.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-08-12 14:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-12 0:14 [PATCH] mdadm: put journal device in right place of --detail Song Liu
2016-08-12 14:59 ` Jes Sorensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).