On 2018/5/16 6:46 PM, Kai Krakow wrote: > Hello Kent! > > 2018-05-16 9:58 GMT+02:00 Kent Overstreet <kent.overstreet@xxxxxxxxx>: >> On Wed, May 02, 2018 at 12:53:17PM +0200, Massimo B. wrote: >>> Hello, >>> >>> have you been able to modprobe bcache on 4.16.x? >>> I have asked on IRC and it seemed nobody tried before, just me. >>> So nobody was able to confirm or confirm against... >>> >>> https://github.com/dracutdevs/dracut/issues/393 >>> At least here I'm not able to modprobe the bcache module from an initramfs. >>> So I can't boot with that 4.16.x kernel as my root fs is on bcache. >> >> It was busted by 539d39eb27083405b82b9e604e88af01a9a46c63 (bcache: fix wrong >> return value in bch_debug_init()) - only breaks when CONFIG_DEBUG_FS=n >> >> also, that commit has a bunch of other unrelated changes in it... > > Thanks for the pointer, this sounds promising. Do you suggest to remove > the unrelated changes, or do you suggest to revert the change in > bch_debug_init()? > > I'll try to fiddle around with this commit this evening. Hi Massimo, Kai, Could you please to have a try with the attached patch ? This is a rebased version for 4.16.9, I verified it with a kernel has no debugfs enabled. Hope it works on your kernels. If the patches works for you all, I will post patches to 4.17 and 4.16-stable both. Thanks. Coly Li
From 11543f8f4c002be9450ba3e39a11d007beef0dca Mon Sep 17 00:00:00 2001 From: Coly Li <colyli@xxxxxxx> Date: Wed, 16 May 2018 20:57:44 +0800 Subject: [PATCH] bcache: return 0 from bch_debug_init() if CONFIG_DEBUG_FS=n Commit 539d39eb2708 ("bcache: fix wrong return value in bch_debug_init()") returns the return value of debugfs_create_dir() to bcache_init(). When CONFIG_DEBUG_FS=n, bch_debug_init() always returns 1 and makes bcache_init() failedi. This patch makes bch_debug_init() always returns 0 if CONFIG_DEBUG_FS=n, so bcache can continue to work for the kernels which don't have debugfs enanbled. Fixes: Commit 539d39eb2708 ("bcache: fix wrong return value in bch_debug_init()") Cc: stable@xxxxxxxxxxxxxxx Signed-off-by: Coly Li <colyli@xxxxxxx> Reported-by: Massimo B. <massimo.b@xxxxxxx> Reported-by: Kai Krakow <kai@xxxxxxxxxxx> Cc: Kent Overstreet <kent.overstreet@xxxxxxxxx> --- drivers/md/bcache/bcache.h | 5 +++++ drivers/md/bcache/debug.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h index 12e5197f186cd..5787475df9ec0 100644 --- a/drivers/md/bcache/bcache.h +++ b/drivers/md/bcache/bcache.h @@ -941,8 +941,13 @@ void bch_open_buckets_free(struct cache_set *); int bch_cache_allocator_start(struct cache *ca); +#ifdef CONFIG_DEBUG_FS void bch_debug_exit(void); int bch_debug_init(struct kobject *); +#else +static inline void bch_debug_exit(void) {}; +static inline int bch_debug_init(struct kobject *kobj) { return 0; }; +#endif void bch_request_exit(void); int bch_request_init(void); diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index af89408befe84..91c11717ce216 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -241,8 +241,6 @@ void bch_debug_init_cache_set(struct cache_set *c) } } -#endif - void bch_debug_exit(void) { if (!IS_ERR_OR_NULL(debug)) @@ -255,3 +253,5 @@ int __init bch_debug_init(struct kobject *kobj) return IS_ERR_OR_NULL(debug); } + +#endif -- 2.16.3