All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] orangefs: Dan Carpenter influenced cleanups...
@ 2017-02-06 16:21 Mike Marshall
  2017-02-07  8:35 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Mike Marshall @ 2017-02-06 16:21 UTC (permalink / raw)
  To: viro; +Cc: Mike Marshall, dan.carpenter, linux-fsdevel

This patch is simlar to one Dan Carpenter sent me, cleans
up some return codes and whitespace errors. There was one
place where he thought inserting an error message into
the ring buffer might be too chatty, I hope I convinced him
othewise. As a consolation <g> I changed a truly chatty
error message in another location into a debug message,
system-admins had already yelled at me about that one...

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
---
 fs/orangefs/devorangefs-req.c  |  5 +++--
 fs/orangefs/orangefs-debugfs.c | 12 ++++++------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index 516ffb4..f419dd9 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -402,8 +402,9 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
 	/* remove the op from the in progress hash table */
 	op = orangefs_devreq_remove_op(head.tag);
 	if (!op) {
-		gossip_err("WARNING: No one's waiting for tag %llu\n",
-			   llu(head.tag));
+		gossip_debug(GOSSIP_DEV_DEBUG,
+			     "%s: No one's waiting for tag %llu\n",
+			     __func__, llu(head.tag));
 		return ret;
 	}
 
diff --git a/fs/orangefs/orangefs-debugfs.c b/fs/orangefs/orangefs-debugfs.c
index b5dbc9c..039c4da 100644
--- a/fs/orangefs/orangefs-debugfs.c
+++ b/fs/orangefs/orangefs-debugfs.c
@@ -965,13 +965,13 @@ int orangefs_debugfs_new_client_string(void __user *arg)
 	int ret;
 
 	ret = copy_from_user(&client_debug_array_string,
-                                     (void __user *)arg,
-                                     ORANGEFS_MAX_DEBUG_STRING_LEN);
+			     (void __user *)arg,
+			     ORANGEFS_MAX_DEBUG_STRING_LEN);
 
 	if (ret != 0) {
 		pr_info("%s: CLIENT_STRING: copy_from_user failed\n",
 			__func__);
-		return -EIO;
+		return -EFAULT;
 	}
 
 	/*
@@ -986,7 +986,7 @@ int orangefs_debugfs_new_client_string(void __user *arg)
 	 */
 	client_debug_array_string[ORANGEFS_MAX_DEBUG_STRING_LEN - 1] =
 		'\0';
-	
+
 	pr_info("%s: client debug array string has been received.\n",
 		__func__);
 
@@ -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;
 		}
 
 	}
@@ -1009,7 +1009,7 @@ int orangefs_debugfs_new_client_string(void __user *arg)
 
 	help_string_initialized++;
 
-	return ret;
+	return 0;
 }
 
 int orangefs_debugfs_new_debug(void __user *arg) 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] orangefs: Dan Carpenter influenced cleanups...
  2017-02-06 16:21 [PATCH] orangefs: Dan Carpenter influenced cleanups Mike Marshall
@ 2017-02-07  8:35 ` Dan Carpenter
  2017-02-07 13:16   ` Mike Marshall
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2017-02-07  8:35 UTC (permalink / raw)
  To: Mike Marshall; +Cc: viro, linux-fsdevel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] orangefs: Dan Carpenter influenced cleanups...
  2017-02-07  8:35 ` Dan Carpenter
@ 2017-02-07 13:16   ` Mike Marshall
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Marshall @ 2017-02-07 13:16 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Al Viro, linux-fsdevel, Mike Marshall

> -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 <dan.carpenter@oracle.com> 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
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-07 13:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-06 16:21 [PATCH] orangefs: Dan Carpenter influenced cleanups Mike Marshall
2017-02-07  8:35 ` Dan Carpenter
2017-02-07 13:16   ` Mike Marshall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.