From patchwork Mon Jul 30 21:10:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10549637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6D9D49093 for ; Mon, 30 Jul 2018 21:10:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6035D2A8F2 for ; Mon, 30 Jul 2018 21:10:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 548BB2A8E7; Mon, 30 Jul 2018 21:10:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD9CC2A8F2 for ; Mon, 30 Jul 2018 21:10:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731288AbeG3Wrq (ORCPT ); Mon, 30 Jul 2018 18:47:46 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:3344 "EHLO esa5.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731047AbeG3Wrq (ORCPT ); Mon, 30 Jul 2018 18:47:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1532985058; x=1564521058; h=from:to:cc:subject:date:message-id; bh=7WJCr6GoZUePRsjTboTLm8q99eVNIdYzijBDUiocbMM=; b=dMHJx3kF4a1ECKUEIyd6Mz/ofFhe7olv5HVU0kaJ58WazUl9KC5pKRlD 4qONEie9P/ysInM/H0DsPkxZ2Mi8li7xOkZOyNJbj+qSIP54oIKOa8Q81 FOR1qx6rIbrfQxCAvT9c6sC27dxt+dom9m/7jPs4TC03VI1TbLMfEKh+A /a0stOLe6fqkLrG83cnJJvJcLUNgm4D09t7p7Dou5mP69SEFIlA7TLsij 0Yohqx/3t+sSUPq+nJVzlZ6tBrISgM5TCjYdBlcVJuAT3L99AWqHkoJZI QA+T2xFiXk7h6yfOdv1qsUUYdvt2OAlVm/9Tst9GUxqwtGXZTrqTPrgkv A==; X-IronPort-AV: E=Sophos;i="5.51,424,1526313600"; d="scan'208";a="86324941" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 31 Jul 2018 05:10:57 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP; 30 Jul 2018 13:59:25 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 30 Jul 2018 14:10:56 -0700 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche Subject: [PATCH v4 0/2] Ensure that a request queue is dissociated from the cgroup controller Date: Mon, 30 Jul 2018 14:10:54 -0700 Message-Id: <20180730211056.18570-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello Jens, Several block drivers call alloc_disk() followed by put_disk() if something fails before device_add_disk() is called without calling blk_cleanup_queue(). Make sure that also for this scenario a request queue is dissociated from the cgroup controller. This patch avoids that loading the parport_pc, paride and pf drivers trigger a kernel crash. Since this patch series fixes a regression, please consider these patches for kernel v4.19. Thanks, Bart. Changes between v3 and v4: - Added "Cc: stable" tags. Changes between v2 and v3: - Avoid code duplication by introducing a new helper function. Changes between v1 and v2: - Fixed the build for CONFIG_BLK_CGROUP=n. Bart Van Assche (2): block: Introduce blk_exit_queue() block: Ensure that a request queue is dissociated from the cgroup controller block/blk-core.c | 54 ++++++++++++++++++++++++++--------------------- block/blk-sysfs.c | 25 ++++++++++++++++++++++ block/blk.h | 1 + 3 files changed, 56 insertions(+), 24 deletions(-)