Skip to contentSkip to conversation

The subarray is loaded container by load_container

DISCUSSION Xiao Ni 3 participants 5 messages Jul 7, 2016 – Aug 9, 2016 1 message not in the archive MD RAID

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Xiao Ni

author
#1 lore raw

Hi all

We encountered one problem at booting time:

Run MD devices: mdadm: array /dev/md/OSVOLUME0 now has 2 devices (0 new) [FAILED]

mdadm -IRs returns 1 at the booting time. In fact the array is already running. The command mdadm -IRs shouldn't return 1 if all the arrays are running, right?

In IncrementalScan function, it scans all the raid in /run/mdadm/map. It contains the subarray too. The return value is 1 from function load_container. So the return value of IncrementalScan rv is set to 1. If all arrays are running already, I think mdadm -IRs should return 0, not 1.

Should we checks earlier whether it's a container or not before calling load_container?

Best Regards
Xiao

#2 lore raw
Quoted 14 lines · Xiao Ni

Hi all

We encountered one problem at booting time:

Run MD devices: mdadm: array /dev/md/OSVOLUME0 now has 2 devices (0 new) [FAILED]

mdadm -IRs returns 1 at the booting time. In fact the array is already running. The command mdadm -IRs shouldn't return 1 if all the arrays are running, right?

In IncrementalScan function, it scans all the raid in /run/mdadm/map. It contains the subarray too. The return value is 1 from function load_container. So the return value of IncrementalScan rv is set to 1. If all arrays are running already, I think mdadm -IRs should return 0, not 1.

Quoted 5 lines

Should we checks earlier whether it's a container or not before calling load_container?

Best Regards
Xiao

Hi Xiao,

I think you're right that mdadm -IRs should return 0 in this case. IncrementalScan should not try loading a container from a member array, because that will always fail. Can you check if this fixes the problem for you?

Incremental.c +5 -1
index ba97b00..cc01d41 100644
@@ -1347,8 +1347,12 @@ restart:
 
                if (devnm && strcmp(devnm, me->devnm) != 0)
                        continue;
-               if (devnm && me->metadata[0] == '/') {
+               if (me->metadata[0] == '/') {
                        char *sl;
+
+                       if (!devnm)
+                               continue;
+
                        /* member array, need to work on container */
                        strncpy(container, me->metadata+1, 32);
                        container[31] = 0;

Thanks,
Artur

author
#3 lore raw
Quoted 46 lines · Artur Paszkiewicz
Quoted 14 lines · Xiao Ni

Hi all

We encountered one problem at booting time:

Run MD devices: mdadm: array /dev/md/OSVOLUME0 now has 2 devices (0 new) [FAILED]

mdadm -IRs returns 1 at the booting time. In fact the array is already running. The command mdadm -IRs shouldn't return 1 if all the arrays are running, right?

In IncrementalScan function, it scans all the raid in /run/mdadm/map. It contains the subarray too. The return value is 1 from function load_container. So the return value of IncrementalScan rv is set to 1. If all arrays are running already, I think mdadm -IRs should return 0, not 1.

Quoted 5 lines

Should we checks earlier whether it's a container or not before calling load_container?

Best Regards
Xiao

Hi Xiao,

I think you're right that mdadm -IRs should return 0 in this case. IncrementalScan should not try loading a container from a member array, because that will always fail. Can you check if this fixes the problem for you?

Incremental.c +5 -1
index ba97b00..cc01d41 100644
@@ -1347,8 +1347,12 @@ restart:
 
                 if (devnm && strcmp(devnm, me->devnm) != 0)
                         continue;
-               if (devnm && me->metadata[0] == '/') {
+               if (me->metadata[0] == '/') {
                         char *sl;
+
+                       if (!devnm)
+                               continue;
+
                         /* member array, need to work on container */
                         strncpy(container, me->metadata+1, 32);
                         container[31] = 0;
Quoted 7 lines

Thanks,
Artur

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Hi Artur

Sorry for late response. I have been waiting the result from customer and the customer haven't give me the answer. I tested this in my environment and this patch can fix this problem.

Best Regards
Xiao

#4 lore raw
Quoted 35 lines · Xiao Ni
Quoted 28 lines · Artur Paszkiewicz

Hi Xiao,

I think you're right that mdadm -IRs should return 0 in this case. IncrementalScan should not try loading a container from a member array, because that will always fail. Can you check if this fixes the problem for you?

Incremental.c +5 -1
index ba97b00..cc01d41 100644
@@ -1347,8 +1347,12 @@ restart:
                   if (devnm && strcmp(devnm, me->devnm) != 0)
                         continue;
-               if (devnm && me->metadata[0] == '/') {
+               if (me->metadata[0] == '/') {
                         char *sl;
+
+                       if (!devnm)
+                               continue;
+
                         /* member array, need to work on container */
                         strncpy(container, me->metadata+1, 32);
                         container[31] = 0;
 

Thanks,
Artur

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Hi Artur

Quoted 3 lines

Sorry for late response. I have been waiting the result from customer and the customer haven't give me the answer. I tested this in my environment and this patch can fix this problem.

Artur,

Do you have a version of this patch you would like me to apply to the official mdadm tree?

Cheers,
Jes

#5 lore raw
Quoted 2 lines · Jes Sorensen

Do you have a version of this patch you would like me to apply to the official mdadm tree?

Hi Jes,

Yes I do, I'll send the patch in a moment.

Artur