[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [dm-devel] [PATCH] scsi: address leak in the error path of discard page allocation
- From: Christoph Hellwig <hch lst de>
- To: Mike Snitzer <snitzer redhat com>
- Cc: axboe kernel dk, linux-scsi vger kernel org, linux-kernel vger kernel org, FUJITA Tomonori <fujita tomonori lab ntt co jp>, dm-devel redhat com, James Bottomley suse de, hch lst de
- Subject: Re: [dm-devel] [PATCH] scsi: address leak in the error path of discard page allocation
- Date: Fri, 2 Jul 2010 12:48:24 +0200
On Thu, Jul 01, 2010 at 09:03:28AM -0400, Mike Snitzer wrote:
> On Thu, Jul 01 2010 at 6:49am -0400,
> FUJITA Tomonori <fujita tomonori lab ntt co jp> wrote:
>
> > This fixes discard page leak by using q->unprep_rq_fn facility.
> >
> > q->unprep_rq_fn is called when all the data buffer (req->bio and
> > scsi_data_buffer) in the request is freed.
> >
> > sd_unprep() uses rq->buffer to free discard page allocated in
> > sd_prepare_discard().
> >
> > Signed-off-by: FUJITA Tomonori <fujita tomonori lab ntt co jp>
>
> Thanks for sorting this out Tomo, all 3 patches work great!
>
> BTW, there is one remaining (rare) leak in the allocation path.
>
> The following patch serves to fix it but I'm not sure if there is a more
> elegant way to address this.
>
> An alternative would be to check if the page is already allocated
> (before allocating the page in scsi_setup_discard_cmnd)?
Ah, should have read your mail first, sorry..
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]