On Mon, Oct 10, 2005 at 21:40:43 -0300, Glauber de Oliveira Costa wrote: > [...] > In the code you commented, I thought that we get the same case testing > from or to conditions, and thus, it would be correct to threat them in > the same way. In that code (below), the first test can safely just return. But the second has to undo the first call before returning. When you test new, the bh is already non-null. So you must release it. > [...] > > On Tue, Oct 11, 2005 at 01:05:03AM +0100, Al Viro wrote: > > On Mon, Oct 10, 2005 at 09:07:34PM -0300, Glauber de Oliveira Costa wrote: > > > if (!bh) > > > return -EIO; > > > new = sb_getblk(sb, to); > > > + if (!new) > > > + return -EIO; > > > > You've just introduced a leak here, obviously. > > > > Please, read the code before "fixing" that stuff; slapping returns at random > > and hoping that it will help is not a good way to deal with that - the only > > thing you achieve is hiding the problem. > > > > The same goes for the rest of patch - in each case it's not obvious that your > > changes are correct. -- Jan 'Bulb' Hudec <[email protected]>
Attachment:
signature.asc
Description: Digital signature
- References:
- [PATCH] Use of getblk differs between locations
- From: Glauber de Oliveira Costa <[email protected]>
- Re: [PATCH] Use of getblk differs between locations
- From: Anton Altaparmakov <[email protected]>
- Re: [PATCH] Use of getblk differs between locations
- From: Glauber de Oliveira Costa <[email protected]>
- Re: [PATCH] Use of getblk differs between locations
- From: Mikulas Patocka <[email protected]>
- Re: [PATCH] Use of getblk differs between locations
- From: Glauber de Oliveira Costa <[email protected]>
- Re: [PATCH] Use of getblk differs between locations
- From: Anton Altaparmakov <[email protected]>
- Re: [PATCH] Use of getblk differs between locations
- From: Andrew Morton <[email protected]>
- Re: [PATCH] Use of getblk differs between locations
- From: Glauber de Oliveira Costa <[email protected]>
- Re: [PATCH] Use of getblk differs between locations
- From: Al Viro <[email protected]>
- Re: [PATCH] Use of getblk differs between locations
- From: Glauber de Oliveira Costa <[email protected]>
- [PATCH] Use of getblk differs between locations
- Prev by Date: Re: [PATCH 2.6.14-rc2-mm2] core remove PageReserved
- Next by Date: Re: i386 spinlock fairness: bizarre test results
- Previous by thread: Re: [PATCH] Use of getblk differs between locations
- Next by thread: Re: [PATCH] Use of getblk differs between locations
- Index(es):