From patchwork Tue Mar 22 10:26:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 600559 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3qTpmt0Tzjz9s3s; Tue, 22 Mar 2016 21:27:58 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1aiJXW-0008CM-W3; Tue, 22 Mar 2016 10:27:54 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1aiJVm-00075Q-NB for kernel-team@lists.ubuntu.com; Tue, 22 Mar 2016 10:26:06 +0000 Received: from av-217-129-130-179.netvisao.pt ([217.129.130.179] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1aiJVm-0008Hd-AZ; Tue, 22 Mar 2016 10:26:06 +0000 From: Luis Henriques To: Jianjian Huo Subject: [3.16.y-ckt stable] Patch "bcache: add mutex lock for bch_is_open" has been added to the 3.16.y-ckt tree Date: Tue, 22 Mar 2016 10:26:05 +0000 Message-Id: <1458642365-2604-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.16 Cc: Kamal Mostafa , kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com This is a note to let you know that I have just added a patch titled bcache: add mutex lock for bch_is_open to the linux-3.16.y-queue branch of the 3.16.y-ckt extended stable tree which can be found at: http://kernel.ubuntu.com/git/ubuntu/linux.git/log/?h=linux-3.16.y-queue This patch is scheduled to be released in version 3.16.7-ckt26. If you, or anyone else, feels it should not be added to this tree, please reply to this email. For more information about the 3.16.y-ckt tree, see https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable Thanks. -Luis ---8<------------------------------------------------------------ From a442f692f42dedba3aa24c899684fd51bf61c585 Mon Sep 17 00:00:00 2001 From: Jianjian Huo Date: Sun, 13 Jul 2014 09:08:59 -0700 Subject: bcache: add mutex lock for bch_is_open commit 789d21dbd9d8889e62c79ec19585fcc97e42ef07 upstream. Since bch_is_open will iterate linked list bch_cache_sets and uncached_devices, it needs bch_register_lock. Signed-off-by: Jianjian Huo Cc: Kamal Mostafa [ luis: backported to 3.16: adjusted context ] Signed-off-by: Luis Henriques --- drivers/md/bcache/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 72e660cafadd..70db24e41947 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1950,10 +1950,12 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr, if (IS_ERR(bdev)) { if (bdev == ERR_PTR(-EBUSY)) { bdev = lookup_bdev(strim(path)); + mutex_lock(&bch_register_lock); if (!IS_ERR(bdev) && bch_is_open(bdev)) err = "device already registered"; else err = "device busy"; + mutex_unlock(&bch_register_lock); if (attr == &ksysfs_register_quiet) goto out; }