[PATCH liburing 3/3] man/io_uring_cqe_get_data.3: Fix a misleading return value

Ammar Faizi posted 3 patches 2 years, 8 months ago
[PATCH liburing 3/3] man/io_uring_cqe_get_data.3: Fix a misleading return value
Posted by Ammar Faizi 2 years, 8 months ago
Since commit 8ecd3fd959634df8 ("Don't clear sqe->user_data as part of
command prep"), the prep functions no longer zero the user data. If the
user_data is not set, it will contain whatever previous value in it.

Therefore, the returned value when the user_data is-not-set is not
always NULL. And oh, someone once hit an issue because they assume the
return value is NULL if the user_data is not set. See the link below.

Fix the manpage, tell that the return value will be undefined.

Link: https://github.com/axboe/liburing/issues/575#issuecomment-1110516140
Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org>
---
 man/io_uring_cqe_get_data.3 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man/io_uring_cqe_get_data.3 b/man/io_uring_cqe_get_data.3
index 4cbb32cd864e12c2..a4d2988a49d92aa8 100644
--- a/man/io_uring_cqe_get_data.3
+++ b/man/io_uring_cqe_get_data.3
@@ -46,7 +46,7 @@ or
 If the
 .I user_data
 value has been set before submitting the request, it will be returned.
-Otherwise the functions returns NULL.
+Otherwise, the return value is undefined.
 .SH SEE ALSO
 .BR io_uring_get_sqe (3),
 .BR io_uring_sqe_set_data (3),
-- 
Ammar Faizi