Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp6051158ybp; Tue, 15 Oct 2019 08:54:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyaJAbNHWcnSGzLlhdSxCOIg7hxt4pSDlQhHf9d80lBFSTO19zamGSCfeEB/RZgk2U9/0Pa X-Received: by 2002:a50:d794:: with SMTP id w20mr34437993edi.258.1571154864300; Tue, 15 Oct 2019 08:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571154864; cv=none; d=google.com; s=arc-20160816; b=Jewep3cxCErZiKZNY+WNf+p56uQfRUd8w586Rjo1WeJAlvLFRvsVdktwqgs+B7TxFd jPQ48uvPd04Rz2DGY5x1OlhcQCAoMFTXB17TkEtuui7Cm8sQrZG8ueLjFzClRE5ZQ+HQ ULPXM50VI8ujydrnrzC+M/UE5TciWHNDf37iQGWz8sERF+vMDFDvLqsBy/dtZcs7H+kV CdhNVZklFPBvCu1u2A3eLkHJlXkzgxxascWMhav2ZjqLh3GeCSGeiK8fO3HP48NqhfdP DWCrx4MhcPev8aj7PIKrfxk3nVzlJoa6IjhtbRqLOxCmezJ0S5zZzuvuo2DrbrDpI6jf +kDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=klz9XF0n5Dx23te5u1HbHnrUpRLcGEesCFK6Z+SLWew=; b=dwv5HQoW0OlwWZwluC+BnntPfWG7/ZoUEm7RX4Kx0RKa1IlIuYPPOqbPBE3Dy8+wa9 Ex9y2AIicC8njw0wjLEKhEN4v8ixeJbIY7Zi7ZIrfUQX7ogERIiA4cNnTiz9zkzJn507 DDYGyp6GLpm+JTYGG7Fp2m1twOJQg7rQnQ3ku+e2tdwV6XYLe50m79G/REv+qltQGKKT TdZ/hRzm4Z+MZzcymIPAnm7i/OFTpBW5CvQePuwGvbu4YGgoqIcnbVCnkdU11Rzh8lyO AZKp/91j5pF3Aj6W2/6ODDxH4vyiOuGjwadSnrjDEkvbwJHRqlvuFBVMY2zLo96+byJo U4pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=RQsjMM+K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g23si12431377ejm.398.2019.10.15.08.53.52; Tue, 15 Oct 2019 08:54:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=RQsjMM+K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732684AbfJOPwP (ORCPT + 99 others); Tue, 15 Oct 2019 11:52:15 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:39211 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727478AbfJOPwO (ORCPT ); Tue, 15 Oct 2019 11:52:14 -0400 Received: by mail-io1-f68.google.com with SMTP id a1so47078316ioc.6 for ; Tue, 15 Oct 2019 08:52:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=klz9XF0n5Dx23te5u1HbHnrUpRLcGEesCFK6Z+SLWew=; b=RQsjMM+K2avoCN2xnMldLxkHX7TbdffiFc5gI1gcqH/ZDCgLqQOzoCqBXsrSLn0ccs kzpIPB6AKSN2uKUfLsDq6nqdtkmRf9sTTYDkN4Kv8noVSsSqKTlUysCm3pzpugnWV+aV Ky2t7co7bQCPAnDE+zzzPIxTdO2v2aq4gSU4jC3XbF49DXa+Rt9d4L8w9ob2qYicTgOI J4j59x2+VIQUq1pmXulJOS0pcZgSNXG7MXqipG48Yuvs9okrOepGruMX1A5nLnpU9OOO Z35ZlxRdOs2IHy0stMoExM2RMUnLjXoaXc4tRmbqxoSWK+SrBUyDQPLxCes+Kzhou6ac zIWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=klz9XF0n5Dx23te5u1HbHnrUpRLcGEesCFK6Z+SLWew=; b=OGaMLQEj0MshE8HZarCeP9HRPUs0s9wT1osN+lY3U8Yjp7iDaKKCNaiBtpGtXQHsZb MLQu/iuhkaTPof48Dc34JJnZ4wKTp24mdCOZwwGT+M97q9zQRL8K9dFNYShftfBw/He7 WX+qcLMy2QCXxZUV6hdh9VwJT4AhxM2i3QUTTyQBlEUXLgH60y5gDGxFgf26jtdwVCBC pxqrD59DAureQwhFAGlGc7Y96UCCpWEX/L5QGmnKXQWP0JwfAZuUdmKQRpszxzj+ByA8 gN84Jv3FpWaBe+Ou7HYrc47pZtzv1ZkcS4WBYZolRjEBoHHe2iCpKOFoIJAJd4OGmPt2 l6Pg== X-Gm-Message-State: APjAAAXgOb3x65FzgXcgiyJUkE6N4mXYQugz+tH+wrp2T1oQxEeai3Un hlypYTcvFiA+T23PR/qAtrWlpw== X-Received: by 2002:a92:5f4c:: with SMTP id t73mr6801457ilb.220.1571154733938; Tue, 15 Oct 2019 08:52:13 -0700 (PDT) Received: from [192.168.1.159] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id q17sm2582994ile.5.2019.10.15.08.52.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Oct 2019 08:52:13 -0700 (PDT) Subject: Re: [PATCH block/for-linus] blkcg: fix botched pd_prealloc error handling in blkcg_activate_policy() To: Tejun Heo , Julia Lawall Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, linux-block@vger.kernel.org References: <20191015154827.GK18794@devbig004.ftw2.facebook.com> From: Jens Axboe Message-ID: <07cbc404-65db-b236-9ae2-558197b8cdb6@kernel.dk> Date: Tue, 15 Oct 2019 09:52:12 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191015154827.GK18794@devbig004.ftw2.facebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/15/19 9:48 AM, Tejun Heo wrote: > While fixing ->pd_alloc_fn() bug, ab94b0382d81 ("blkcg: Fix > ->pd_alloc_fn() being called with the wrong blkcg on policy > activation") broke the pd_prealloc error handling. > > * pd's were freed using kfree(). They should be freed with > ->pd_free_fn(). > > * pd_prealloc could be kfree()'d and then ->pd_free_fn()'d again. > > * When GFP_KERNEL allocation fails, pinned_blkg wasn't put. > > There are also a couple existing issues. > > * Each pd is initialized as they get allocated. If alloc fails, the > policy will get freed with pd's initialized on it. > > * After the above partial failure, the partial pds are not freed. > > This patch fixes all of the above issues. I dropped the other one, do you mind sending a folded patch? -- Jens Axboe