[<prev] [next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=08YvR9O7c7+asB3d-PkguutKepFZfUbCXmYZR@mail.gmail.com>
Date: Thu, 25 Nov 2010 21:53:05 +0800
From: Hillf Danton <dhillf@...il.com>
To: linux-scsi@...r.kernel.org
Cc: Joe Eykholt <jeykholt@...co.com>,
Robert Love <robert.w.love@...el.com>,
Mike Christie <michaelc@...wisc.edu>,
"James E.J. Bottomley" <James.Bottomley@...e.de>,
devel@...n-fcoe.org, linux-kernel@...r.kernel.org
Subject: [PATCH] fix mm leakage of block request in SCSI FiberChannel transport
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@...il.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
--
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