From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:43489 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751468AbeEQOep (ORCPT ); Thu, 17 May 2018 10:34:45 -0400 Subject: Re: [PATCH v2] bcache: return 0 from bch_debug_init() if CONFIG_DEBUG_FS=n To: Kent Overstreet Cc: linux-bcache@vger.kernel.org, linux-block@vger.kernel.org, stable@vger.kernel.org References: <20180517095348.21392-1-colyli@suse.de> <20180517113548.GA24817@kmo-pixel> From: Coly Li Message-ID: <4dcc0ee4-6db1-3da5-5526-1b2d4121dd88@suse.de> Date: Thu, 17 May 2018 22:33:51 +0800 MIME-Version: 1.0 In-Reply-To: <20180517113548.GA24817@kmo-pixel> Content-Type: text/plain; charset=utf-8 Sender: linux-block-owner@vger.kernel.org List-Id: linux-block@vger.kernel.org On 2018/5/17 7:35 PM, Kent Overstreet wrote: > On Thu, May 17, 2018 at 05:53:48PM +0800, Coly Li wrote: >> 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@vger.kernel.org >> Signed-off-by: Coly Li >> Reported-by: Massimo B. >> Reported-by: Kai Krakow >> Tested-by: Kai Krakow >> Cc: Kent Overstreet >> --- >> drivers/md/bcache/bcache.h | 5 +++++ >> drivers/md/bcache/debug.c | 8 ++++---- >> 2 files changed, 9 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h >> index 3a0cfb237af9..5b3fe87f32ee 100644 >> --- a/drivers/md/bcache/bcache.h >> +++ b/drivers/md/bcache/bcache.h >> @@ -994,8 +994,13 @@ void bch_open_buckets_free(struct cache_set *); >> >> int bch_cache_allocator_start(struct cache *ca); >> >> +#ifdef CONFIG_DEBUG_FS > > you could just use if (IS_ENABLED(CONFIG_DEBUG_FS)) in bch_debug_init, that way > you don't need to add an #ifdef > Yes, it is much simpler. v3 patch resent for your review. Thanks for the hint. Coly Li