From: Murphy Zhou <jencce.kernel@gmail.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] fcntl: fix lock type interpretation
Date: Tue, 6 Jun 2023 14:51:00 +0800 [thread overview]
Message-ID: <20230606065100.3873610-1-jencce.kernel@gmail.com> (raw)
The lock type switching from an integer to a string in those
testcases are wrong because of typo I believe. As part of a
batch porting, fcntl17.c did it right.
In /usr/include/asm-generic/fcntl.h:166 defines the posix file
lock type value:
Those testcases mistook them as 1, 2, 3 respectively.
This does not affect the test verdict, but is printing wrong
message when the type is really not match, for example when
testing on CIFS.
Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
---
testcases/kernel/syscalls/fcntl/fcntl11.c | 6 +++---
testcases/kernel/syscalls/fcntl/fcntl19.c | 6 +++---
testcases/kernel/syscalls/fcntl/fcntl20.c | 6 +++---
testcases/kernel/syscalls/fcntl/fcntl21.c | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/testcases/kernel/syscalls/fcntl/fcntl11.c b/testcases/kernel/syscalls/fcntl/fcntl11.c
index b66fa8421..d042c6b9b 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl11.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl11.c
@@ -189,11 +189,11 @@ char *str_type(int type)
static char buf[20];
switch (type) {
- case 0:
+ case F_RDLCK:
return ("F_RDLCK");
- case 1:
+ case F_WRLCK:
return ("F_WRLCK");
- case 2:
+ case F_UNLCK:
return ("F_UNLCK");
default:
sprintf(buf, "BAD VALUE: %d", type);
diff --git a/testcases/kernel/syscalls/fcntl/fcntl19.c b/testcases/kernel/syscalls/fcntl/fcntl19.c
index 88c91d6ea..f929aff99 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl19.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl19.c
@@ -215,11 +215,11 @@ char *str_type(int type)
static char buf[20];
switch (type) {
- case 1:
+ case F_RDLCK:
return ("F_RDLCK");
- case 2:
+ case F_WRLCK:
return ("F_WRLCK");
- case 3:
+ case F_UNLCK:
return ("F_UNLCK");
default:
sprintf(buf, "BAD VALUE: %d", type);
diff --git a/testcases/kernel/syscalls/fcntl/fcntl20.c b/testcases/kernel/syscalls/fcntl/fcntl20.c
index b671af8a9..4aa773451 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl20.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl20.c
@@ -214,11 +214,11 @@ char *str_type(int type)
static char buf[20];
switch (type) {
- case 1:
+ case F_RDLCK:
return ("F_RDLCK");
- case 2:
+ case F_WRLCK:
return ("F_WRLCK");
- case 3:
+ case F_UNLCK:
return ("F_UNLCK");
default:
sprintf(buf, "BAD VALUE: %d", type);
diff --git a/testcases/kernel/syscalls/fcntl/fcntl21.c b/testcases/kernel/syscalls/fcntl/fcntl21.c
index 8f1a67cf6..824b8c059 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl21.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl21.c
@@ -222,11 +222,11 @@ char *str_type(int type)
static char buf[20];
switch (type) {
- case 1:
+ case F_RDLCK:
return ("F_RDLCK");
- case 2:
+ case F_WRLCK:
return ("F_WRLCK");
- case 3:
+ case F_UNLCK:
return ("F_UNLCK");
default:
sprintf(buf, "BAD VALUE: %d", type);
--
2.31.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next reply other threads:[~2023-06-06 6:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-06 6:51 Murphy Zhou [this message]
2023-06-06 7:35 ` [LTP] [PATCH] fcntl: fix lock type interpretation Li Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230606065100.3873610-1-jencce.kernel@gmail.com \
--to=jencce.kernel@gmail.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.