[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALZtONCjGashJkkDSxjP-E8-p67+WeAjDaYn5dQi=FomByh8Qg@mail.gmail.com>
Date: Tue, 29 Jan 2019 14:46:30 -0500
From: Dan Streetman <ddstreet@...e.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Seth Jennings <sjenning@...hat.com>,
Linux-MM <linux-mm@...ck.org>
Subject: Re: [PATCH] zswap: ignore debugfs_create_dir() return value
On Tue, Jan 22, 2019 at 10:23 AM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> When calling debugfs functions, there is no need to ever check the
> return value. The function can work or not, but the code logic should
> never do something different based on this.
>
> Cc: Seth Jennings <sjenning@...hat.com>
> Cc: Dan Streetman <ddstreet@...e.org>
> Cc: linux-mm@...ck.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> ---
> mm/zswap.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/mm/zswap.c b/mm/zswap.c
> index a4e4d36ec085..f583d08f6e24 100644
> --- a/mm/zswap.c
> +++ b/mm/zswap.c
> @@ -1262,8 +1262,6 @@ static int __init zswap_debugfs_init(void)
> return -ENODEV;
>
> zswap_debugfs_root = debugfs_create_dir("zswap", NULL);
> - if (!zswap_debugfs_root)
> - return -ENOMEM;
>
> debugfs_create_u64("pool_limit_hit", 0444,
> zswap_debugfs_root, &zswap_pool_limit_hit);
wait, so if i'm reading the code right, in the case where
debugfs_create_dir() returns NULL, that will then be passed along to
debugfs_create_u64() as its parent directory - and the debugfs nodes
will then get created in the root debugfs directory. That's not what
we want to happen...
> --
> 2.20.1
>
Powered by blists - more mailing lists