Skip to contentSkip to conversation

io_uring: local variable rw shadows outer variable in io_write

PATCH Applied Stefan Roesch 2 participants 2 messages Oct 11, 2022 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: local variable rw shadows outer variable in io_write

This fixes the shadowing of the outer variable rw in the function io_write().

---
 io_uring/rw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
io_uring/rw.c +4 -4
index a25cd44cd415..453e0ae92160 100644
@@ -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);
@@ -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);

base-commit: e2302539dd4f1c62d96651c07ddb05aa2461d29c

Signature · 1 line
2.30.2
maintainer Applied
#1 lore raw
Quoted 4 lines · Stefan Roesch

This fixes the shadowing of the outer variable rw in the function io_write().

Applied, thanks!

[1/1] io_uring: local variable rw shadows outer variable in io_write

      commit: 01c620cf9e96b1355c87545ed26521deef4aef80

Best regards,

Signature · 1 line
Jens Axboe