Skip to content

Commit 5e55956

Browse files
committed
io_uring: ensure registered buffer import returns the IO length
A test case was reported where two linked reads with registered buffers failed the second link always. This is because we set the expected value of a request in req->result, and if we don't get this result, then we fail the dependent links. For some reason the registered buffer import returned -ERROR/0, while the normal import returns -ERROR/length. This broke linked commands with registered buffers. Fix this by making io_import_fixed() correctly return the mapped length. Cc: [email protected] # v5.3 Reported-by: 李通洲 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 5683e54 commit 5e55956

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1230,7 +1230,7 @@ static int io_import_fixed(struct io_ring_ctx *ctx, int rw,
12301230
}
12311231
}
12321232

1233-
return 0;
1233+
return len;
12341234
}
12351235

12361236
static ssize_t io_import_iovec(struct io_ring_ctx *ctx, int rw,

0 commit comments

Comments
 (0)