From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758928AbZBLNth (ORCPT ); Thu, 12 Feb 2009 08:49:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756643AbZBLNt1 (ORCPT ); Thu, 12 Feb 2009 08:49:27 -0500 Received: from gw-ca.panasas.com ([66.104.249.162]:29891 "EHLO laguna.int.panasas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756825AbZBLNt0 (ORCPT ); Thu, 12 Feb 2009 08:49:26 -0500 Message-ID: <499428E1.1000009@panasas.com> Date: Thu, 12 Feb 2009 15:49:21 +0200 From: Boaz Harrosh User-Agent: Thunderbird/3.0a2 (X11; 2008072418) MIME-Version: 1.0 To: jens.axboe@oracle.com, James.Bottomley@HansenPartnership.com, FUJITA Tomonori CC: linux-scsi@vger.kernel.org, linux-kernel Subject: Re: [PATCH] [RFC] block: Don't let blk_put_request leak BIOs References: <4993DCCA.8080508@panasas.com> <20090212174124S.fujita.tomonori@lab.ntt.co.jp> <4993E85A.20805@panasas.com> <20090212184208X.fujita.tomonori@lab.ntt.co.jp> <499413DB.2020208@panasas.com> In-Reply-To: <499413DB.2020208@panasas.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Feb 2009 13:49:24.0550 (UTC) FILETIME=[B6FC7660:01C98D18] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Boaz Harrosh wrote: > If a block ULD had allocated a request and mapped some memory into it, > using one of blk_rq_map_xxx routines, but then for some reason failed to > execute the request through one of the blk_execute_request routines. > Then the associated BIO would leak, unless ULD resorts to low-level loops > intimate of block internals. > > [RFC] > This code will also catch situations where LLD failed to complete > the request before aborting it. Such situations are a BUG. Should we > use WARN_ON_ONCE() in that case. The situation above is possible and > can happen normally in memory pressure situations so maybe we should > devise a bit-flag that ULD denotes that the request was aborted and > only WARN_ON if flag was not set. > > I'm sending this before any-tests so people can comment on possible > pitfalls. > > Signed-off-by: Boaz Harrosh > --- I've booted a Linux PC with lots of sata disks, connected an iscsi target, ran OSD tests. It looks like it's working which means request->bio is set to NULL after it is used in the regular path. This needs to sit in Linux next and be tested for a long while. Jens I'll be waiting for your comment and will send a proper patch for the block bits. We will have to time this with James to see when the OSD bits can be submitted after that, then TOMO's patch for un-exporting blk_req_append_bio can be merged. Or maybe it can all go in one patch through scsi? Thanks Boaz