Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Kai Krakow <kai@kaishome.de>
To: gregkh@linuxfoundation.org
Cc: Coly Li <colyli@suse.de>,
	stable@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Kai Krakow <kai@kaishome.de>
Subject: [PATCH] bcache: return 0 from bch_debug_init() if CONFIG_DEBUG_FS=n
Date: Sun, 20 May 2018 11:53:37 +0200	[thread overview]
Message-ID: <20180520095337.21044-1-kai@kaishome.de> (raw)
In-Reply-To: <152680254554207@kroah.com>

From: Coly Li <colyli@suse.de>

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.

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 539d39eb2708 ("bcache: fix wrong return value in bch_debug_init()")
Cc: stable@vger.kernel.org
Signed-off-by: Coly Li <colyli@suse.de>
Reported-by: Massimo B. <massimo.b@gmx.net>
Reported-by: Kai Krakow <kai@kaishome.de>
Tested-by: Kai Krakow <kai@kaishome.de>
Acked-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit 1c1a2ee1b53b006754073eefc65d2b2cedb5264b)
Signed-off-by: Kai Krakow <kai@kaishome.de>
---
 drivers/md/bcache/debug.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index af89408befe8..b218426a6493 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -251,6 +251,9 @@ void bch_debug_exit(void)
 
 int __init bch_debug_init(struct kobject *kobj)
 {
+	if (!IS_ENABLED(CONFIG_DEBUG_FS))
+		return 0;
+
 	debug = debugfs_create_dir("bcache", NULL);
 
 	return IS_ERR_OR_NULL(debug);
-- 
2.16.1

  parent reply	other threads:[~2018-05-20  9:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-20  7:49 FAILED: patch "[PATCH] bcache: return 0 from bch_debug_init() if CONFIG_DEBUG_FS=n" failed to apply to 4.16-stable tree gregkh
2018-05-20  9:01 ` Kai Krakow
     [not found] ` <CAC2ZOYu1fGm2vHyx_Pp_DVsTMUKeYGHO6W_0NrW=M+-Anwr-Qw@mail.gmail.com>
2018-05-20  9:04   ` Greg KH
2018-05-20  9:14     ` Kai Krakow
2018-05-20  9:38       ` Coly Li
2018-05-20  9:42         ` Kai Krakow
2018-05-20  9:38       ` Greg KH
2018-05-20  9:53 ` Kai Krakow [this message]
2018-05-20 12:52   ` [PATCH] bcache: return 0 from bch_debug_init() if CONFIG_DEBUG_FS=n Coly Li
  -- strict thread matches above, loose matches on Subject: below --
2018-05-16 12:39 Coly Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180520095337.21044-1-kai@kaishome.de \
    --to=kai@kaishome.de \
    --cc=axboe@kernel.dk \
    --cc=colyli@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox