linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* (no subject)
@ 2015-08-03  6:18 Shraddha Barke
  2015-08-03  6:41 ` about ENOSYS Drokin, Oleg
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Shraddha Barke @ 2015-08-03  6:18 UTC (permalink / raw)
  To: Oleg Drokin, Al Viro, Julia Lawall, aybuke ozdemir,
	Andreas Dilger, John L. Hammond, Frank Zago, Greg Kroah-Hartman,
	HPDD-discuss, devel, linux-kernel
  Cc: Shraddha Barke

>From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001
From: Shraddha Barke <shraddha.6596@gmail.com>
Date: Mon, 3 Aug 2015 11:34:19 +0530
Subject: [PATCH] Staging : lustre : Use -EINVAL instead of -ENOSYS

ENOSYS means that a nonexistent system call was called. This should
not be used for invalid operations on otherwise valid syscalls.

Use -EINVAL instead of -ENOSYS. This fixes checkpatch warning message:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
---
 drivers/staging/lustre/lustre/llite/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index 2c467bf..93619a8 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2786,7 +2786,7 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
 static int
 ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)
 {
-	return -ENOSYS;
+	return -EINVAL;
 }
 
 /**
-- 
2.1.0


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

* Re: about ENOSYS
  2015-08-03  6:18 Shraddha Barke
@ 2015-08-03  6:41 ` Drokin, Oleg
  2015-08-03 16:21   ` Greg Kroah-Hartman
  2015-08-03  7:12 ` your mail Sudip Mukherjee
  2015-08-03  7:24 ` Dan Carpenter
  2 siblings, 1 reply; 5+ messages in thread
From: Drokin, Oleg @ 2015-08-03  6:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Shraddha Barke
  Cc: Al Viro, Julia Lawall, aybuke ozdemir, Dilger, Andreas, Hammond,
	John, Frank Zago, HPDD-discuss@lists.01.org,
	<devel@driverdev.osuosl.org> SUBSYSTEM,
	Linux Kernel Mailing List

subject have been missing, so I filled in something.

On Aug 3, 2015, at 2:18 AM, Shraddha Barke wrote:

> From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001
> From: Shraddha Barke <shraddha.6596@gmail.com>
> Date: Mon, 3 Aug 2015 11:34:19 +0530
> Subject: [PATCH] Staging : lustre : Use -EINVAL instead of -ENOSYS
> 
> ENOSYS means that a nonexistent system call was called. This should
> not be used for invalid operations on otherwise valid syscalls.
> 
> Use -EINVAL instead of -ENOSYS. This fixes checkpatch warning message:
> 
> WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Is this really true, though?
I know you are working off what the tool reports.
But in reality people have been using ENOSYS to indicate
"this thing that you want is not really available" 
Reading the define file we can see:
/usr/include/asm-generic/errno.h:#define	ENOSYS		38	/* Function not implemented */

$ grep -r 'ENOSYS;' fs/ | wc -l
75

So it's extensively used in the fs tree by existing code.

Hmm…. Searching some more I arrived at commit e15f431f
that changes the in-kernel comment and claims the "system call only stuff".

So Greg, do you want Lustre to get rid of use of ENOSYS (all 16 users we have),
or is it ok to leave them in?

> 
> Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
> ---
> drivers/staging/lustre/lustre/llite/file.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
> index 2c467bf..93619a8 100644
> --- a/drivers/staging/lustre/lustre/llite/file.c
> +++ b/drivers/staging/lustre/lustre/llite/file.c
> @@ -2786,7 +2786,7 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
> static int
> ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)
> {
> -	return -ENOSYS;
> +	return -EINVAL;
> }
> 
> /**
> -- 
> 2.1.0
> 


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

* Re: your mail
  2015-08-03  6:18 Shraddha Barke
  2015-08-03  6:41 ` about ENOSYS Drokin, Oleg
@ 2015-08-03  7:12 ` Sudip Mukherjee
  2015-08-03  7:24 ` Dan Carpenter
  2 siblings, 0 replies; 5+ messages in thread
From: Sudip Mukherjee @ 2015-08-03  7:12 UTC (permalink / raw)
  To: Shraddha Barke
  Cc: Oleg Drokin, Al Viro, Julia Lawall, aybuke ozdemir,
	Andreas Dilger, John L. Hammond, Frank Zago, Greg Kroah-Hartman,
	HPDD-discuss, devel, linux-kernel

On Mon, Aug 03, 2015 at 11:48:59AM +0530, Shraddha Barke wrote:
> From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001
> From: Shraddha Barke <shraddha.6596@gmail.com>
> Date: Mon, 3 Aug 2015 11:34:19 +0530
> Subject: [PATCH] Staging : lustre : Use -EINVAL instead of -ENOSYS

You do not need these in the commit message.

regards
sudip

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

* Re: your mail
  2015-08-03  6:18 Shraddha Barke
  2015-08-03  6:41 ` about ENOSYS Drokin, Oleg
  2015-08-03  7:12 ` your mail Sudip Mukherjee
@ 2015-08-03  7:24 ` Dan Carpenter
  2 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2015-08-03  7:24 UTC (permalink / raw)
  To: Shraddha Barke
  Cc: Oleg Drokin, Al Viro, Julia Lawall, aybuke ozdemir,
	Andreas Dilger, John L. Hammond, Frank Zago, Greg Kroah-Hartman,
	HPDD-discuss, devel, linux-kernel

Returning EINVAL here is the wrong thing.  Just leave the code as is.

regards,
dan carpenter


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

* Re: about ENOSYS
  2015-08-03  6:41 ` about ENOSYS Drokin, Oleg
@ 2015-08-03 16:21   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 5+ messages in thread
From: Greg Kroah-Hartman @ 2015-08-03 16:21 UTC (permalink / raw)
  To: Drokin, Oleg
  Cc: Shraddha Barke, <devel@driverdev.osuosl.org> SUBSYSTEM,
	Dilger, Andreas, Linux Kernel Mailing List,
	HPDD-discuss@lists.01.org, Julia Lawall, Al Viro, Hammond, John,
	Frank Zago

On Mon, Aug 03, 2015 at 06:41:22AM +0000, Drokin, Oleg wrote:
> subject have been missing, so I filled in something.
> 
> On Aug 3, 2015, at 2:18 AM, Shraddha Barke wrote:
> 
> > From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001
> > From: Shraddha Barke <shraddha.6596@gmail.com>
> > Date: Mon, 3 Aug 2015 11:34:19 +0530
> > Subject: [PATCH] Staging : lustre : Use -EINVAL instead of -ENOSYS
> > 
> > ENOSYS means that a nonexistent system call was called. This should
> > not be used for invalid operations on otherwise valid syscalls.
> > 
> > Use -EINVAL instead of -ENOSYS. This fixes checkpatch warning message:
> > 
> > WARNING: ENOSYS means 'invalid syscall nr' and nothing else
> 
> Is this really true, though?
> I know you are working off what the tool reports.
> But in reality people have been using ENOSYS to indicate
> "this thing that you want is not really available" 
> Reading the define file we can see:
> /usr/include/asm-generic/errno.h:#define	ENOSYS		38	/* Function not implemented */
> 
> $ grep -r 'ENOSYS;' fs/ | wc -l
> 75
> 
> So it's extensively used in the fs tree by existing code.
> 
> Hmm…. Searching some more I arrived at commit e15f431f
> that changes the in-kernel comment and claims the "system call only stuff".
> 
> So Greg, do you want Lustre to get rid of use of ENOSYS (all 16 users we have),
> or is it ok to leave them in?

For now I'd just leave it as-is.

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

end of thread, other threads:[~2015-08-03 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-03  6:18 Shraddha Barke
2015-08-03  6:41 ` about ENOSYS Drokin, Oleg
2015-08-03 16:21   ` Greg Kroah-Hartman
2015-08-03  7:12 ` your mail Sudip Mukherjee
2015-08-03  7:24 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).