[3.16.y-ckt stable] Patch "bcache: add mutex lock for bch_is_open" has been added to the 3.16.y-ckt tree
Luis Henriques
luis.henriques at canonical.com
Tue Mar 22 10:26:05 UTC 2016
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 <samuel.huo at gmail.com>
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 <samuel.huo at gmail.com>
Cc: Kamal Mostafa <kamal at canonical.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
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;
}
More information about the kernel-team
mailing list