wrong --detail --test

Bug #1524697 reported by Constantine Shulyupin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mdadm (Ubuntu)
New
Undecided
Unassigned

Bug Description

Degradation in 3.2 to 3.3.4, last working 3.2.6.

mdadm --detail --test returns 0 on for degraded array, when only the second of two disks is removed, works as expected when the first disk removed.

Expected:
  --test -t : exit status 0 if ok, 1 if degrade, 2 if dead, 4 if missing

Expected:
mdadm --detail /dev/md2 --test ; echo $?
/dev/md2:
        Version : 1.2
  Creation Time : Thu Dec 10 11:50:20 2015
     Raid Level : raid1
     Array Size : 780226240 (744.08 GiB 798.95 GB)
  Used Dev Size : 780226240 (744.08 GiB 798.95 GB)
   Raid Devices : 2
  Total Devices : 1
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Thu Dec 10 11:50:22 2015
          State : active, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : A1
           UUID : 333592b4:40d92ae2:9cf82398:b92d466e
         Events : 24

    Number Major Minor RaidDevice State
       0 0 0 0 removed
       1 8 34 1 active sync /dev/sdc2
1
^^ not a bug

Bug:

mdadm --detail /dev/md1 --test ; echo $?
/dev/md1:
        Version : 1.2
  Creation Time : Thu Dec 10 11:39:41 2015
     Raid Level : raid1
     Array Size : 780226240 (744.08 GiB 798.95 GB)
  Used Dev Size : 780226240 (744.08 GiB 798.95 GB)
   Raid Devices : 2
  Total Devices : 1
    Persistence : Superblock is persistent

  Intent Bitmap : Internal

    Update Time : Thu Dec 10 11:42:35 2015
          State : active, degraded
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0

           Name : A1
           UUID : 6a29c716:b804f9f3:3519867f:32f98380
         Events : 32

    Number Major Minor RaidDevice State
       0 8 18 0 active sync /dev/sdb2
       2 0 0 2 removed
0
^^^ BUG

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.