Date: Sat, 29 Jan 2011 00:33:04 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r218053 - projects/graid/head/sys/geom/raid Message-ID: <201101290033.p0T0X48l006640@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Sat Jan 29 00:33:04 2011 New Revision: 218053 URL: http://svn.freebsd.org/changeset/base/218053 Log: Kill bio leak in the normal I/O path. Now we can survive the raid_rebuild_test.sh without leaking anything. Before, we'd leak 40k bio when testing on a 200MB volume each time the test is run. # I haven't looked at tr_raid0.c to see if that's affected also. Modified: projects/graid/head/sys/geom/raid/tr_raid1.c Modified: projects/graid/head/sys/geom/raid/tr_raid1.c ============================================================================== --- projects/graid/head/sys/geom/raid/tr_raid1.c Sat Jan 29 00:21:40 2011 (r218052) +++ projects/graid/head/sys/geom/raid/tr_raid1.c Sat Jan 29 00:33:04 2011 (r218053) @@ -575,7 +575,7 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ struct g_raid_volume *vol; struct bio *pbp; struct g_raid_tr_raid1_object *trs; - int i; + int i, error; trs = (struct g_raid_tr_raid1_object *)tr; pbp = bp->bio_parent; @@ -793,9 +793,11 @@ g_raid_tr_iodone_raid1(struct g_raid_tr_ bp->bio_error = 0; } } + error = bp->bio_error; + g_destroy_bio(bp); if (pbp->bio_children == pbp->bio_inbed) { pbp->bio_completed = pbp->bio_length; - g_raid_iodone(pbp, bp->bio_error); + g_raid_iodone(pbp, error); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101290033.p0T0X48l006640>