Skip to contentSkip to conversation

PATCH Shraddha Barke 5 participants 5 messages Aug 3, 2015 Staging

lore
Share & tools
lore
#0 lore raw
Quoted 1 line

From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001

From: Shraddha Barke <[email protected]>
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

---
 drivers/staging/lustre/lustre/llite/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/file.c +1 -1
index 2c467bf..93619a8 100644
@@ -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;
 }
 
 /**
Signature · 1 line
2.1.0
#1 lore raw

Re: about ENOSYS

subject have been missing, so I filled in something.

Quoted 11 lines · Shraddha Barke

From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001
From: Shraddha Barke <[email protected]>
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?

Quoted 22 lines

---
drivers/staging/lustre/lustre/llite/file.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/llite/file.c +0 -0
index 2c467bf..93619a8 100644
@@ -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) {

drivers/staging/lustre/lustre/llite/file.c +1 -1
-	return -ENOSYS;
+	return -EINVAL;

}

/**

Signature · 1 line
2.1.0
#2 lore raw

Re: about ENOSYS

Quoted 26 lines · Oleg

subject have been missing, so I filled in something.

Quoted 11 lines · Shraddha Barke

From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001
From: Shraddha Barke <[email protected]>
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
Quoted 7 lines

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.

#3 lore raw

Re: your mail

In reply to Shraddha Barke
Quoted 4 lines · Shraddha Barke

From b67c6c20455b04b77447ab4561e44f1a75dd978d Mon Sep 17 00:00:00 2001
From: Shraddha Barke <[email protected]>
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