Bug 819883 - raid-check doesn't check arrays with active I/O
Summary: raid-check doesn't check arrays with active I/O
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: mdadm
Version: 17
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jes Sorensen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-08 13:18 UTC by Jes Sorensen
Modified: 2012-07-02 11:13 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-05-08 13:25:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jes Sorensen 2012-05-08 13:18:36 UTC
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):
mdadm-2.6.9-3.el5.x86_64 

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 
active

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
'active'.

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

Change this:
    if [ "$array_state" = clean -a "$sync_action" = idle ]; then
to...
    if [ "$array_state" = clean -o "$array_state" = active ] && [
"$sync_action" = idle ]; then

Comment 1 Jes Sorensen 2012-05-08 13:25:40 UTC
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
	    continue
	fi
	sync_action=`cat /sys/block/$dev/md/sync_action`
	if [ "$sync_action" != idle ]; then
	    continue
	fi

Closing - NOTABUG

Comment 2 John Robinson 2012-07-02 10:44:20 UTC
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 11:05:01 UTC
There is already a bugzilla open against RHEL5 and the fix has pushed into
the tree.

Comment 4 John Robinson 2012-07-02 11:13:49 UTC
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.