Bug 819883 - raid-check doesn't check arrays with active I/O
raid-check doesn't check arrays with active I/O
Product: Fedora
Classification: Fedora
Component: mdadm (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Jes Sorensen
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-05-08 09:18 EDT by Jes Sorensen
Modified: 2012-07-02 07:13 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-05-08 09:25:40 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jes Sorensen 2012-05-08 09:18:36 EDT
Description of problem:
The /etc/cron.weekly/99-raid-check script does not check my md2 but does check
md0 and md1.

Version-Release number of selected component (if applicable):

How reproducible:
Depends on I/O at the time the script runs. 

Steps to Reproduce:
1. Used dd command to write 1 GB of /dev/zero to a file:
[root@dhcpxx-xx ~]# dd if=/dev/zero of=foobar count=1 bs=1073741824

2. While dd was writing, confirm /sys/block/mdX/md/array_state is 'active'
[root@dhcpxx-xx ~]# cat /sys/block/md2/md/array_state 

3. Run the script 99-raid-check

4. Verify mdX was not checked. In my case mdX= md2

Sep  5 07:09:15 dhcpxx-xx kernel: md: syncing RAID array md0
Sep  5 07:09:38 dhcpxx-xx kernel: md: md0: sync done.
Sep  5 07:10:51 dhcpxx-xx kernel: md: syncing RAID array md0
Sep  5 07:10:51 dhcpxx-xx kernel: md: delaying resync of md1 until md0 has
finished resync (they share one or more physical units)
Sep  5 07:12:04 dhcpxx-xx kernel: md: md0: sync done.
Sep  5 07:12:04 dhcpxx-xx kernel: md: syncing RAID array md1

Actual results:
The array busy with IO is not checked

Expected results:
All valid arrays are checked, irrespective of whether it is busy or not

Additional info:
When 99-raid-check runs there is a lot of write activity which keeps md2 in the
'active' state. The script checks for 'clean' so it skips md2 since it is

Suggested fix:
array_state values of 'clean' or 'active' should be considered ok.

Change this:
    if [ "$array_state" = clean -a "$sync_action" = idle ]; then
    if [ "$array_state" = clean -o "$array_state" = active ] && [
"$sync_action" = idle ]; then
Comment 1 Jes Sorensen 2012-05-08 09:25:40 EDT
DOH, I need to read bash scripts correctly, the Fedora script reads like
this, ie. already does the right thing:

	if [ "$array_state" != "clean" -a "$array_state" != "active" ]; then
	sync_action=`cat /sys/block/$dev/md/sync_action`
	if [ "$sync_action" != idle ]; then

Closing - NOTABUG
Comment 2 John Robinson 2012-07-02 06:44:20 EDT
Please reopen for EL5, this is still a bug there (as you saw as you reported this against mdadm-2.6.9-3.el5), as pointed up on the linux-raid list yesterday (see http://marc.info/?l=linux-raid&m=134118030800900&w=2 )
Comment 3 Jes Sorensen 2012-07-02 07:05:01 EDT
There is already a bugzilla open against RHEL5 and the fix has pushed into
the tree.
Comment 4 John Robinson 2012-07-02 07:13:49 EDT
Ah OK, I guess I just couldn't find it.

Note You need to log in before you can comment on or make changes to this bug.