From patchwork Thu Dec 6 17:49:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dennis Zhou X-Patchwork-Id: 10716529 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 DAE8517D5 for ; Thu, 6 Dec 2018 17:49:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C54FA2EF7D for ; Thu, 6 Dec 2018 17:49:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5A5E2EFF1; Thu, 6 Dec 2018 17:49: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.9 required=2.0 tests=BAYES_00,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 6D7B22EF7D for ; Thu, 6 Dec 2018 17:49:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725907AbeLFRtw (ORCPT ); Thu, 6 Dec 2018 12:49:52 -0500 Received: from mail-yb1-f193.google.com ([209.85.219.193]:44193 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725871AbeLFRtw (ORCPT ); Thu, 6 Dec 2018 12:49:52 -0500 Received: by mail-yb1-f193.google.com with SMTP id j145so1076121ybg.11; Thu, 06 Dec 2018 09:49:51 -0800 (PST) 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; bh=s2I4+XiKGymX1GJhBaczK+dUn/gC4npGb++LfKSs/JA=; b=UdxkzWsxtHHqpBqe5KUaQrA1G2I/GQFCs/nWu5QzVodRMhb0MhxtfCx6HB29ZnkLy0 xmvC0kjYRz4sD156/fhU1/hir8S+/gO8l1kxhs/PCsTAsS1msvBH5Twv0o3l96dCSp3I EsAeKDcl80M+JQyvVcZBNIQiULtyTrb41tNPMuF5p9XqoMzFpatPYFFWrlLxcBV13bBQ tYhHkUiQEr2u8prjfCJDulHR+NvL/Tm3tFJGcYljB2QRIYYg7WHVPZLgUfYA9B/UnvTM JB93PTmoBavnU/3OsRk8oLJK13m7ghFt5hoQQvWGzD/GrxP4FHr9s6DbG1ZdQ5JVi3Ku ydCQ== X-Gm-Message-State: AA+aEWbXttP0P3YOD2o9OoBSuUoCP1MmTfeJO2jFRdHMnQd2JGZS5Wm5 SP0LsGjZoMCnjW8M2DN4L1pd+IvSvx4= X-Google-Smtp-Source: AFSGD/VVZ0nrOPEWSSJcm9wJ2EszCJIzNmMffSRjVNnj+K1nGLngnUexpI6vkN4hPTyYGUdopdYn8w== X-Received: by 2002:a5b:28e:: with SMTP id x14-v6mr28221226ybl.238.1544118591409; Thu, 06 Dec 2018 09:49:51 -0800 (PST) Received: from dennisz-mbp.thefacebook.com ([199.201.65.135]) by smtp.gmail.com with ESMTPSA id u81sm228853ywf.6.2018.12.06.09.49.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Dec 2018 09:49:50 -0800 (PST) From: Dennis Zhou To: Jens Axboe , Tejun Heo , Johannes Weiner , Josef Bacik Cc: kernel-team@fb.com, linux-block@vger.kernel.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Dennis Zhou Subject: [PATCH] blkcg: put back rcu lock in blkcg_bio_issue_check() Date: Thu, 6 Dec 2018 12:49:38 -0500 Message-Id: <20181206174938.2326-1-dennis@kernel.org> X-Mailer: git-send-email 2.13.5 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 I was a little overzealous in removing the rcu_read_lock() call from blkcg_bio_issue_check() and it broke blk-throttle. Put it back. Fixes: e35403a034bf ("blkcg: associate blkg when associating a device") Signed-off-by: Dennis Zhou --- include/linux/blk-cgroup.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index 752de1becb5c..bf13ecb0fe4f 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h @@ -764,6 +764,8 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, struct blkcg_gq *blkg; bool throtl = false; + rcu_read_lock(); + if (!bio->bi_blkg) { char b[BDEVNAME_SIZE]; @@ -791,6 +793,7 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, blkcg_bio_issue_init(bio); + rcu_read_unlock(); return !throtl; }