lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 24 May 2012 10:16:09 +0900
From:	"Jun'ichi Nomura" <j-nomura@...jp.nec.com>
To:	Kent Overstreet <koverstreet@...gle.com>
CC:	device-mapper development <dm-devel@...hat.com>,
	linux-kernel@...r.kernel.org, linux-bcache@...r.kernel.org,
	linux-fsdevel@...r.kernel.org, axboe@...nel.dk,
	yehuda@...newdream.net, mpatocka@...hat.com, vgoyal@...hat.com,
	bharrosh@...asas.com, tj@...nel.org, sage@...dream.net,
	agk@...hat.com, drbd-dev@...ts.linbit.com
Subject: Re: [dm-devel] [PATCH v2 02/14] dm: kill dm_rq_bio_destructor

On 05/24/12 09:39, Kent Overstreet wrote:
> On Thu, May 24, 2012 at 09:19:12AM +0900, Jun'ichi Nomura wrote:
>> The destructor may also be called from blk_rq_unprep_clone(),
>> which just puts bio.
>> So this patch will introduce a memory leak.
> 
> Well, keeping around bi_destructor solely for that reason would be
> pretty lousy. Can you come up with a better solution?

I don't have good one but here are some ideas:
  a) Do bio_endio() rather than bio_put() in blk_rq_unprep_clone()
     and let bi_end_io reap additional data.
     It looks ugly.
  b) Separate the constructor from blk_rq_prep_clone().
     dm has to do rq_for_each_bio loop again for constructor.
     Possible performance impact.
  c) Open code blk_rq_prep/unprep_clone() in dm.
     It exposes unnecessary block-internals to dm.
  d) Pass destructor function to blk_rq_prep/unprep_clone()
     for them to callback.

Umm, is "d)" better?
-- 
Jun'ichi Nomura, NEC Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists