From patchwork Thu Aug 9 14:53:35 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: 10561509 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 5DD821057 for ; Thu, 9 Aug 2018 14:53:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C8592B560 for ; Thu, 9 Aug 2018 14:53:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A32E2B5B3; Thu, 9 Aug 2018 14:53:55 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B3F3D2B560 for ; Thu, 9 Aug 2018 14:53:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732387AbeHIRTI (ORCPT ); Thu, 9 Aug 2018 13:19:08 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:46407 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732370AbeHIRTI (ORCPT ); Thu, 9 Aug 2018 13:19:08 -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=1533826432; x=1565362432; h=from:to:cc:subject:date:message-id:mime-version; bh=08/th52srYw+7q4FiEwyxCOZOR6eZuaXk6uB/rHEy0s=; b=Whh2i4eLzv5uAWsqvVwo36XrTjMiyjnym1i5BU4MYtfxBO5czovXvBDb 8TZw8kf5o7xVA11iDSYCJh+xhaRGE3LHZ8YtieGfLcVjNVBpYY/MfJJ8V YAXrQSGH3eOVHUnEyq0BGqEt2VR0/sbT9qXq7Eo+EnLB9McVB2RvQVqvT rIKSCUhJD1RKHm7LFvJEUp2ZnHIW1CkXaRXZg1NeJnJ39vag6j1uCPizi yRaT+w8lTkE6/HCQTnSpxmK+XG3DrsuYaduIP4hR+TK8KfXHG8wF3hlUe zQBnwULJduyb0wpGrdm0Pvu+or1Ip9zaMRfJjj5EEiQNkeEHOF4C1Dq5L A==; X-IronPort-AV: E=Sophos;i="5.53,215,1531756800"; d="scan'208";a="191096196" Received: from mail-bn3nam01lp0182.outbound.protection.outlook.com (HELO NAM01-BN3-obe.outbound.protection.outlook.com) ([216.32.180.182]) by ob1.hgst.iphmx.com with ESMTP; 09 Aug 2018 22:53:52 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oUBejXfqWN4AB2VQ8e4+OjywZzeX/FAxc1EmUXxheC8=; b=CAPUpVqdpgPeTZhVxfu/INJDGBFban3uwYUOFIR3mWLHVLGKeVg1EP1jx6bY0iAC13MoKu5WfTnM7HsONIMbY14XhkkhVELEbjBxi8Nc5riFJAEHLfwFMGCn8IkTnU2FqU30uVJ9r7zi+LkX8vGqz4dZqxyYWYO1ugJkA/SCigI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Bart.VanAssche@wdc.com; Received: from asus.hsd1.ca.comcast.net (174.62.111.89) by DM5PR04MB1196.namprd04.prod.outlook.com (2603:10b6:3:a3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.17; Thu, 9 Aug 2018 14:53:50 +0000 From: Bart Van Assche To: Jens Axboe Cc: linux-block@vger.kernel.org, Christoph Hellwig , Bart Van Assche Subject: [PATCH v5 0/3] Ensure that a request queue is dissociated from the cgroup controller Date: Thu, 9 Aug 2018 07:53:35 -0700 Message-Id: <20180809145338.6160-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [174.62.111.89] X-ClientProxiedBy: MWHPR15CA0072.namprd15.prod.outlook.com (2603:10b6:301:4c::34) To DM5PR04MB1196.namprd04.prod.outlook.com (2603:10b6:3:a3::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86f72231-ebd3-4829-7927-08d5fe07eb3b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:DM5PR04MB1196; X-Microsoft-Exchange-Diagnostics: 1;DM5PR04MB1196;3:9YcfzQWlcNqv5sNNDnARahJiQjfPSbfqS1d1FEKfalfZ33v/1r/nwyZOHDWe7Av3p3MtEq2K1Xymp0/hlrMD99ptjE6q7Dd4rKk65yShlShPjAwoRD9wRBJPWo2enAc7/mXJrC/DvfQMISf+1kcsOY+k6tesbTj6nBxu/oXZ/asiOEB3FYOvuUfxaDxOppQ61E1nq/pa/Kn7fQUuomp/n2EGA7fk/LiDSgq3WJ+dcZqSMzGHORLdTDNkTUJEHvO5;25:3Qv/yTMQuti5l4skxDeiadFYIVhTeCJiThsrpYnwnkrp59pBBBWV2hJBkIz/Upn0tIscLUrT5708dPRLa+Ou5G8Xy1kIT3HG8DjkcLuktopz4YUg8l0bCXsPCtbJ/BH2pK73JEOCt5Ip+Fcmfj3chS0OQl/0Ek8hJAI5lWcfOZHyNRHolbhhdvN7Bj+TsXtx6fP9jvLVlHF6EKb8cvTqBWGCPawtscNlnKdET0H/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TBujLcOf8H6t4whsSGvtjRfkuhSqPY3bMxSOIq+PpUWKb9Km2pcmKCl/lR6DWQ+OP8aQOErszKSGQwdPQkmApPvilna8EahzB4Ng+4829p5+ZT/Lqo8e/Qcq9STq2uq5bpmVwE8+9aQXLL2I2LgmXLJH6W+jTgg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231311)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:DM5PR04MB1196;BCL:0;PCL:0;RULEID:;SRVR:DM5PR04MB1196; X-Forefront-PRVS: 0759F7A50A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(376002)(366004)(136003)(346002)(39860400002)(199004)(189003)(54906003)(486006)(956004)(16526019)(316002)(2906002)(86362001)(48376002)(52116002)(81156014)(66066001)(476003)(2616005)(81166006)(16586007)(386003)(6506007)(51416003)(6512007)(36756003)(26005)(305945005)(7736002)(8676002)(105586002)(186003)(53936002)(6486002)(50226002)(3846002)(6116002)(5660300001)(8936002)(14444005)(47776003)(68736007)(1076002)(4326008)(25786009)(6666003)(6916009)(478600001)(97736004)(50466002)(72206003)(106356001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR04MB1196;H:asus.hsd1.ca.comcast.net;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM5PR04MB1196;23:+IiUo5EQnBxagUs93j96444pdcfF0ms8jDtB9uvo42Zfh8hgAeFub4bTCG868PWSe+ErssdjuQM3YMKGE/NPda54b6ramjFOvTLXERINV3McvSmjSf/lXIfVV2CwMOSdJVQ+VBi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krcVQesdGqpBfzyjnBrBtcr79vlgIBWnXEvaajW8fZ5PXEGNy1twjn6OG4T2RPUAYcunaiYfDVoHJ+uLTimm51PV9rsYafARSfNyL62p84kExtymN9TUDgM0slZmsB+5YHgBVSCv8t7/ZVgNIASnqALCZe0VMPW+sgV3TXqk9v+Ju3cg7jU9QCbz1DWxKCCflZAOkv7oQ/bv9k4wQ+TQhTp5o/7bB6AtA3OH5wdfF6ptIwQH2cyd SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR04MB1196;20:slmSd8tS4xSYkdQTlHzvnm8rgBEnpgdqRk54/OMog5eQIE9WWPEaDzJrDSZ00YHNWt9xZMKQ7ze5PyJrfdzFW0E++UD0JYjeEKGEBz3cGywbWNPs3hQ8Z5t3UmkPh7EGUnEcbr7JwcC5JX+eRT87ljT0zLKXKwtwCHhHP4uCKPo= X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2018 14:53:50.3343 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86f72231-ebd3-4829-7927-08d5fe07eb3b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR04MB1196 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 v4 and v5: - Instead of using #ifdef CONFIG_CGROUP / #endif, introduced a new function in the cgroups code. 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 (3): blkcg: Introduce blkg_root_lookup() 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 | 15 +++++++++++ block/blk.h | 1 + include/linux/blk-cgroup.h | 18 +++++++++++++ 4 files changed, 64 insertions(+), 24 deletions(-)