Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp4597618pja; Thu, 21 Nov 2019 22:33:46 -0800 (PST) X-Google-Smtp-Source: APXvYqw9piCgbcgiw/3hpsTufmQix2yufBmH81lqBbVLYjBVnWgixkXH6LH1Ph2vQssHQDCde6IT X-Received: by 2002:a17:906:f756:: with SMTP id jp22mr19295461ejb.234.1574404426333; Thu, 21 Nov 2019 22:33:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574404426; cv=none; d=google.com; s=arc-20160816; b=jcc21/KaRfHl+DAQiDhhcSWebO7VDbVieRPjuPK7DRjh1QC1iqxDr2Y0kOtbvX/TmJ E6akGbn8sTmT31Z1DOGSaZC+A71mc0J7gLGPJ7hj0hz4foQ3aOpZMS85J6+FzmNFAUP+ qDEh/GB9VZbjRj0vJrRg/HRK3qokkttiXJeLf3jB82ZEd4EEqA7nUCfT97omo99gFNNv sd0vAWnUeuSKjjekSz75kXlINh8OOWd8UAgmW6FfyvjWr3qyCGTdFKhkSE+FZdhpcOvn qMi6lByAgHHD7kUMZF+YlftTFuqMPSVCUOsanOL8OnPmctdbAc8rZ9MmIWcTgNMEQH77 Rgxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sEi6hV0VsQQ3p0aFSULsiZ3wksfPx5xHbQ6Af+RZQpA=; b=cDoRY4xQG3dw5RMLMMUKSpuJRBfn7Oumqeo6xBPxZIrbNz3L2M9uFuBBoiBxc5krLM pjE8/ny8FjGTNfRIm4riFL8kLNZu9K/I3fgPl0rvMjbe/w0BYkgsz7G0gF6oQCFJERu/ +seo+dAjehn/SPS7OrTLz+xFgB9+ZL9QkxacUnF4fDas7szhtFkWvsukpu9N52kqrJmC iIiVUJamsrOQ0KJqJSUZRNvnOLhpcwsQoK7CfkUAQ0YgskmELv6A8pWreMYDtFgx58/9 xDvKj7qOQ2QdX+5qfwqzxeRk5wakSKI/PszvM1IJAteupro2tl/UhmobbVASeEXhxi3j 2Dqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="F6k/ipXH"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g26si3935643edj.172.2019.11.21.22.33.22; Thu, 21 Nov 2019 22:33:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="F6k/ipXH"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728936AbfKVG25 (ORCPT + 99 others); Fri, 22 Nov 2019 01:28:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:54476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727488AbfKVFuF (ORCPT ); Fri, 22 Nov 2019 00:50:05 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 834B42070A; Fri, 22 Nov 2019 05:50:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574401804; bh=27Aee2Qu0qErbEERw1oJDBvvzhWM8S0QTIaSKnmGKpw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F6k/ipXHRJVy7RKxeiLC7C3Q6Gj5Q4zFJTkGyWvhTUZ2OUAVE9rJiWBy66W1AgEOH 5CwL39KtLYi3D5QI2y0VWOWJMxChJdm4gNefOalF5j49MyIV/uqEKEtFQtm9+ex3ky 8UqeJA0lzADHyFzoWCo/u3cwYVuwuP8aZ8bTvgyo= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shenghui Wang , Coly Li , Jens Axboe , Sasha Levin , linux-bcache@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 049/219] bcache: do not check if debug dentry is ERR or NULL explicitly on remove Date: Fri, 22 Nov 2019 00:46:21 -0500 Message-Id: <20191122054911.1750-42-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191122054911.1750-1-sashal@kernel.org> References: <20191122054911.1750-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shenghui Wang [ 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 Signed-off-by: Coly Li Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/md/bcache/debug.c | 3 +-- drivers/md/bcache/super.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c index 06da66b2488ae..8c53d874ada4a 100644 --- a/drivers/md/bcache/debug.c +++ b/drivers/md/bcache/debug.c @@ -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) diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c index 2321643974dab..3124399e2607a 100644 --- a/drivers/md/bcache/super.c +++ b/drivers/md/bcache/super.c @@ -1485,8 +1485,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); -- 2.20.1