From patchwork Fri Feb 5 03:02:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hansechang@gmail.com X-Patchwork-Id: 8230511 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 002019F6DA for ; Fri, 5 Feb 2016 03:02:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 290E320306 for ; Fri, 5 Feb 2016 03:02:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 77C91202F2 for ; Fri, 5 Feb 2016 03:02:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751792AbcBEDCb (ORCPT ); Thu, 4 Feb 2016 22:02:31 -0500 Received: from mail-pf0-f174.google.com ([209.85.192.174]:36168 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750808AbcBEDCb (ORCPT ); Thu, 4 Feb 2016 22:02:31 -0500 Received: by mail-pf0-f174.google.com with SMTP id n128so60208310pfn.3 for ; Thu, 04 Feb 2016 19:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=+MdUXKesr8NVHf2f9ZfstLZCrAfFO4QDqQjKZ7cmiP0=; b=n/k/9v28YAsrEijqPulpNWF1GSo/FWvhVIOa49IlglyGiiYXSFcUZ7antK7ckW3wKW h7EyHYX3kFdWYApqhV/Wcdb1KfxDCFzfa2L5B2FjN2utBQBI2XXOxWDm6p1PoLkojiU3 r8aXTKCZSMpE43+fGInYDLDbgzR5ii44GdLCe+/RF1sNHjPBjHAwRkM3VjDFxaXd4HEd Z/nVi9JwXjU9JHY+EpPvszW4Cvg4dVwyZeTN5oDG1dTaCuW5Smh3VtSPl3KzChxm5Gze XxyCwqtdXbqglU9IdLY4cZnj87vfRmKSN59w57ovHjOEH5BDGJUOqyDtRGJ53yW1kN9j R8fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+MdUXKesr8NVHf2f9ZfstLZCrAfFO4QDqQjKZ7cmiP0=; b=QaR3S+XrRQKDS97L5KJcD0/awn9KFag8J/pwjQENrHBzIi2PHYGCzfdPD0Mr2H3W4+ H3rQU0JrnDfK53EWiKKennWxM1+bZaIrwaMgRtigb5PWBjefU8L/u7+ZjZTBjtmt1Tsj RafbURcJ4pP3wsV/i7nffTBraW6iRuIB3CtIp/ngKxl3qN3BD0of5hrhu80FFG5QUs89 j8rWcZ77tSKgrQaExQnS60QDz2YWw4I71FrxbvxOCjBkHVFu50VE266kEeC/hTiAYqXV /9SjXye6BbdaKdqKzFEhdAXjphXv2lK+aaKeu70yz+/Z9YZFLMOibzPo3z21TFM3eYwF bsNg== X-Gm-Message-State: AG10YOSkfI6pl43UAP6VWSOsm6wIo2nWp07w9VfqyNr19uep5Gf13BhcFA+35kTRB83mLQ== X-Received: by 10.98.10.65 with SMTP id s62mr16474987pfi.119.1454641350870; Thu, 04 Feb 2016 19:02:30 -0800 (PST) Received: from bogon.hz.ali.com ([202.55.20.10]) by smtp.gmail.com with ESMTPSA id x1sm20203543pfi.42.2016.02.04.19.02.27 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Feb 2016 19:02:30 -0800 (PST) From: hansechang@gmail.com X-Google-Original-From: huaixin.chx@alibaba-inc.com To: axboe@kernel.dk, linux-block@vger.kernel.org Cc: muming.wq@taobao.com, huaixin.chx@alibaba-inc.com, gaoyang.zyh@taobao.com, wenqing.lz@taobao.com, bingtian.ly@taobao.com, boyu.mt@taobao.com, chenggang.qcg@alibaba-inc.com Subject: [PATCH] block: blkg_conf_finish fix module refcount Date: Fri, 5 Feb 2016 11:02:05 +0800 Message-Id: <1454641325-878-1-git-send-email-huaixin.chx@alibaba-inc.com> X-Mailer: git-send-email 2.2.2 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SBL_CSS, RP_MATCHES_RCVD, T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Chang Huaixin Blkg_conf_finish is used after blkg_conf_prep. Blkg_conf_prep calls get_disk and increases module refcount. However, blkg_conf_finish only calls put_disk which doesn't decrease module refcount. So we call module_put here additionally to keep module refcount balanced. Signed-off-by: Chang Huaixin --- block/blk-cgroup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index 5a37188..15cbf36 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c @@ -853,6 +853,7 @@ void blkg_conf_finish(struct blkg_conf_ctx *ctx) { spin_unlock_irq(ctx->disk->queue->queue_lock); rcu_read_unlock(); + module_put(ctx->disk->fops->owner); put_disk(ctx->disk); } EXPORT_SYMBOL_GPL(blkg_conf_finish);