From patchwork Tue Mar 28 23:12:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9650629 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3B6BA601D7 for ; Tue, 28 Mar 2017 23:13:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BE132844E for ; Tue, 28 Mar 2017 23:13:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 20C3F28452; Tue, 28 Mar 2017 23:13:41 +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=-6.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 D45882844E for ; Tue, 28 Mar 2017 23:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932242AbdC1XNl (ORCPT ); Tue, 28 Mar 2017 19:13:41 -0400 Received: from mail-pg0-f45.google.com ([74.125.83.45]:34764 "EHLO mail-pg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932088AbdC1XNk (ORCPT ); Tue, 28 Mar 2017 19:13:40 -0400 Received: by mail-pg0-f45.google.com with SMTP id 21so85758699pgg.1 for ; Tue, 28 Mar 2017 16:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=jqxdLpjtSyty/gHs7JBIpFjlOoSjVZmFMVFr5LUQMIU=; b=kXfRfb6bYQloeqIrfSEOwynIJHb7JECuJopRDYX06HuhZXmPVsop73y2LiFrR4PiMb Hpm7HiTZC8nuuw3uujmsXR505PlT3sn+KVU+prtmpMldbBEft6pbF2e8AqttFJJyxbjN xGJKcZL+HQ2RaGbiI+AKZY3JsceDNNUIGeDlRy0QHAfdKMlpY0WfFi3PTk7IOdPsU+DM ESd7Yyi8GuybklNIUa79H75MohKDMEyTm74GW5bMWbJV7gwQGDOaR8FJQhkRR7N0mMgc UvwBBN08KZACqo+9Gxqfu6Yf06S1sOUuckno2l/G1g17TePMyDganGexCHTbJ1Wmr3F1 UUUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=jqxdLpjtSyty/gHs7JBIpFjlOoSjVZmFMVFr5LUQMIU=; b=aPN84oWMo88T38EIOvVHyEQ30BNQ3PMnFiH3GN6JchTCUr2KlR8sjfWjgEt8wWX7z/ q2fUmva1LwYhhT34IjnSuucxuYVpdclZBrhWqR8p45v0LgG8lAK6YJ30pqjpqzDiQStV NG81HABPME7ri2LA0tYvaUyZwM/f8ugFd4myB1uJCNHRV4entVxslFYhcRHNA2bwGyWR rndmVVaZDPin/lCsNMmwaVdW7w28o0xGXRBIw5UQmREVY3ybSfVJFFFSEYvsWg99YF87 ULmnw0LiCmJJe6HG4xohqFAeta+Z6vXcFKuyzNoL0mK2ajS7PHdAC7l9UUoXYLPRlIE8 c6Cg== X-Gm-Message-State: AFeK/H2iK2tpiy28Z7BolFpKogQhRNXmLbm0Bgd9hESGClZjIwszV9RovR2jpD39BExG3eKJ X-Received: by 10.84.210.167 with SMTP id a36mr38656301pli.40.1490742795016; Tue, 28 Mar 2017 16:13:15 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:200::a:d601]) by smtp.gmail.com with ESMTPSA id l9sm9289812pfi.97.2017.03.28.16.13.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Mar 2017 16:13:14 -0700 (PDT) From: Omar Sandoval To: Jens Axboe , linux-block@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH v2 2/3] blk-mq: fix leak of q->stats Date: Tue, 28 Mar 2017 16:12:16 -0700 Message-Id: <0c03f37f5c643eda28a3f1368425c55e407e3ffd.1490742717.git.osandov@fb.com> X-Mailer: git-send-email 2.12.1 In-Reply-To: <91d938665e5386f10f8756ee8c7ef3e6496ea260.1490742717.git.osandov@fb.com> References: <91d938665e5386f10f8756ee8c7ef3e6496ea260.1490742717.git.osandov@fb.com> In-Reply-To: <91d938665e5386f10f8756ee8c7ef3e6496ea260.1490742717.git.osandov@fb.com> References: <91d938665e5386f10f8756ee8c7ef3e6496ea260.1490742717.git.osandov@fb.com> 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 From: Omar Sandoval blk_alloc_queue_node() already allocates q->stats, so blk_mq_init_allocated_queue() is overwriting it with a new allocation. Fixes: a83b576c9c25 ("block: fix stacked driver stats init and free") Reviewed-by: Ming Lei Signed-off-by: Omar Sandoval --- block/blk-mq.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 7df9dbfab022..00eeef31db30 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2212,10 +2212,6 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, /* mark the queue as mq asap */ q->mq_ops = set->ops; - q->stats = blk_alloc_queue_stats(); - if (!q->stats) - goto err_exit; - q->poll_cb = blk_stat_alloc_callback(blk_mq_poll_stats_fn, blk_stat_rq_ddir, 2, q); if (!q->poll_cb)