Skip to content

Commit

Permalink
Merge branch 'io_uring-6.1' into for-next
Browse files Browse the repository at this point in the history
* io_uring-6.1:
  io_uring: fix fdinfo sqe offsets calculation
  io_uring: local variable rw shadows outer variable in io_write
  • Loading branch information
axboe committed Oct 11, 2022
2 parents a413a25 + 9af3f83 commit 7dc30bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion io_uring/fdinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static __cold void __io_uring_show_fdinfo(struct io_ring_ctx *ctx,
sq_idx = READ_ONCE(ctx->sq_array[entry & sq_mask]);
if (sq_idx > sq_mask)
continue;
sqe = &ctx->sq_sqes[sq_idx << 1];
sqe = &ctx->sq_sqes[sq_idx << sq_shift];
seq_printf(m, "%5u: opcode:%s, fd:%d, flags:%x, off:%llu, "
"addr:0x%llx, rw_flags:0x%x, buf_index:%d "
"user_data:%llu",
Expand Down
8 changes: 4 additions & 4 deletions io_uring/rw.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ int io_write(struct io_kiocb *req, unsigned int issue_flags)
goto copy_iov;

if (ret2 != req->cqe.res && ret2 >= 0 && need_complete_io(req)) {
struct io_async_rw *rw;
struct io_async_rw *io;

trace_io_uring_short_write(req->ctx, kiocb->ki_pos - ret2,
req->cqe.res, ret2);
Expand All @@ -929,9 +929,9 @@ int io_write(struct io_kiocb *req, unsigned int issue_flags)
iov_iter_save_state(&s->iter, &s->iter_state);
ret = io_setup_async_rw(req, iovec, s, true);

rw = req->async_data;
if (rw)
rw->bytes_done += ret2;
io = req->async_data;
if (io)
io->bytes_done += ret2;

if (kiocb->ki_flags & IOCB_WRITE)
kiocb_end_write(req);
Expand Down

0 comments on commit 7dc30bd

Please sign in to comment.