Skip to contentSkip to conversation

bcache: not exposing userspace interface until ready

PATCH New Liang Chen 1 participant 1 message Jul 5, 2017 bcache (block layer cache)

lore
Share & tools
lore

Liang Chen

author
#0 lore raw

PATCH 1/1 bcache: not exposing userspace interface until ready

As Coly pointed out, bcache_exit() may not be able to handle all the references properly, if userspace registers cache and backing devices right before bch_debug_init and bch_debug_init failes later.

---
 drivers/md/bcache/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/bcache/super.c +2 -2
index 2a5c38c..c74f7d8 100644
@@ -2104,9 +2104,9 @@ static int __init bcache_init(void)
 
 	if (!(bcache_wq = alloc_workqueue("bcache", WQ_MEM_RECLAIM, 0)) ||
 	    !(bcache_kobj = kobject_create_and_add("bcache", fs_kobj)) ||
-	    sysfs_create_files(bcache_kobj, files) ||
 	    bch_request_init() ||
-	    bch_debug_init(bcache_kobj))
+	    bch_debug_init(bcache_kobj) ||
+	    sysfs_create_files(bcache_kobj, files))
 		goto err;
 
 	return 0;
Signature · 1 line
1.8.3.1