[PATCH] md: fix multipath oops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxx>

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: signature.asc
Description: Digital signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux