Linux RAID subsystem development
 help / color / mirror / Atom feed
* [PATCH] md: fix multipath oops
@ 2008-11-17 10:32 Andre Noll
  2008-11-19 21:57 ` Neil Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Andre Noll @ 2008-11-17 10:32 UTC (permalink / raw)
  To: NeilBrown; +Cc: linux-raid

[-- Attachment #1: Type: text/plain, Size: 1646 bytes --]

Hi

the current for-next kernel oopses on the 00multipath test of the
mdadm test suite. I'm not sure if the patch below is the best way to
fix this problem, but it avoids the oops and makes the 00multipath
test succeed. In the long run it might be preferable to use a wrapper
for sysfs_notify_dirent() that checks for NULL pointers, or even teach
sysfs_notify_dirent() to return early if it gets passed a NULL pointer.

Please consider for inclusion.

Thanks
Andre

commit 9448a199ff0e4706ff8146f889bf5c3ff96dee7a
Author: Andre Noll <maan@systemlinux.org>
Date:   Mon Nov 17 11:36:19 2008 +0100

    md: Avoid NULL pointer dereference in sysfs_notify_dirent().
    
    The 00multipath test of the mdadm test suite causes the oops below
    in sysfs_notify_dirent() due to mddev->sysfs_action being NULL in
    md_check_recovery().
    
    Check if mddev->sysfs_action is NULL and do not call
    sysfs_notify_dirent() in this case.
    
    Signed-off-by: Andre Noll <maan@systemlinux.org>

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 61a87f4..7c5617d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6233,8 +6233,8 @@ void md_check_recovery(mddev_t *mddev)
 	unlock:
 		if (!mddev->sync_thread) {
 			clear_bit(MD_RECOVERY_RUNNING, &mddev->recovery);
-			if (test_and_clear_bit(MD_RECOVERY_RECOVER,
-					       &mddev->recovery))
+			if (mddev->sysfs_action && test_and_clear_bit(
+				MD_RECOVERY_RECOVER, &mddev->recovery))
 				sysfs_notify_dirent(mddev->sysfs_action);
 		}
 		mddev_unlock(mddev);
-- 
The only person who always got his work done by Friday was Robinson Crusoe

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-21 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-17 10:32 [PATCH] md: fix multipath oops Andre Noll
2008-11-19 21:57 ` Neil Brown
2008-11-21 10:29   ` Andre Noll

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox