lkml.org 
[lkml]   [2010]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] fix mm leakage of block request in SCSI FiberChannel transport
From
When blk_rq_timed_out_timer run, only requests that are not completed
are selected for processing with LLD callback function.

In the case of fc_bsg_job_timeout, if BLK_EH_NOT_HANDLED returned, the
block layer will be signaled to do nothing for the request, but the
request still remains uncompleted since it is already marked with
REQ_ATOM_COMPLETE by the timer function and blk_complete_request()
will check it. Thus mm leakage is triggered.

It is fixed by returning BLK_EH_HANDLED, instead of
BLK_EH_NOT_HANDLED, with warning also recorded.

Thanks all for comments when preparing this work.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--- a/drivers/scsi/scsi_transport_fc.c 2010-11-01 19:54:12.000000000 +0800
+++ b/drivers/scsi/scsi_transport_fc.c 2010-11-24 20:55:12.000000000 +0800
@@ -3626,9 +3626,9 @@ fc_bsg_job_timeout(struct request *req)

/* the blk_end_sync_io() doesn't check the error */
if (done)
- return BLK_EH_NOT_HANDLED;
- else
- return BLK_EH_HANDLED;
+ printk(KERN_WARNING "%s: fixing mm leak...done\n", __func__);
+
+ return BLK_EH_HANDLED;
}

static int

\
 
 \ /
  Last update: 2010-11-25 14:55    [W:0.020 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site