Re: [PATCH v3 01/10] selftests/mm: Report errno when things fail in gup_longterm

2025-03-11 Thread David Hildenbrand
  
  		/*

 * TODO: if the kernel ever supports long-term R/W pinning on
@@ -202,7 +204,8 @@ static void do_test(int fd, size_t size, enum test_type 
type, bool shared)
/* Skip on errors, as we might just lack kernel support. */
ret = io_uring_queue_init(1, &ring, 0);
if (ret < 0) {
-   ksft_test_result_skip("io_uring_queue_init() failed\n");
+   ksft_test_result_skip("io_uring_queue_init() failed 
(%s)\n",
+ strerror(errno));


This function is documented to return -errno. I'm not sure if errno is 
guaranteed to be left unmodified (not clearly documented in the man 
page). So you might just want to use strerror(-ret) here.


Same applies to the other io_uring functions.

--
Cheers,

David / dhildenb




Re: [PATCH v3 01/10] selftests/mm: Report errno when things fail in gup_longterm

2025-02-28 Thread Dev Jain




On 28/02/25 10:24 pm, Brendan Jackman wrote:

Just reporting failure doesn't tell you what went wrong. This can fail
in different ways so report errno to help the reader get started
debugging.

Signed-off-by: Brendan Jackman 


Reviewed-by: Dev Jain