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

version graph

Package: mdadm; Maintainer for mdadm is Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>; Source for mdadm is src:mdadm.

Reported by: "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE>

Date: Mon, 31 Jan 2011 12:45:02 UTC

Severity: normal

Tags: confirmed

Found in version mdadm/3.1.4-1+8efb9d1

Fixed in version mdadm/3.2.2-1

Done: madduck@debian.org (martin f. krafft)

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>:
Bug#611627; Package mdadm. (Mon, 31 Jan 2011 12:45:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE>:
New Bug report received and forwarded. Copy sent to Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>. (Mon, 31 Jan 2011 12:45:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE>
To: submit@bugs.debian.org
Subject: mdadm: checkarray doesn't handle all arrays if no scheduling class given
Date: Mon, 31 Jan 2011 13:41:39 +0100
[Message part 1 (text/plain, inline)]
Package: mdadm
Version: 3.1.4-1+8efb9d1

Hello,

checkarray terminates after issuing check to first RAID if no scheduling
class is given:

# grep ^md /proc/mdstat | tail -3
md2 : active raid1 sdg4[2] sda4[0] sdb4[1]
md1 : active raid1 sdg3[2] sda3[0] sdb3[1]
md0 : active raid1 sdg2[2] sda2[0] sdb2[1]
# /usr/share/mdadm/checkarray -a
checkarray: I: check queued for array md0.
# 

This is due to the break in checkarray:188:
   183	      case "$ionice" in
   184	        idle) arg='-c3';;
   185	        low) arg='-c2 -n7';;
   186	        high) arg='-c2 -n0';;
   187	        realtime) arg='-c1 -n4';;
   188	        *) break;;
   189	      esac


regards
   Mario
-- 
Die Natur ist das einzige Buch, das auf allen Blaettern grossen Gehalt
bietet.
                                    -- Johann Wolfgang von Goethe
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>:
Bug#611627; Package mdadm. (Mon, 31 Jan 2011 13:09:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>. (Mon, 31 Jan 2011 13:09:04 GMT) Full text and rfc822 format available.

Message #10 received at 611627@bugs.debian.org (full text, mbox):

From: martin f krafft <madduck@debian.org>
To: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>, 611627@bugs.debian.org
Subject: Re: Bug#611627: mdadm: checkarray doesn't handle all arrays if no scheduling class given
Date: Mon, 31 Jan 2011 14:05:04 +0100
[Message part 1 (text/plain, inline)]
tags 611627 confirmed
thanks

also sprach Mario 'BitKoenig' Holbe <Mario.Holbe@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:
>    183	      case "$ionice" in
>    184	        idle) arg='-c3';;
>    185	        low) arg='-c2 -n7';;
>    186	        high) arg='-c2 -n0';;
>    187	        realtime) arg='-c1 -n4';;
>    188	        *) break;;
>    189	      esac

Indeed. Can you please verify that changing s/break/continue in both
lines 188 and 200 fixes the problem?

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
due to lack of interest tomorrow has been cancelled.
[digital_signature_gpg.asc (application/pgp-signature, inline)]

Added tag(s) confirmed. Request was from martin f krafft <madduck@debian.org> to control@bugs.debian.org. (Mon, 31 Jan 2011 13:09:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>:
Bug#611627; Package mdadm. (Mon, 31 Jan 2011 13:42:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE>:
Extra info received and forwarded to list. Copy sent to Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>. (Mon, 31 Jan 2011 13:42:05 GMT) Full text and rfc822 format available.

Message #17 received at 611627@bugs.debian.org (full text, mbox):

From: "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE>
To: martin f krafft <madduck@debian.org>
Cc: 611627@bugs.debian.org
Subject: Re: Bug#611627: mdadm: checkarray doesn't handle all arrays if no scheduling class given
Date: Mon, 31 Jan 2011 14:40:28 +0100
[Message part 1 (text/plain, inline)]
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@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!
[checkarray.patch (text/x-diff, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>:
Bug#611627; Package mdadm. (Mon, 31 Jan 2011 13:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to martin f krafft <madduck@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>. (Mon, 31 Jan 2011 13:57:03 GMT) Full text and rfc822 format available.

Message #22 received at 611627@bugs.debian.org (full text, mbox):

From: martin f krafft <madduck@debian.org>
To: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>
Cc: 611627@bugs.debian.org
Subject: Re: Bug#611627: mdadm: checkarray doesn't handle all arrays if no scheduling class given
Date: Mon, 31 Jan 2011 14:53:14 +0100
[Message part 1 (text/plain, inline)]
tags 611627 pending
thanks

also sprach Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE> [2011.01.31.1440 +0100]:
> 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.

http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commitdiff;h=ed3822ab0e153e9448121cb29f600fdce97bf48a
http://git.debian.org/?p=pkg-mdadm/mdadm.git;a=commitdiff;h=219ef9a6c6a5e6bd1747bca4d13b72ae95ff9512

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
beware of bugs in the above code;
i have only proved it correct, not tried it.
                                                    -- donald e. knuth
[digital_signature_gpg.asc (application/pgp-signature, inline)]

Added tag(s) pending. Request was from martin f krafft <madduck@debian.org> to control@bugs.debian.org. (Mon, 31 Jan 2011 13:57:07 GMT) Full text and rfc822 format available.

Reply sent to madduck@debian.org (martin f. krafft):
You have taken responsibility. (Thu, 15 Sep 2011 07:21:22 GMT) Full text and rfc822 format available.

Notification sent to "Mario 'BitKoenig' Holbe" <Mario.Holbe@TU-Ilmenau.DE>:
Bug acknowledged by developer. (Thu, 15 Sep 2011 07:21:22 GMT) Full text and rfc822 format available.

Message #29 received at 611627-close@bugs.debian.org (full text, mbox):

From: madduck@debian.org (martin f. krafft)
To: 611627-close@bugs.debian.org
Subject: Bug#611627: fixed in mdadm 3.2.2-1
Date: Thu, 15 Sep 2011 07:17:21 +0000
Source: mdadm
Source-Version: 3.2.2-1

We believe that the bug you reported is fixed in the latest version of
mdadm, which is due to be installed in the Debian FTP archive:

mdadm-udeb_3.2.2-1_amd64.udeb
  to main/m/mdadm/mdadm-udeb_3.2.2-1_amd64.udeb
mdadm_3.2.2-1.debian.tar.bz2
  to main/m/mdadm/mdadm_3.2.2-1.debian.tar.bz2
mdadm_3.2.2-1.dsc
  to main/m/mdadm/mdadm_3.2.2-1.dsc
mdadm_3.2.2-1_amd64.deb
  to main/m/mdadm/mdadm_3.2.2-1_amd64.deb
mdadm_3.2.2.orig.tar.bz2
  to main/m/mdadm/mdadm_3.2.2.orig.tar.bz2



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 611627@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
martin f. krafft <madduck@debian.org> (supplier of updated mdadm package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Mon, 01 Aug 2011 10:41:41 +0200
Source: mdadm
Binary: mdadm mdadm-udeb
Architecture: source amd64
Version: 3.2.2-1
Distribution: unstable
Urgency: low
Maintainer: Debian mdadm maintainers <pkg-mdadm-devel@lists.alioth.debian.org>
Changed-By: martin f. krafft <madduck@debian.org>
Description: 
 mdadm      - tool to administer Linux MD arrays (software RAID)
 mdadm-udeb - tool to administer Linux MD arrays (software RAID) (udeb)
Closes: 595516 598957 604702 605722 610421 611627 611632 615494 618463 618561 621346 625392 628371 633054
Changes: 
 mdadm (3.2.2-1) unstable; urgency=low
 .
   [ martin f. krafft ]
   * New upstream version (closes: #615494), which addresses:
     - --grow option aware of size change of underlying device (closes: #618463)
     - builds with -Werror on gcc-4.6 (closes: #625392).
     - new features/functionality:
       + Policy framework.
       + Improved management of reshaping arrays.
       + Support for Intel Matrix Storage Manager (IMSM)
     Thanks to Scott Schaefer for his help in preparing this release!
   * Do not print io rescheduling info message when run by cron
     (closes: #598957).
   * Fix checkarray script so that it does not die after scheduling the first
     device when there is no scheduling class specified; thanks to Mario
     'BitKoenig' Holbe (closes: #611627).
   * Do not include DEVICE line in generated configs but use the built-in value
     by default (closes: #604702).
   * Make mdadm-raid init script depend on hostname; thanks to Mario
    'BitKoenig' Holbe (closes: #610421).
   * Schedule start/stop of mdadm-raid before/after filesystems are
     checked&mounted/unmounted; thanks to Mario 'BitKoenig' Holbe
     (closes: #611632).
   * Work around a shell coding bug for cases when there are zero active
     devices (closes: #618561).
   * Add NEWS entry about metadata change and requirement on new Grub version
     (closes: #595516).
   * Update mdadd.sh script from Arno's webpage.
   * Update md.txt from latest kernel source.
   * Updated debconf translations:
     - Catalan by Innocent De Marchi (closes: #628371)
     - Danish by Joe Dalton (closes: #621346)
   * Small typo fix in RAID5_versus_RAID10.txt
   * Bump Standards-Version to 3.9.2; no changes required.
 .
   [ Michael Tokarev ]
   * don't print W: auto-read-only in checkarray in quiet mode,
     thanks to Bernd Hanisch for the patch (Closes: #605722)
   * move initscript metadata from /lib/init/rw/.mdadm to /run/mdadm,
     and depend on initscripts (>= 2.88dsf-13.3) for /run (Closes: #633054)
   * move runtime stuff from /dev/.mdadm to /run/mdadm
   * document defaults change in debian/NEWS (it was forgotten to be
     done for squeeze) - metadata & chunk size (Closes: #595516)
Checksums-Sha1: 
 943859c83323631f3b6342e32720b41666322b9b 2190 mdadm_3.2.2-1.dsc
 8ec366a7e7f3ae3a8765d8f43f1d62234a80c698 357234 mdadm_3.2.2.orig.tar.bz2
 5ceadc639033fa656a7292374e4a294d0f1fcf5f 123535 mdadm_3.2.2-1.debian.tar.bz2
 4844110b4da321cc9c2b325537706cf03d77d0b6 536758 mdadm_3.2.2-1_amd64.deb
 47ac5f8c3b3cece7bc5ed20ddce16a9c70ec7aba 180836 mdadm-udeb_3.2.2-1_amd64.udeb
Checksums-Sha256: 
 b3aa33e3f3938aba2cc5056663175c8daa0732091d9a8875abe1debff60b17d4 2190 mdadm_3.2.2-1.dsc
 0d1a04e688b082bc88846e3f524abd50bc782b6ffc06123140f7d358c8f9b906 357234 mdadm_3.2.2.orig.tar.bz2
 9d94d66d79cda1deaaa8e5e68cb203327a5c69b629c9773004b9fb9d618e203e 123535 mdadm_3.2.2-1.debian.tar.bz2
 c23d8f0a7140fbae3a9ffd3dd4a563c21bffe0ec408e1f4f4ae5644413ceda71 536758 mdadm_3.2.2-1_amd64.deb
 0b2a3e56dbff6f4e192b69037ba304418f2813c6ab8dc9315219b9692d2e25dd 180836 mdadm-udeb_3.2.2-1_amd64.udeb
Files: 
 196025705dae8c288d569cb53241f1b9 2190 admin optional mdadm_3.2.2-1.dsc
 12ee2fbf3beddb60601fb7a4c4905651 357234 admin optional mdadm_3.2.2.orig.tar.bz2
 e8f0a9a45f116508eda17ad171514307 123535 admin optional mdadm_3.2.2-1.debian.tar.bz2
 5e48a3f95039af09a4957cdbcdc40090 536758 admin optional mdadm_3.2.2-1_amd64.deb
 eb26e081e822e69e64dd28cf063d0ce3 180836 debian-installer optional mdadm-udeb_3.2.2-1_amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQLvBAEBCgDZBQJOcaKXwBEaaHR0cDovL21hcnRpbi1rcmFmZnQubmV0L2dwZy9z
aWctcG9saWN5LzU1Yzk4ODJkOTk5YmJjYzQvMjAxMTAxMjQxMTI1P3NoYTUxMnN1
bT0xY2FkOTZmZDI3ZDMyMzNmNTNlMjI4NDk1MzM2NDgxMDdlNWVlOGQ1YmU2NTUy
NTFkNzRjOGYxYzVjM2JjNDJmMjMwNGZhNTE1MTUwZjdiZDRkZDA1ZTk4MTk5MjRm
MDQ5NTEzZWU5OTYyY2E3MTcwOWY4MWQ5NDUxNTg1MmJkOAAKCRBVyYgtmZu8xIlD
EACjaBhiT38IYF2rKx8GadkV8hjp5cFdUNSmMV9Mhoy3BefJuTs1YkQH8yYDazA6
XLkBxo1/34vZxyJr7a9+V0JqdDAnDHpUojg10a1T3LMFf5oV/+5HX173HadeWnFT
ZXSmhocb67uDDmq502XSOZYq9JE7RXis2Maf3Ln+gBGdnnWYke3wjr1WIWhMGALW
laPI6AQbMRpd+hdPv1jKvSmgNSPFwJq7OJudOKD+iN78536tP3hLJSbl4Mun8lsH
kjvOe+RcbemfHWLCGnIXbF6xrbnUgz7yiWwAjwZ9Yv/VkGw0sVjETzuGF875sY1P
qXFaxFhSTSglNCBHU6I4XCS0sgD9GuDRmqNPRiuqOouDGbofV9nbYwMt0JVQTyL8
rYQLlsz48dj/rMwQau67x8II89obThGa1vHQvO8XemMmmJhEWJaJZ8x4cmZ+1e/O
6AvUmfT6MiuHZ1phZhRy6gMpPjy0xkrSHeuIyllzz+E9pF4/OBOlrbmRHk0VJOo1
RzTACaD5ZL4OU1LE4QgBwt0ebc0uSiLM05UaEq7NL+UBPcZRqyq5CVyN7DNpBAY7
C4wYCc0Kti6B38SDbCNhmgYQMkQFlmph/t3aOrhLrSLPsQP0pH/349zvoBhganGM
mqXn6HECgy6EysT8wRQyB4C7eNfSB2fQTdAgmExILYf0qg==
=AsIz
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 23 Oct 2011 07:36:34 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 13:29:09 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.