]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bcache: do not check if debug dentry is ERR or NULL explicitly on remove
authorShenghui Wang <shhuiw@foxmail.com>
Thu, 13 Dec 2018 14:53:47 +0000 (22:53 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 08:20:07 +0000 (09:20 +0100)
[ Upstream commit ae17102316550b4b230a283febe31b2a9ff30084 ]

debugfs_remove and debugfs_remove_recursive will check if the dentry
pointer is NULL or ERR, and will do nothing in that case.

Remove the check in cache_set_free and bch_debug_init.

Signed-off-by: Shenghui Wang <shhuiw@foxmail.com>
Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/md/bcache/debug.c
drivers/md/bcache/super.c

index 06da66b2488ae8f5371fcfeb92c7b336d24e78ca..8c53d874ada4aa92526d328dd93203c400564254 100644 (file)
@@ -249,8 +249,7 @@ void bch_debug_init_cache_set(struct cache_set *c)
 
 void bch_debug_exit(void)
 {
-       if (!IS_ERR_OR_NULL(bcache_debug))
-               debugfs_remove_recursive(bcache_debug);
+       debugfs_remove_recursive(bcache_debug);
 }
 
 void __init bch_debug_init(struct kobject *kobj)
index 4998b4cae9c11af3e6d258f0cb73fc29c37e9244..14d381cc6d7473148a89e3deb7d8435f8263226a 100644 (file)
@@ -1491,8 +1491,7 @@ static void cache_set_free(struct closure *cl)
        struct cache *ca;
        unsigned int i;
 
-       if (!IS_ERR_OR_NULL(c->debug))
-               debugfs_remove(c->debug);
+       debugfs_remove(c->debug);
 
        bch_open_buckets_free(c);
        bch_btree_cache_free(c);