From owner-cvs-all@FreeBSD.ORG Tue Jun 22 22:17:31 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16EB816A4CE; Tue, 22 Jun 2004 22:17:31 +0000 (GMT) Received: from darkness.comp.waw.pl (darkness.comp.waw.pl [195.117.238.236]) by mx1.FreeBSD.org (Postfix) with ESMTP id B341F43D3F; Tue, 22 Jun 2004 22:17:30 +0000 (GMT) (envelope-from pjd@darkness.comp.waw.pl) Received: by darkness.comp.waw.pl (Postfix, from userid 1009) id E599AACADB; Wed, 23 Jun 2004 00:17:27 +0200 (CEST) Date: Wed, 23 Jun 2004 00:17:27 +0200 From: Pawel Jakub Dawidek To: Lukas Ertl Message-ID: <20040622221727.GV12007@darkness.comp.waw.pl> References: <200406221454.i5MEsVrp091154@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wFcEkHhPyqONlKAq" Content-Disposition: inline In-Reply-To: <200406221454.i5MEsVrp091154@repoman.freebsd.org> User-Agent: Mutt/1.4.2i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 5.2.1-RC2 i386 cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/geom/vinum geom_vinum_raid5.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2004 22:17:31 -0000 --wFcEkHhPyqONlKAq Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jun 22, 2004 at 02:54:31PM +0000, Lukas Ertl wrote: +> le 2004-06-22 14:54:31 UTC +>=20 +> FreeBSD src repository +>=20 +> Modified files: +> sys/geom/vinum geom_vinum_raid5.c=20 +> Log: +> Don't sleep in the g_down path. More error checks to come. Yeah, there are many potential memory leaks, many situations like this: ptr =3D malloc(...); if (ptr =3D=3D NULL) return (ENOMEM); LIST_FOREACH(...) { ptr1 =3D malloc(...); if (ptr1 =3D=3D NULL) return (ENOMEM); [...] ptr2 =3D malloc(...); if (ptr2 =3D=3D NULL) return (ENOMEM); } So if for example allocation of 'ptr2' fails, we leak 'ptr' and 'ptr1'. Maybe you should just use kernel thread to do whole I/O handling to avoid such complex scenarious? --=20 Pawel Jakub Dawidek http://www.FreeBSD.org pjd@FreeBSD.org http://garage.freebsd.pl FreeBSD committer Am I Evil? Yes, I Am! --wFcEkHhPyqONlKAq Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFA2K/3ForvXbEpPzQRAg1sAJ4hI01c5htGb/K6ool2IjjM2GPqjwCfaiui RnZLg5AqRAVOSyFd5k5WMxg= =Lgxl -----END PGP SIGNATURE----- --wFcEkHhPyqONlKAq--