From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f180.google.com ([209.85.128.180]:33042 "EHLO mail-wr0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754142AbdBGNRD (ORCPT ); Tue, 7 Feb 2017 08:17:03 -0500 Received: by mail-wr0-f180.google.com with SMTP id i10so39326143wrb.0 for ; Tue, 07 Feb 2017 05:17:03 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20170207083543.GF11103@mwanda> References: <20170206162120.16717-1-hubcap@omnibond.com> <20170207083543.GF11103@mwanda> From: Mike Marshall Date: Tue, 7 Feb 2017 08:16:57 -0500 Message-ID: Subject: Re: [PATCH] orangefs: Dan Carpenter influenced cleanups... To: Dan Carpenter Cc: Al Viro , linux-fsdevel , Mike Marshall Content-Type: text/plain; charset=UTF-8 Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > -EFAULT isn't right here. It should propogate > the return from orangefs_prepare_debugfs_help_string(). I'll gladly change it, but I remain confused about it. orangefs_prepare_debugfs_help_string could potentially return ENOMEM, which would eventually be returned to the userspace program that called ioctl(2). ioctl's man page doesn't list ENOMEM as a valid return code... -Mike On Tue, Feb 7, 2017 at 3:35 AM, Dan Carpenter wrote: > On Mon, Feb 06, 2017 at 11:21:20AM -0500, Mike Marshall wrote: >> @@ -996,7 +996,7 @@ int orangefs_debugfs_new_client_string(void __user *arg) >> if (orangefs_prepare_debugfs_help_string(0)) { >> gossip_err("%s: no debug help string \n", >> __func__); >> - return -EIO; >> + return -EFAULT; >> } > > The rest looks nice but -EFAULT isn't right here. It should propogate > the return from orangefs_prepare_debugfs_help_string(). > > ret = orangefs_prepare_debugfs_help_string(0); > if (ret) { > gossip_err("%s: no debug help string \n", > __func__); > return ret; > } > > regards, > dan carpenter > >