[dm-devel] [PATCH 1/2] block: fix leaks associated with discard request payload

Christoph Hellwig hch at lst.de
Sun Jun 27 09:38:23 UTC 2010


On Sat, Jun 26, 2010 at 03:56:50PM -0400, Mike Snitzer wrote:
> Fix leaks introduced via "block: don't allocate a payload for discard
> request" commit a1d949f5f44.
> 
> sd_done() is not called for REQ_TYPE_BLOCK_PC commands so cleanup
> discard request's payload directly in scsi_finish_command().
> 
> Also cleanup page allocated for discard payload in
> scsi_setup_discard_cmnd's scsi_setup_blk_pc_cmnd error path.

This looks good - I've tested an equivalent patch doing xfstests runs
for more than 24hours now without seeing leaks.

On the long run I'd prefer not having the knowledge of the payload
freeing inside the core scsi code, but that requires either calling
->done for block pc requests, or treating discards as fs requests all
the way, which will require much larger changes.

So for now:


Reviewed-by: Christoph Hellwig <hch at lst.de>




More information about the dm-devel mailing list