From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755054Ab1GLBXJ (ORCPT ); Mon, 11 Jul 2011 21:23:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:25010 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751363Ab1GLBXH (ORCPT ); Mon, 11 Jul 2011 21:23:07 -0400 Date: Mon, 11 Jul 2011 21:22:06 -0400 From: Mike Snitzer To: Alan Stern Cc: Roland Dreier , Jens Axboe , James Bottomley , Heiko Carstens , linux-scsi@vger.kernel.org, Steffen Maier , "Manvanthara B. Puttashankar" , Tarak Reddy , "Seshagiri N. Ippili" , linux-kernel@vger.kernel.org, device-mapper development , Vivek Goyal , Tejun Heo , jaxboe@fusionio.com Subject: Re: block: Check that queue is alive in blk_insert_cloned_request() Message-ID: <20110712012206.GA30690@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 11 2011 at 8:52pm -0400, Alan Stern wrote: > On Mon, 11 Jul 2011, Mike Snitzer wrote: > > > [cc'ing dm-devel, vivek and tejun] > > > > On Fri, Jul 8, 2011 at 7:04 PM, Roland Dreier wrote: > > > From: Roland Dreier > > > > > > This fixes crashes such as the below that I see when the storage > > > underlying a dm-multipath device is hot-removed. ?The problem is that > > > dm requeues a request to a device whose block queue has already been > > > cleaned up, and blk_insert_cloned_request() doesn't check if the queue > > > is alive, but rather goes ahead and tries to queue the request. ?This > > > ends up dereferencing the elevator that was already freed in > > > blk_cleanup_queue(). > > > > Your patch looks fine to me: > > Acked-by: Mike Snitzer > > There's still the issue that Stefan Richter pointed out: The test for a > dead queue must be made _after_ acquiring the queue lock, not _before_. Yes, quite important. Jens, can you tweak the patch or should Roland send a v2?