Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752215AbcJJNZr (ORCPT ); Mon, 10 Oct 2016 09:25:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33290 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752376AbcJJNZo (ORCPT ); Mon, 10 Oct 2016 09:25:44 -0400 Date: Mon, 10 Oct 2016 09:25:42 -0400 From: Mike Snitzer To: Tahsin Erdogan Cc: Alasdair Kergon , dm-devel@redhat.com, Shaohua Li , linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: dm: free io_barrier after blk_cleanup_queue call Message-ID: <20161010132542.GA17958@redhat.com> References: <1476102919-25112-1-git-send-email-tahsin@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476102919-25112-1-git-send-email-tahsin@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 10 Oct 2016 13:25:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 776 Lines: 18 On Mon, Oct 10 2016 at 8:35am -0400, Tahsin Erdogan wrote: > dm_old_request_fn() has paths that access md->io_barrier. The party > destroying io_barrier should ensure that no future execution > of dm_old_request_fn() is possible. Move destruction to below > blk_cleanup_queue() to ensure this. I have to believe this was born out of code inspection rather than actual need (due to crash, etc)? The cleanup order isn't relevant. The reference counting of a DM device governs whether a DM device (and its associated 'struct mapped_device') can be destroyed. Please have a look at __dm_destroy, particularly: * No one should increment the reference count of the mapped_device, * after the mapped_device state becomes DMF_FREEING. Mike