linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MD: raid1 s/sysfs_notify_dirent/sysfs_notify_dirent_safe
@ 2011-07-14 20:53 Jonathan Brassow
  2011-07-20  1:47 ` NeilBrown
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Brassow @ 2011-07-14 20:53 UTC (permalink / raw)
  To: linux-raid

If device-mapper creates a RAID1 array that includes devices to
be rebuilt, it will deref a NULL pointer when finished because
sysfs is not used by device-mapper instantiated RAID devices.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>

Index: linux-2.6/drivers/md/raid1.c
===================================================================
--- linux-2.6.orig/drivers/md/raid1.c
+++ linux-2.6/drivers/md/raid1.c
@@ -1027,7 +1027,7 @@ static int raid1_spare_active(mddev_t *m
 		    && !test_bit(Faulty, &rdev->flags)
 		    && !test_and_set_bit(In_sync, &rdev->flags)) {
 			count++;
-			sysfs_notify_dirent(rdev->sysfs_state);
+			sysfs_notify_dirent_safe(rdev->sysfs_state);
 		}
 	}
 	spin_lock_irqsave(&conf->device_lock, flags);



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

* Re: [PATCH] MD: raid1 s/sysfs_notify_dirent/sysfs_notify_dirent_safe
  2011-07-14 20:53 [PATCH] MD: raid1 s/sysfs_notify_dirent/sysfs_notify_dirent_safe Jonathan Brassow
@ 2011-07-20  1:47 ` NeilBrown
  0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2011-07-20  1:47 UTC (permalink / raw)
  To: Jonathan Brassow; +Cc: linux-raid

On Thu, 14 Jul 2011 15:53:49 -0500 Jonathan Brassow <jbrassow@redhat.com>
wrote:

> If device-mapper creates a RAID1 array that includes devices to
> be rebuilt, it will deref a NULL pointer when finished because
> sysfs is not used by device-mapper instantiated RAID devices.
> 
> Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
> 
> Index: linux-2.6/drivers/md/raid1.c
> ===================================================================
> --- linux-2.6.orig/drivers/md/raid1.c
> +++ linux-2.6/drivers/md/raid1.c
> @@ -1027,7 +1027,7 @@ static int raid1_spare_active(mddev_t *m
>  		    && !test_bit(Faulty, &rdev->flags)
>  		    && !test_and_set_bit(In_sync, &rdev->flags)) {
>  			count++;
> -			sysfs_notify_dirent(rdev->sysfs_state);
> +			sysfs_notify_dirent_safe(rdev->sysfs_state);
>  		}
>  	}
>  	spin_lock_irqsave(&conf->device_lock, flags);
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



Applied, thanks.

NeilBrown


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

end of thread, other threads:[~2011-07-20  1:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-14 20:53 [PATCH] MD: raid1 s/sysfs_notify_dirent/sysfs_notify_dirent_safe Jonathan Brassow
2011-07-20  1:47 ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).