From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Snitzer Subject: Re: dm: do not replace bioset for request-based dm Date: Tue, 26 Feb 2013 17:33:25 -0500 Message-ID: <20130226223325.GA31981@redhat.com> References: <512C3EF2.80204@ce.jp.nec.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57802 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756266Ab3BZWdf (ORCPT ); Tue, 26 Feb 2013 17:33:35 -0500 Content-Disposition: inline In-Reply-To: <512C3EF2.80204@ce.jp.nec.com> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: Jun'ichi Nomura Cc: device-mapper development , Jens Axboe , linux-scsi , Mikulas Patocka , Tejun Heo , Alasdair G Kergon , Bart Van Assche On Mon, Feb 25 2013 at 11:49pm -0500, Jun'ichi Nomura wrote: > This patch fixes a regression introduced in v3.8, which causes oops > like this when dm-multipath is used: > > general protection fault: 0000 [#1] SMP > RIP: 0010:[] [] mempool_free+0x24/0xb0 > Call Trace: > > [] bio_put+0x97/0xc0 > [] end_clone_bio+0x35/0x90 [dm_mod] > [] bio_endio+0x1d/0x30 > [] req_bio_endio.isra.51+0xa3/0xe0 > [] blk_update_request+0x118/0x520 > [] blk_update_bidi_request+0x27/0xa0 > [] blk_end_bidi_request+0x2c/0x80 > [] blk_end_request+0x10/0x20 > [] scsi_io_completion+0xfb/0x6c0 [scsi_mod] > [] scsi_finish_command+0xbd/0x120 [scsi_mod] > [] scsi_softirq_done+0x13f/0x160 [scsi_mod] > [] blk_done_softirq+0x80/0xa0 > [] __do_softirq+0xf1/0x250 > [] call_softirq+0x1c/0x30 > [] do_softirq+0x8d/0xc0 > [] irq_exit+0xd5/0xe0 > [] do_IRQ+0x63/0xe0 > [] common_interrupt+0x6f/0x6f > > [] srp_queuecommand+0x8c/0xcb0 [ib_srp] > [] scsi_dispatch_cmd+0x148/0x310 [scsi_mod] > [] scsi_request_fn+0x31e/0x520 [scsi_mod] > [] __blk_run_queue+0x37/0x50 > [] blk_delay_work+0x29/0x40 > [] process_one_work+0x1c3/0x5c0 > [] worker_thread+0x15e/0x440 > [] kthread+0xdb/0xe0 > [] ret_from_fork+0x7c/0xb0 > > The regression was introduced by the change > c0820cf5 "dm: introduce per_bio_data", where dm started to replace > bioset during table replacement. > For bio-based dm, it is good because clone bios do not exist during the > table replacement. > For request-based dm, however, (not-yet-mapped) clone bios may stay in > request queue and survive during the table replacement. > So freeing the old bioset could cause the oops in bio_put(). > > Since the size of front_pad may change only with bio-based dm, > it is not necessary to replace bioset for request-based dm. > > Reported-by: Bart Van Assche > Tested-by: Bart Van Assche > Signed-off-by: Jun'ichi Nomura > Cc: Alasdair G Kergon > Cc: Mikulas Patocka > Cc: Mike Snitzer > Cc: Acked-by: Mike Snitzer