Skip to content

Commit 1c1a2ee

Browse files
Coly Liaxboe
authored andcommitted
bcache: return 0 from bch_debug_init() if CONFIG_DEBUG_FS=n
Commit 539d39e ("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. Changelog: v4: Add Acked-by from Kent Overstreet. v3: Use IS_ENABLED(CONFIG_DEBUG_FS) to replace #ifdef DEBUG_FS. v2: Remove a warning information v1: Initial version. Fixes: Commit 539d39e ("bcache: fix wrong return value in bch_debug_init()") Cc: [email protected] Signed-off-by: Coly Li <[email protected]> Reported-by: Massimo B. <[email protected]> Reported-by: Kai Krakow <[email protected]> Tested-by: Kai Krakow <[email protected]> Acked-by: Kent Overstreet <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 9abd68e commit 1c1a2ee

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/md/bcache/debug.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ void bch_debug_exit(void)
250250

251251
int __init bch_debug_init(struct kobject *kobj)
252252
{
253-
bcache_debug = debugfs_create_dir("bcache", NULL);
253+
if (!IS_ENABLED(CONFIG_DEBUG_FS))
254+
return 0;
254255

256+
bcache_debug = debugfs_create_dir("bcache", NULL);
255257
return IS_ERR_OR_NULL(bcache_debug);
256258
}

0 commit comments

Comments
 (0)