linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/eventfd: correct test name and improve messages
@ 2025-05-13  7:44 Ryan Chung
  2025-05-13 16:12 ` Wen Yang
  2025-05-22 21:47 ` Shuah Khan
  0 siblings, 2 replies; 4+ messages in thread
From: Ryan Chung @ 2025-05-13  7:44 UTC (permalink / raw)
  To: shuah; +Cc: wen.yang, akpm, linux-kselftest, linux-kernel, Ryan Chung

- Rename test from  to

- Make the RDWR‐flag comment declarative:
  “The kernel automatically adds the O_RDWR flag.”
- Update semaphore‐flag failure message to:
  “eventfd semaphore flag check failed: …”

Signed-off-by: Ryan Chung <seokwoo.chung130@gmail.com>
---
 tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
index 85acb4e3ef00..72d51ad0ee0e 100644
--- a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
+++ b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
@@ -50,7 +50,7 @@ TEST(eventfd_check_flag_rdwr)
 	ASSERT_GE(fd, 0);
 
 	flags = fcntl(fd, F_GETFL);
-	// since the kernel automatically added O_RDWR.
+	// The kernel automatically adds the O_RDWR flag.
 	EXPECT_EQ(flags, O_RDWR);
 
 	close(fd);
@@ -85,7 +85,7 @@ TEST(eventfd_check_flag_nonblock)
 	close(fd);
 }
 
-TEST(eventfd_chek_flag_cloexec_and_nonblock)
+TEST(eventfd_check_flag_cloexec_and_nonblock)
 {
 	int fd, flags;
 
@@ -178,8 +178,7 @@ TEST(eventfd_check_flag_semaphore)
 	// The semaphore could only be obtained from fdinfo.
 	ret = verify_fdinfo(fd, &err, "eventfd-semaphore: ", 19, "1\n");
 	if (ret != 0)
-		ksft_print_msg("eventfd-semaphore check failed, msg: %s\n",
-				err.msg);
+		ksft_print_msg("eventfd semaphore flag check failed: %s\n", err.msg);
 	EXPECT_EQ(ret, 0);
 
 	close(fd);
-- 
2.43.0


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

* Re: [PATCH] selftests/eventfd: correct test name and improve messages
  2025-05-13  7:44 [PATCH] selftests/eventfd: correct test name and improve messages Ryan Chung
@ 2025-05-13 16:12 ` Wen Yang
  2025-05-22 21:47 ` Shuah Khan
  1 sibling, 0 replies; 4+ messages in thread
From: Wen Yang @ 2025-05-13 16:12 UTC (permalink / raw)
  To: Ryan Chung, shuah; +Cc: akpm, linux-kselftest, linux-kernel


Thanks.

Reviewed-by: Wen Yang <wen.yang@linux.dev>

--
Best wishes,
Wen


On 2025/5/13 15:44, Ryan Chung wrote:
> - Rename test from  to
> 
> - Make the RDWR‐flag comment declarative:
>    “The kernel automatically adds the O_RDWR flag.”
> - Update semaphore‐flag failure message to:
>    “eventfd semaphore flag check failed: …”
> 
> Signed-off-by: Ryan Chung <seokwoo.chung130@gmail.com>
> ---
>   tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
> index 85acb4e3ef00..72d51ad0ee0e 100644
> --- a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
> +++ b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
> @@ -50,7 +50,7 @@ TEST(eventfd_check_flag_rdwr)
>   	ASSERT_GE(fd, 0);
>   
>   	flags = fcntl(fd, F_GETFL);
> -	// since the kernel automatically added O_RDWR.
> +	// The kernel automatically adds the O_RDWR flag.
>   	EXPECT_EQ(flags, O_RDWR);
>   
>   	close(fd);
> @@ -85,7 +85,7 @@ TEST(eventfd_check_flag_nonblock)
>   	close(fd);
>   }
>   
> -TEST(eventfd_chek_flag_cloexec_and_nonblock)
> +TEST(eventfd_check_flag_cloexec_and_nonblock)
>   {
>   	int fd, flags;
>   
> @@ -178,8 +178,7 @@ TEST(eventfd_check_flag_semaphore)
>   	// The semaphore could only be obtained from fdinfo.
>   	ret = verify_fdinfo(fd, &err, "eventfd-semaphore: ", 19, "1\n");
>   	if (ret != 0)
> -		ksft_print_msg("eventfd-semaphore check failed, msg: %s\n",
> -				err.msg);
> +		ksft_print_msg("eventfd semaphore flag check failed: %s\n", err.msg);
>   	EXPECT_EQ(ret, 0);
>   
>   	close(fd);

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

* Re: [PATCH] selftests/eventfd: correct test name and improve messages
  2025-05-13  7:44 [PATCH] selftests/eventfd: correct test name and improve messages Ryan Chung
  2025-05-13 16:12 ` Wen Yang
@ 2025-05-22 21:47 ` Shuah Khan
  2025-05-25  3:54   ` Ryan Chung
  1 sibling, 1 reply; 4+ messages in thread
From: Shuah Khan @ 2025-05-22 21:47 UTC (permalink / raw)
  To: Ryan Chung, shuah
  Cc: wen.yang, akpm, linux-kselftest, linux-kernel, Shuah Khan

On 5/13/25 01:44, Ryan Chung wrote:
> - Rename test from  to
> 

?? missing description of the change. Looks like the patch
renames the test to fix spelling error in the test name?

> - Make the RDWR‐flag comment declarative:
>    “The kernel automatically adds the O_RDWR flag.”
> - Update semaphore‐flag failure message to:
>    “eventfd semaphore flag check failed: …”

There is no need to list all these changes.

Please check a few chanelogs as a reference to how to write them.

> 
> Signed-off-by: Ryan Chung <seokwoo.chung130@gmail.com>
> ---
>   tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
> index 85acb4e3ef00..72d51ad0ee0e 100644
> --- a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
> +++ b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
> @@ -50,7 +50,7 @@ TEST(eventfd_check_flag_rdwr)
>   	ASSERT_GE(fd, 0);
>   
>   	flags = fcntl(fd, F_GETFL);
> -	// since the kernel automatically added O_RDWR.
> +	// The kernel automatically adds the O_RDWR flag.
>   	EXPECT_EQ(flags, O_RDWR);
>   
>   	close(fd);
> @@ -85,7 +85,7 @@ TEST(eventfd_check_flag_nonblock)
>   	close(fd);
>   }
>   
> -TEST(eventfd_chek_flag_cloexec_and_nonblock)
> +TEST(eventfd_check_flag_cloexec_and_nonblock)
>   {
>   	int fd, flags;
>   
> @@ -178,8 +178,7 @@ TEST(eventfd_check_flag_semaphore)
>   	// The semaphore could only be obtained from fdinfo.
>   	ret = verify_fdinfo(fd, &err, "eventfd-semaphore: ", 19, "1\n");
>   	if (ret != 0)
> -		ksft_print_msg("eventfd-semaphore check failed, msg: %s\n",
> -				err.msg);
> +		ksft_print_msg("eventfd semaphore flag check failed: %s\n", err.msg);

What's the reason for this change?

>   	EXPECT_EQ(ret, 0);
>   
>   	close(fd);

thanks,
-- Shuah

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

* Re: [PATCH] selftests/eventfd: correct test name and improve messages
  2025-05-22 21:47 ` Shuah Khan
@ 2025-05-25  3:54   ` Ryan Chung
  0 siblings, 0 replies; 4+ messages in thread
From: Ryan Chung @ 2025-05-25  3:54 UTC (permalink / raw)
  To: skhan
  Cc: akpm, linux-kernel, linux-kselftest, seokwoo.chung130, shuah,
	wen.yang

On Thu, May 22, 2025 at 03:47:27PM -0600, Shuah Khan wrote:
> On 5/13/25 01:44, Ryan Chung wrote:
> > - Rename test from  to
> > 
> 
> ?? missing description of the change. Looks like the patch
> renames the test to fix spelling error in the test name?

Sorry for the missing description. I am not entirely sure what happened
there. The correct description should have been: 

- Rename test from eventfd_chek_flag_cloexec_and_nonblock to
eventfd_check_flag_cloexec_and_nonblock.

> > - Make the RDWR‐flag comment declarative:
> >    “The kernel automatically adds the O_RDWR flag.”
> > - Update semaphore‐flag failure message to:
> >    “eventfd semaphore flag check failed: …”
> 
> There is no need to list all these changes.
> 
> Please check a few chanelogs as a reference to how to write them.
>

Thank you for your comment. I will make sure to do so next time.

> > 
> > Signed-off-by: Ryan Chung <seokwoo.chung130@gmail.com>
> > ---
> >   tools/testing/selftests/filesystems/eventfd/eventfd_test.c | 7 +++----
> >   1 file changed, 3 insertions(+), 4 deletions(-)
> > 
> > diff --git a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
> > index 85acb4e3ef00..72d51ad0ee0e 100644
> > --- a/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
> > +++ b/tools/testing/selftests/filesystems/eventfd/eventfd_test.c
> > @@ -50,7 +50,7 @@ TEST(eventfd_check_flag_rdwr)
> >   	ASSERT_GE(fd, 0);
> >   	flags = fcntl(fd, F_GETFL);
> > -	// since the kernel automatically added O_RDWR.
> > +	// The kernel automatically adds the O_RDWR flag.
> >   	EXPECT_EQ(flags, O_RDWR);
> >   	close(fd);
> > @@ -85,7 +85,7 @@ TEST(eventfd_check_flag_nonblock)
> >   	close(fd);
> >   }
> > -TEST(eventfd_chek_flag_cloexec_and_nonblock)
> > +TEST(eventfd_check_flag_cloexec_and_nonblock)
> >   {
> >   	int fd, flags;
> > @@ -178,8 +178,7 @@ TEST(eventfd_check_flag_semaphore)
> >   	// The semaphore could only be obtained from fdinfo.
> >   	ret = verify_fdinfo(fd, &err, "eventfd-semaphore: ", 19, "1\n");
> >   	if (ret != 0)
> > -		ksft_print_msg("eventfd-semaphore check failed, msg: %s\n",
> > -				err.msg);
> > +		ksft_print_msg("eventfd semaphore flag check failed: %s\n", err.msg);
> 
> What's the reason for this change?
>

The error-print was reworded to match the project's logging style and
improve clarity for the flag. 

> >   	EXPECT_EQ(ret, 0);
> >   	close(fd);
> 
> thanks,
> -- Shuah

Thank you for your feedback. It looks like there was an issue with
sending the patch as this patch was missing descriptions. The correct
version of this patch - selftests/eventfd: correct test name and improve
messages - has been reviewd by Andrew Morton and merged into the
mm-stable branch: git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.
The filename was
selftests-eventfd-correct-test-name-and-improve-messages.patch.

Please let me know if you'd like me to prepare a v2 of this patch of it
there are any further issues to address. 

Thanks again for reviewing.

Sincerely,
Ryan Chung


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

end of thread, other threads:[~2025-05-25  3:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-13  7:44 [PATCH] selftests/eventfd: correct test name and improve messages Ryan Chung
2025-05-13 16:12 ` Wen Yang
2025-05-22 21:47 ` Shuah Khan
2025-05-25  3:54   ` Ryan Chung

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).