Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp803478imm; Mon, 21 May 2018 14:47:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqqZdU2yK+dz9QSLhGQd2xSiPTHirLZniXQiq+R9MfbyGknWHr1D6Ha1M7H0QFfYkyIZ/MN X-Received: by 2002:a17:902:7b86:: with SMTP id w6-v6mr22676252pll.183.1526939260179; Mon, 21 May 2018 14:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526939260; cv=none; d=google.com; s=arc-20160816; b=oZ1AM/FhQ/JIZC0PYdEOarotOmwamE/6QIyInX4nrgS/XSNYMqBDstaJkSSPhW+mrg 5m6k1WgmkYt/cyQIkOGNM9HkOyNIUNRjVULevYjkN6C6ddZw3VeTEOswjDu0TnK43i8H zg0026F/+QgPRXZAD5D3+Alesar7P+4hIvdEMD3cHT7UzECk7tuTdRh7zZBU1gJMH9oU hSp5EZ2hgC1f4EZb1PVdmQ/OOCQRpSLjemrX5npZu0AIHY60m/4KiWzOgYGzU2R/MJF3 J7q2PAqRbIcdxOchdeHfNfP4lPMTY4uUhaZ4/LBKIl/6qUBiHuligm1mBBJdrlpAxxFD a/Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Ov7q8aLZPBPMmKmalX3xnXY7G7Hc6V8SubA+HSZ9eFQ=; b=eX9D7kZBl83Httnb+8NAt6NRoGCToZ+t+GZB+XRReffnpH3SZZh/4GLZ9A6rDXD1RG DSRPEuupLJp93pwQVROwhc9t0covZ/0D0UoXV2wAEbMyqGsi4KBLxfkgCimCfzuOceRX ABeZzT5CJkLMR7nXa9MXn3ufTDPJaVZioplYt7jxeAv9STtcPC+KVBFfxxuSLFI1pacu RrUw6oBk48QGv/wgHce9t0shfkWhishSvdGeHRNLJplB6+IndCId79NZq7ulwpk3lEYc 6yvq7ALEAMQrNNXwHJe+b601uZb5P7OMgGoSEVl2as2PpOrKoJ0vB+VOvuSRyDhNPYKS NlDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Rn8BpU+A; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si12140754pgr.76.2018.05.21.14.47.25; Mon, 21 May 2018 14:47:40 -0700 (PDT) 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=Rn8BpU+A; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754430AbeEUVrI (ORCPT + 99 others); Mon, 21 May 2018 17:47:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:38786 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932203AbeEUVX5 (ORCPT ); Mon, 21 May 2018 17:23:57 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7176C20871; Mon, 21 May 2018 21:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526937837; bh=6HrwEUefRtZ6ojKknFjFSOFVDsraNarkOrOXtAzECmo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rn8BpU+AFqJg8p8gYcmrDJoQ6Ook3rfRw2IZYvGNwBnF7kb9nuJlFyS7S5y6d5+GI sz80H5ricchNj1qdVomoUoWNd0rnfAT/TkqDY+gTYfV1eWEKdqQEE5GAfSx43BoXfs j3YGX1JusDyZk3ztATvxnGIpzaQ4O7XxUX4vKKp0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Coly Li , "Massimo B." , Kai Krakow , Kent Overstreet , Jens Axboe Subject: [PATCH 4.16 044/110] bcache: return 0 from bch_debug_init() if CONFIG_DEBUG_FS=n Date: Mon, 21 May 2018 23:11:41 +0200 Message-Id: <20180521210508.025108599@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180521210503.823249477@linuxfoundation.org> References: <20180521210503.823249477@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Coly Li commit 1c1a2ee1b53b006754073eefc65d2b2cedb5264b upstream. 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 Reported-by: Massimo B. Reported-by: Kai Krakow Tested-by: Kai Krakow Acked-by: Kent Overstreet Signed-off-by: Jens Axboe Signed-off-by: Kai Krakow Signed-off-by: Greg Kroah-Hartman --- drivers/md/bcache/debug.c | 3 +++ 1 file changed, 3 insertions(+) --- 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);