Bug#611627: mdadm: checkarray doesn't handle all arrays if no scheduling class given

Mario 'BitKoenig' Holbe Mario.Holbe at TU-Ilmenau.DE
Mon Jan 31 13:40:28 UTC 2011


On Mon, Jan 31, 2011 at 02:05:04PM +0100, martin f krafft wrote:
> tags 611627 confirmed
> thanks
> 
> also sprach Mario 'BitKoenig' Holbe <Mario.Holbe at TU-Ilmenau.DE> [2011.01.31.1341 +0100]:
> > checkarray terminates after issuing check to first RAID if no scheduling
> > class is given:
> > This is due to the break in checkarray:188:
> Indeed. Can you please verify that changing s/break/continue in both
> lines 188 and 200 fixes the problem?

Changing the break in line 188 to continue fixes the problem.


Changing the break in line 200 is wrong:
break (without a level) exits from the inner loop, which is the loop to
wait for a resync pid here. Hence, changing this in the best case leads
to ionice being called over and over again (up to 5 times) on the same
process:

# /tmp/checkarray --cron --all --idle --quiet
checkarray: I: selecting idle I/O scheduling class for resync of md0.
checkarray: I: selecting idle I/O scheduling class for resync of md0.
checkarray: I: selecting idle I/O scheduling class for resync of md0.
checkarray: I: selecting idle I/O scheduling class for resync of md1.
checkarray: I: selecting idle I/O scheduling class for resync of md1.
...

In the worst case, the resync process terminates within these 5 seconds
and checkarray terminates due to failing ionice (and set -e):

# /tmp/checkarray --cron --all --idle --quiet
checkarray: I: selecting idle I/O scheduling class for resync of md0.
checkarray: I: selecting idle I/O scheduling class for resync of md0.
checkarray: I: selecting idle I/O scheduling class for resync of md0.
ionice: ioprio_set failed: No such process
# 

This, btw., indicates a race condition anyways.
It would probably make sense to guard the ionice call:
          ionice -p "$resync_pid" $arg || true


And while we are at changing the script anyways...
Could you please consider quieting the "selecting I/O scheduling class"
message? This would prevent the cron job from sending a mail each month.


I'm attaching a diff that does all of the above - and I tested the
resulting script :)


regards
   Mario
-- 
Ho ho ho! I am Santa Claus of Borg. Nice assimilation all together!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: checkarray.patch
Type: text/x-diff
Size: 879 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mdadm-devel/attachments/20110131/dfce53f8/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 482 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-mdadm-devel/attachments/20110131/dfce53f8/attachment-0001.pgp>


More information about the pkg-mdadm-devel mailing list