From patchwork Thu Aug 8 01:47:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13756894 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B46468C13 for ; Thu, 8 Aug 2024 01:48:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723081711; cv=none; b=ooRS/g9iVPitJEnM6ZPlnzb2gmiPNLQtjWOgxQD3iaH4+pmYnFJFiVoIswB64/xJKMKx0vtUj97pLSfB6GKLwAjef/d78gU/7tB4JvLOeXf8JHzi5fEj26DibS0h27CQKvx6bmtqScMQkqtvOZiDOOspZsGdkk3nnotdtx3bID0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723081711; c=relaxed/simple; bh=6kniANUbgbJIQd+oMjEkgOnnY1/134tK6Kt7vfRhOd0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VgOApj6BBqym2rZRkXvrdUIsAWxEScy2tuTKkUcrFQYWZtAo5bKbhaMi9748H7C/UbYmsgrgKMW6ndCd8ngvraUGsEKXgblP2Sw2Uq7JNukrWs6FQAhFocaCJuENJ0XAPQsLVd72Ooy82y6JCMKVvN0zgkIgkMMgF4HuBfQfQ4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=QULpqcDy; arc=none smtp.client-ip=209.85.210.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="QULpqcDy" Received: by mail-pf1-f174.google.com with SMTP id d2e1a72fcca58-70d26cb8f71so35164b3a.2 for ; Wed, 07 Aug 2024 18:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1723081707; x=1723686507; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sgEdk/efCLokweNU/OQMz9jU5fZj6geKuOMQjp3pUWM=; b=QULpqcDylZSaQPkMVe4W3xbLvoWyJdXizpcrfxDSo3rQMFJu4SEphNu45p0ffAfEMh a2j9LbhcrnXbKe/iEAOHOD4ukZU1WgrTurQmrezskoKizGPRwsDYvVGPD44oXDp/m3Yc v/wmbZ68+YpQpHS7Kd6V9Jh80QcFpAfHqqCT2g1JX2o03b6mfIZ+lSKJx1XFV9A0H4OF ammlDiK56mLhj7YO7jw39FfNFyLe1IIDAoI37DIYa4exiH6n5tgxtOrVT1JEwCLQQSkL MszpyVNcLd9IYTnK8aJUnQXt7yqA8Eq7HBL8M1+SjpvALaX+tl7cBsKABDiSuQHoPJg6 Gq7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723081707; x=1723686507; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sgEdk/efCLokweNU/OQMz9jU5fZj6geKuOMQjp3pUWM=; b=jrYFQqKwOfGYbg+DmGjejPZnhx3rYAc2WptayP3ZSuIQoDZzUFexLj7iXwz72JWIBB ptbWwz0CMVr7O3X8lge5LBt4a0ZvwKfsZh8pvNeDKZZRDX/1cFjQmKuvqYy3kIxtkl+f kQQhA87+9v4aLIyoHJwhjlVp5ZCfenxKKZN8lPu/FiI4aYWYMU/mLHUH7s05wn0I8rUQ uG0T5GAvkRLqcIEfzsbjzx5pwFfnLNf4D7iLEEOZo8BKOxe8Jdv90u5e6xFC16bIAaCe HN5mSDfZ5XW93YMWlf8ka3XqPBDteF/ZylC/zNuCs3CehAOm2u9mVvtm4m6v8bR3OJ/k 3Fpg== X-Gm-Message-State: AOJu0YwrZZZzPfmlu0r0pq27w9NfzEeeXmZdFi4je3FYv7ILLSNoms1l cakqdR3PdYWzV9hbfYbUNEsS3ldslRTB6Vh20JMP3AW97ORlQmM6qhVA/7M+0fTnIat7cCK7ygP r X-Google-Smtp-Source: AGHT+IE64GyHq67VE8pirrW2FDU4RlqAjMQcz240MEYAq93zw87nqh1hYjRQUSstvSI4s0z8NpJcwg== X-Received: by 2002:a05:6a00:a8d:b0:70b:705f:8c5d with SMTP id d2e1a72fcca58-710caf37c8emr334551b3a.4.1723081707421; Wed, 07 Aug 2024 18:48:27 -0700 (PDT) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb20a104sm150771b3a.21.2024.08.07.18.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 18:48:26 -0700 (PDT) From: Jens Axboe To: io-uring@vger.kernel.org Cc: Jens Axboe , stable@vger.kernel.org Subject: [PATCH 1/3] io_uring/net: ensure expanded bundle recv gets marked for cleanup Date: Wed, 7 Aug 2024 19:47:27 -0600 Message-ID: <20240808014823.272751-2-axboe@kernel.dk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808014823.272751-1-axboe@kernel.dk> References: <20240808014823.272751-1-axboe@kernel.dk> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If the iovec inside the kmsg isn't already allocated AND one gets expanded beyond the fixed size, then the request may not already have been marked for cleanup. Ensure that it is. Cc: stable@vger.kernel.org Fixes: 2f9c9515bdfd ("io_uring/net: support bundles for recv") Signed-off-by: Jens Axboe --- io_uring/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/io_uring/net.c b/io_uring/net.c index 594490a1389b..97a48408cec3 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -1094,6 +1094,7 @@ static int io_recv_buf_select(struct io_kiocb *req, struct io_async_msghdr *kmsg if (arg.iovs != &kmsg->fast_iov && arg.iovs != kmsg->free_iov) { kmsg->free_iov_nr = ret; kmsg->free_iov = arg.iovs; + req->flags |= REQ_F_NEED_CLEANUP; } } else { void __user *buf; From patchwork Thu Aug 8 01:47:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13756895 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A49F1373 for ; Thu, 8 Aug 2024 01:48:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723081711; cv=none; b=UDzWWrjoWl22oaU2a0iHuqQvSI4taTMSIUMFOuxY6VQbAlbI7yI7pgWMszb1vrGTlDTvqLOJRACEg7/ApldIkcvLleQPgHHAkO4eKtzzBGjG8MjcApsP7RxW/G6aGOoSsvT1Kt+yK7LDP5U29lypQabALiCEjYTPy26K0Mi0x2U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723081711; c=relaxed/simple; bh=PFAoFW7oMR2Idvj6SJZby2kp8GCB06WLnCnGFRsccRo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WiYWzN/WOCl/utwJw5G/ARzGtgmcdRM2/8f2nJo3KMPTI9MmwFVgyFyC0jszk/qKp4mQvHdb61yNP877YBvNNnS7iSjoYqHJR3Hht+Qf7aBKrWyDS3HRqguDWRNbDQnv+A8yVh9d8vq0/LFrjpSnXxqeLoO06e5PFcPBEbImgq0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=t6buMSz8; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="t6buMSz8" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2cdba658093so93191a91.1 for ; Wed, 07 Aug 2024 18:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1723081709; x=1723686509; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rKTARnTjGZ+ji2YsLWEYUgv99KOMEs/vXXuNntX+GhQ=; b=t6buMSz8+7AyGJEUG765cpttwds9USlS3WNzIOWLUuYFZncKm159pRZAD7rWaSKt20 q9SCiFpSocbFH69Aedobuie2GkyJlS7SVzVNL14/Ott41znQOt8UD9W5EfP5JxElWiXW s4T62QTdo/X2n/OksmxsWFNH3AcnJ6CBGbExt+f3DXAE4OhvPOLPjJ9znYSN7aRYvILo 11mwtl6P+KDMS34B0LbrLMdPoAODhX8xMWUGqpJAQlTgN9KEGJcRqHCfMv5CqVY3Lso/ 3rkWxG+KhWKfbncJ+DWAG49BJ87rbwh6PxJPvqlLqcVHSPMHX2xSqTet1ImJx2hu+Mmd Afyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723081709; x=1723686509; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rKTARnTjGZ+ji2YsLWEYUgv99KOMEs/vXXuNntX+GhQ=; b=CawbDhSJimpPtQDMAY3hZg8lS59Itzh1JHzLt6qcw53tmAnJ91Ysgydf7lTUWqnipM xpEvNLeRgsYqlavHGGQgW2hQfh2ryt+bqncsxtRqzicaaY8SjiLGtJPbUE8nZBCUw/0S 4q818chuadguBrBrKKG2bpFkJshDvaFoGT/dC8YfL42bRDZLQEdAQMNiilsCTB+29Pus +23qAj9ySBXSU4DHqSvrMQXA9vjyXGwCmk8FhyiYvkpMGXOXPbxXu7VgF/6SDEMCsnVc SW6SgDjADBxaVjCy6VbCJXkBU5fadij4Xsky2m24Dh/MQQbFpnSS+l4963X6Yiu+whNz 5QBA== X-Gm-Message-State: AOJu0YxadNIqv4C6DtqtJempT7vECS5adyafL3d9xs3DxqUuRBdXQbNX HiVINV6aI2AEwDs1t7QI/yphP+UoaQHnkGGeaAx9V0lAk1HDbe2/CZgooT19FBFUs8x5tmaLAeK m X-Google-Smtp-Source: AGHT+IFU9HmrxHI7Fux7WSDeBe+TVG0pfJIsSOB4Hr35Hmvb9Qdnjf+zoaYf+gE+nvbA4o1ITk4Wbw== X-Received: by 2002:a05:6a20:6a1a:b0:1c6:a62a:9773 with SMTP id adf61e73a8af0-1c6fcf80146mr208842637.5.1723081708994; Wed, 07 Aug 2024 18:48:28 -0700 (PDT) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb20a104sm150771b3a.21.2024.08.07.18.48.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 18:48:27 -0700 (PDT) From: Jens Axboe To: io-uring@vger.kernel.org Cc: Jens Axboe , stable@vger.kernel.org Subject: [PATCH 2/3] io_uring/net: ensure expanded bundle send gets marked for cleanup Date: Wed, 7 Aug 2024 19:47:28 -0600 Message-ID: <20240808014823.272751-3-axboe@kernel.dk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808014823.272751-1-axboe@kernel.dk> References: <20240808014823.272751-1-axboe@kernel.dk> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If the iovec inside the kmsg isn't already allocated AND one gets expanded beyond the fixed size, then the request may not already have been marked for cleanup. Ensure that it is. Cc: stable@vger.kernel.org Fixes: a05d1f625c7a ("io_uring/net: support bundles for send") Signed-off-by: Jens Axboe --- io_uring/net.c | 1 + 1 file changed, 1 insertion(+) diff --git a/io_uring/net.c b/io_uring/net.c index 97a48408cec3..050bea5e7256 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -623,6 +623,7 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags) if (arg.iovs != &kmsg->fast_iov && arg.iovs != kmsg->free_iov) { kmsg->free_iov_nr = ret; kmsg->free_iov = arg.iovs; + req->flags |= REQ_F_NEED_CLEANUP; } } From patchwork Thu Aug 8 01:47:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 13756896 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 224E6BA50 for ; Thu, 8 Aug 2024 01:48:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723081713; cv=none; b=ZYAlTHZXoS1bAe6vc2AVTm29cgDpwytqKnNbsNYICSjFoTE95/EKoW42gxheELVOwV7lpi/+jcD3sf9xcgbT9H3p3V8G8EHtlIOCd5itc376H/QJaZRCOeL9jASdJzhBxGYb/wM4evmRIEURK4ppaoD41ycid0oCP5oTLNauKN0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723081713; c=relaxed/simple; bh=Olz8+B8JExXtrS6yDdKY4FVncYtOGs9iB4C9qeHIJJM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SSnVkBY8BoQSTRkQIob0j55ippl+FfHvosXsuxc8Nkt6zzo/rQg2a1ILJBVkNiFAQfj9+Fx2srptLW71DyaH/07yZetyRVoWYh91cFpwRw2hHmaRQwWQJaGqUWo8yggGyxeaHQ1XZ0HA2BwVpHTjS9Hrr7SivLkGQov17uni+tY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=Oo8MyIGW; arc=none smtp.client-ip=209.85.167.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="Oo8MyIGW" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-3db199ec527so53349b6e.0 for ; Wed, 07 Aug 2024 18:48:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1723081711; x=1723686511; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kEsA/NppsdV/3COw8KfaFKbZSK5vL24oUW1cM/bymMg=; b=Oo8MyIGWTFXIqQHxBa7X+caSv1t4Jrtdve83Qy6kZuLNGtTX9HWmm0bX8vHUwBlYmj +jG6WDKTWOMeQGEZTx41fy0B5nzTpXn3o+Kok4bGQhV16IZIED6+ea9RrrAWz1Yr2tQ/ W2oYfAjQM0O63OXeTZLZWF24MYh8bboedaR0P+A1vU5cV9FryKIsHPP2qwHbjPOTdEZ8 jAu3VJmV3DUG37O604YpuncTYjyzzIbMILlVOYgTKYLbvs3MRwKAsnRgwjUxhGNypLgd ys79EkZTmkW2L1wt6KwKOMuzITFVt0Asu6yFNAiJszhbZYi1eSsMCqMIoPMmpR1HhD3d cH0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723081711; x=1723686511; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kEsA/NppsdV/3COw8KfaFKbZSK5vL24oUW1cM/bymMg=; b=XK+2HVC5KtImUzs74EJHdrAeodHRmFbR+NuKjf3NbBBcxRN8+O0we+Cdiytvn/Rklr oBVbBxow0wbHSAjqVrb71XIixviYebfgqF9Q3KkFteNegjk/ad52DMkI0MytctAhGG0w DnKC+RNrv6QBvl0ZYLKgqepA8XVMkMizrZ4AmRXoIbgbk5O0zDhTDPYYxCnil8YEQYAY JexaTokrbSCY8cCTBtNTPfNmvbTefx/n3IzvpQWBU07QrENMO0/a1QnjtNviWB4OQt4z 2kkmUjoEfVGUmcJhjg5ceJ/eKqTrWRLkQmNFLK5fPc3RQf4Tw07GSPUsX3lcBu1hXWrV CCUA== X-Gm-Message-State: AOJu0Yzh4/Z2mIMkhYqZrOKagSImjmb8tvTxXRwANOgmwsNvAnQ/EoqY kYITdou6XYsBWkoUDmZp0MuZNy1VsiOxgfBTTBAGfeODsdo8ky0NYS951Kbizy4SntPAt9psNqi A X-Google-Smtp-Source: AGHT+IGw6CzHlEF3KWib4NI1xrULkrIxi9F/79yXLk6ouOiEL0cJSpes0zwqcCwz3YxbRtUO00ebuA== X-Received: by 2002:a05:6870:568e:b0:268:2075:a41d with SMTP id 586e51a60fabf-2692b7a4561mr280377fac.6.1723081710693; Wed, 07 Aug 2024 18:48:30 -0700 (PDT) Received: from localhost.localdomain ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-710cb20a104sm150771b3a.21.2024.08.07.18.48.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Aug 2024 18:48:29 -0700 (PDT) From: Jens Axboe To: io-uring@vger.kernel.org Cc: Jens Axboe , stable@vger.kernel.org Subject: [PATCH 3/3] io_uring/net: don't pick multiple buffers for non-bundle send Date: Wed, 7 Aug 2024 19:47:29 -0600 Message-ID: <20240808014823.272751-4-axboe@kernel.dk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240808014823.272751-1-axboe@kernel.dk> References: <20240808014823.272751-1-axboe@kernel.dk> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 If a send is issued marked with IOSQE_BUFFER_SELECT for selecting a buffer, unless it's a bundle, it should not select multiple buffers. Cc: stable@vger.kernel.org Fixes: a05d1f625c7a ("io_uring/net: support bundles for send") Signed-off-by: Jens Axboe --- io_uring/net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/io_uring/net.c b/io_uring/net.c index 050bea5e7256..d08abcca89cc 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -601,17 +601,18 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags) .iovs = &kmsg->fast_iov, .max_len = INT_MAX, .nr_iovs = 1, - .mode = KBUF_MODE_EXPAND, }; if (kmsg->free_iov) { arg.nr_iovs = kmsg->free_iov_nr; arg.iovs = kmsg->free_iov; - arg.mode |= KBUF_MODE_FREE; + arg.mode = KBUF_MODE_FREE; } if (!(sr->flags & IORING_RECVSEND_BUNDLE)) arg.nr_iovs = 1; + else + arg.mode |= KBUF_MODE_EXPAND; ret = io_buffers_select(req, &arg, issue_flags); if (unlikely(ret < 0))