From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: Re: [PATCH net-next] netdevsim: check return value of debugfs_create_dir Date: Thu, 7 Dec 2017 13:20:53 -0800 Message-ID: <20171207132053.357d52c1@cakuba.netronome.com> References: <20171207010213.4792-1-bhole_prashant_q7@lab.ntt.co.jp> <20171206183341.00175b36@cakuba.netronome.com> <000401d36f11$577e2b90$067a82b0$@lab.ntt.co.jp> <20171206220526.04e1bfea@cakuba.netronome.com> <001001d36f39$4a81b5b0$df852110$@lab.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "'David S . Miller'" , To: "Prashant Bhole" Return-path: Received: from mail-qt0-f194.google.com ([209.85.216.194]:42483 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752248AbdLGVU5 (ORCPT ); Thu, 7 Dec 2017 16:20:57 -0500 Received: by mail-qt0-f194.google.com with SMTP id g9so21253690qth.9 for ; Thu, 07 Dec 2017 13:20:56 -0800 (PST) In-Reply-To: <001001d36f39$4a81b5b0$df852110$@lab.ntt.co.jp> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, 7 Dec 2017 17:56:37 +0900, Prashant Bhole wrote: > > From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com] > > > > On Thu, 7 Dec 2017 13:10:39 +0900, Prashant Bhole wrote: > > > > From: Jakub Kicinski [mailto:jakub.kicinski@netronome.com] > > > > > > > > On Thu, 7 Dec 2017 10:02:13 +0900, Prashant Bhole wrote: > > > > > - Handled debugfs_create_dir failure in nsim_init() > > > > > - Fixed return value of nsim_module_init() when debugfs_create_dir > > > > > fails > > > > > > > > > > Signed-off-by: Prashant Bhole > > > > > > > > Why? Failing to expose the state via DebugFS is not fatal to the driver. > > > > > > Ok, my intention was to handle the return code properly, which is not > > > needed as per your comment. > > > Shall I remove the existing handling in nsim_module_init() in separate > > > patch? > > > > I was going back and forth on the error handling quite a bit writing that code. In > > the end I decided to leave the module_init check and check for bpf prog > > directory. Former one is mostly useful to make sure the is no duplicate directory > > with the same name, the latter to limit possible false positive in the selftest.. > > Ok. Currently return value is checked with IS_ERR(). But when Debug FS is > enabled, debugfs_create_dir will never return error value. It returns either > NULL or a valid pointer. Shall I replace IS_ERR with NULL check or > IS_ERR_OR_NULL check? Sure.