mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	io_uring/net: don't clear REQ_F_NEED_CLEANUP unconditionally
io_req_msg_cleanup() relies on the fact that io_netmsg_recycle() will
always fully recycle, but that may not be the case if the msg cache
was already full. To ensure that normal cleanup always gets run,
let io_netmsg_recycle() deal with clearing the relevant cleanup flags,
as it knows exactly when that should be done.
Cc: stable@vger.kernel.org
Reported-by: David Wei <dw@davidwei.uk>
Fixes: 7519134178 ("io_uring/net: add iovec recycling")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
			
			
This commit is contained in:
		
							parent
							
								
									bcb0fda3c2
								
							
						
					
					
						commit
						cc34d8330e
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		|  | @ -148,7 +148,7 @@ static void io_netmsg_recycle(struct io_kiocb *req, unsigned int issue_flags) | |||
| 	io_alloc_cache_kasan(&hdr->free_iov, &hdr->free_iov_nr); | ||||
| 	if (io_alloc_cache_put(&req->ctx->netmsg_cache, hdr)) { | ||||
| 		req->async_data = NULL; | ||||
| 		req->flags &= ~REQ_F_ASYNC_DATA; | ||||
| 		req->flags &= ~(REQ_F_ASYNC_DATA|REQ_F_NEED_CLEANUP); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
|  | @ -441,7 +441,6 @@ int io_sendmsg_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) | |||
| static void io_req_msg_cleanup(struct io_kiocb *req, | ||||
| 			       unsigned int issue_flags) | ||||
| { | ||||
| 	req->flags &= ~REQ_F_NEED_CLEANUP; | ||||
| 	io_netmsg_recycle(req, issue_flags); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Jens Axboe
						Jens Axboe