* [PATCH-stable16] Fix a potential NULL dereference in md/raid1 [not found] <20060821094833.21982.patches@notabene> @ 2006-08-20 23:50 ` NeilBrown 2006-08-21 0:01 ` Adrian Bunk 0 siblings, 1 reply; 5+ messages in thread From: NeilBrown @ 2006-08-20 23:50 UTC (permalink / raw) To: Adrian Bunk; +Cc: linux-raid patch for 2.6.16 stable series My applogies to people reading this with a window narrower than 111 characters :-( NeilBrown ### Comments for Changeset At the point where this 'atomic_add' is, rdev could be NULL, as seen by the fact that we test for this in the very next statement. Further is it is really the wrong place of the add. We could add to the count of corrected errors once the are sure it was corrected, not before trying to correct it. Signed-off-by: Neil Brown <neilb@suse.de> ### Diffstat output ./drivers/md/raid1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff .prev/drivers/md/raid1.c ./drivers/md/raid1.c --- .prev/drivers/md/raid1.c 2006-08-21 09:47:57.000000000 +1000 +++ ./drivers/md/raid1.c 2006-08-21 09:43:37.000000000 +1000 @@ -1467,7 +1467,6 @@ static void raid1d(mddev_t *mddev) d = conf->raid_disks; d--; rdev = conf->mirrors[d].rdev; - atomic_add(s, &rdev->corrected_errors); if (rdev && test_bit(In_sync, &rdev->flags)) { if (sync_page_io(rdev->bdev, @@ -1490,6 +1489,9 @@ static void raid1d(mddev_t *mddev) s<<9, conf->tmppage, READ) == 0) /* Well, this device is dead */ md_error(mddev, rdev); + else + atomic_add(s, &rdev->corrected_errors); + } } } else { ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-stable16] Fix a potential NULL dereference in md/raid1 2006-08-20 23:50 ` [PATCH-stable16] Fix a potential NULL dereference in md/raid1 NeilBrown @ 2006-08-21 0:01 ` Adrian Bunk 2006-08-21 0:07 ` Neil Brown 0 siblings, 1 reply; 5+ messages in thread From: Adrian Bunk @ 2006-08-21 0:01 UTC (permalink / raw) To: NeilBrown; +Cc: linux-raid On Mon, Aug 21, 2006 at 09:50:13AM +1000, NeilBrown wrote: > patch for 2.6.16 stable series >... Thanks for this patch. It does also apply against both 2.6.17.9 and Linus' tree. Is it not required in these trees, or are you also submitting it there? cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-stable16] Fix a potential NULL dereference in md/raid1 2006-08-21 0:01 ` Adrian Bunk @ 2006-08-21 0:07 ` Neil Brown 2006-08-21 0:28 ` Adrian Bunk 0 siblings, 1 reply; 5+ messages in thread From: Neil Brown @ 2006-08-21 0:07 UTC (permalink / raw) To: Adrian Bunk; +Cc: linux-raid On Monday August 21, bunk@stusta.de wrote: > On Mon, Aug 21, 2006 at 09:50:13AM +1000, NeilBrown wrote: > > > patch for 2.6.16 stable series > >... > > Thanks for this patch. > > It does also apply against both 2.6.17.9 and Linus' tree. > > Is it not required in these trees, or are you also submitting it there? I've just sent a patch to stable@kernel.org for 2.6.17.9. (it is the same patch with slightly different line numbers). The patch for -linus is quite different and will follow shortly (with a few other patches). Thanks, NeilBrown ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-stable16] Fix a potential NULL dereference in md/raid1 2006-08-21 0:07 ` Neil Brown @ 2006-08-21 0:28 ` Adrian Bunk 2006-08-26 15:33 ` Adrian Bunk 0 siblings, 1 reply; 5+ messages in thread From: Adrian Bunk @ 2006-08-21 0:28 UTC (permalink / raw) To: Neil Brown; +Cc: linux-raid On Mon, Aug 21, 2006 at 10:07:12AM +1000, Neil Brown wrote: > On Monday August 21, bunk@stusta.de wrote: > > On Mon, Aug 21, 2006 at 09:50:13AM +1000, NeilBrown wrote: > > > > > patch for 2.6.16 stable series > > >... > > > > Thanks for this patch. > > > > It does also apply against both 2.6.17.9 and Linus' tree. > > > > Is it not required in these trees, or are you also submitting it there? > > I've just sent a patch to stable@kernel.org for 2.6.17.9. (it is the > same patch with slightly different line numbers). > > The patch for -linus is quite different and will follow shortly (with > a few other patches). OK, I'll apply this patch when it has successfully passed 2.6.17 review and got included in 2.6.17. > Thanks, > NeilBrown cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH-stable16] Fix a potential NULL dereference in md/raid1 2006-08-21 0:28 ` Adrian Bunk @ 2006-08-26 15:33 ` Adrian Bunk 0 siblings, 0 replies; 5+ messages in thread From: Adrian Bunk @ 2006-08-26 15:33 UTC (permalink / raw) To: Neil Brown; +Cc: linux-raid On Mon, Aug 21, 2006 at 02:28:47AM +0200, Adrian Bunk wrote: > On Mon, Aug 21, 2006 at 10:07:12AM +1000, Neil Brown wrote: > > On Monday August 21, bunk@stusta.de wrote: > > > On Mon, Aug 21, 2006 at 09:50:13AM +1000, NeilBrown wrote: > > > > > > > patch for 2.6.16 stable series > > > >... > > > > > > Thanks for this patch. > > > > > > It does also apply against both 2.6.17.9 and Linus' tree. > > > > > > Is it not required in these trees, or are you also submitting it there? > > > > I've just sent a patch to stable@kernel.org for 2.6.17.9. (it is the > > same patch with slightly different line numbers). > > > > The patch for -linus is quite different and will follow shortly (with > > a few other patches). > > OK, I'll apply this patch when it has successfully passed 2.6.17 review > and got included in 2.6.17. Applied, thanks for the patch. cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-08-26 15:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20060821094833.21982.patches@notabene>
2006-08-20 23:50 ` [PATCH-stable16] Fix a potential NULL dereference in md/raid1 NeilBrown
2006-08-21 0:01 ` Adrian Bunk
2006-08-21 0:07 ` Neil Brown
2006-08-21 0:28 ` Adrian Bunk
2006-08-26 15:33 ` Adrian Bunk
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).