From patchwork Wed Jul 24 11:16:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13740858 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) (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 001A41514D1 for ; Wed, 24 Jul 2024 11:16:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819767; cv=none; b=OePL5rQHz69ENRIR/Ii1MwqMNVe3V5m33mcAkHfJ12GCkPOvwmyKzKI8uEHfZ9hQj4rKeGy330Y4Ry8AAZJBdQ3m0zDPtHT5WYtlpNCOz8eK9WAgzZtXOaBn5VZ39cgCGxR1BSJ7OpJyZZ88isJtrhOa2XPZJPOs8DL7neIEx1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819767; c=relaxed/simple; bh=iG65+nAGu0sNmZ5b7VnU6xMDRHf+//JiPwt1wQ3bvIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LjCx/cgerRXJeW+TykJCvWgQpnK2z2XQxcAGBuLEEe+ahDfYC1zi6VQzFzcjaaa3l+WCFH1V8XzumMrPcIVE9fqnEslJ/OGjxRyP4VNkG3wleAPcvgyXKox3uiVs/fGOdSFuM7xdVHqEma207yHOEM8u8AVM9n+ihsozTTkHmyk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=F5O3VOhB; arc=none smtp.client-ip=209.85.208.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F5O3VOhB" Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5a88be88a3aso3377855a12.3 for ; Wed, 24 Jul 2024 04:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721819763; x=1722424563; 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=cEKh47UkaXuj2JEDyxIJELJBdvBHFKRpFhvKFN8rQ6c=; b=F5O3VOhBiAazdEMixraA8wKom5Tmvz18AfLjTNLGPTs7h89kB/eR9RiR0BHR5qQxrR JLmXNLCVnM2Ee92G7uaBxYsGjifyqdGT5g4bjzcskFHphJ1HYaYvwbGhrOfa31/gFLoL rafoEUFcWAT37V3Bl4N4zlWw/XhTSiKMDQdCWhORuV2Ngnm4X2Bjn3Q0ktwuTR4B6760 DlhifvjkuTNKVbnEQvoQRSYrfJEWLDpOHvXCRLURYpaVh1R+b70HVTSHqMjS57G4qkGR ja0MKXJ5BkZtMfAsSyfheDr9XxNlWeFXFGsgFIVgiWR9iuPFOOwE1lmQLkdn3E2BMZpO Ywnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721819764; x=1722424564; 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=cEKh47UkaXuj2JEDyxIJELJBdvBHFKRpFhvKFN8rQ6c=; b=CfD4/nC9wJDBtNjtwBIDCCMqsFVCJzjEeniG4faOEJgqjGhr4OjVBvgH87ybSTQnUd ULOCie9uLFZHs9fR0/tQmE0ZGAIHk28JLRY/1t47Q7hWY3jknL58jzgAM0hguA/kThya TklC9IgOGtqR1Uy8bWizcKg+wCv8IshGfy8GHY5tJfwUGF0BWym9xSQjNHGQ3GWoTZCM bjkrnF/awhSWgdlJeIlIlZ8Q+kfOBlOU9v4JWO+tQ1/CulSm69E+X+VZI82PFv0ZAgCX l/x/lqdpi+2C8jRvLaeaCaeIgYwmGKmt5NC81Sbmyrzd5Sm/6vMZ/qKwN3PNI7EgncoT nDdA== X-Gm-Message-State: AOJu0Yyi9CJ71RM2l+s4XbMKq99qogzE+yzKZtAII6yVellWO2edtor9 ovjNZYGtXMGWYiMsHeJYcsxcc90d0vaKRqcER77Ga7vo+XKh6gj+J0SUUg== X-Google-Smtp-Source: AGHT+IHmKQhxQhwAf1/1ocmmeyE1A2GQoZ/LPgTq23xnLudN444MRte9AQ3mU0WNXnExDCEJ6njXfg== X-Received: by 2002:a05:6402:4302:b0:5a1:3b03:d0cb with SMTP id 4fb4d7f45d1cf-5a47ab120ffmr11833462a12.32.1721819763532; Wed, 24 Jul 2024 04:16:03 -0700 (PDT) Received: from 127.0.0.1localhost ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5a745917f82sm5006310a12.85.2024.07.24.04.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:16:03 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH 1/6] io_uring: tighten task exit cancellations Date: Wed, 24 Jul 2024 12:16:16 +0100 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 io_uring_cancel_generic() should retry if any state changes like a request is completed, however in case of a task exit it only goes for another loop and avoids schedule() if any tracked (i.e. REQ_F_INFLIGHT) request got completed. Let's assume we have a non-tracked request executing in iowq and a tracked request linked to it. Let's also assume io_uring_cancel_generic() fails to find and cancel the request, i.e. via io_run_local_work(), which may happen as io-wq has gaps. Next, the request logically completes, io-wq still hold a ref but queues it for completion via tw, which happens in io_uring_try_cancel_requests(). After, right before prepare_to_wait() io-wq puts the request, grabs the linked one and tries executes it, e.g. arms polling. Finally the cancellation loop calls prepare_to_wait(), there are no tw to run, no tracked request was completed, so the tctx_inflight() check passes and the task is put to indefinite sleep. Cc: stable@vger.kernel.org Fixes: 3f48cf18f886c ("io_uring: unify files and task cancel") Signed-off-by: Pavel Begunkov --- io_uring/io_uring.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 8e6faa942a6f..10c409e56241 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3031,8 +3031,11 @@ __cold void io_uring_cancel_generic(bool cancel_all, struct io_sq_data *sqd) bool loop = false; io_uring_drop_tctx_refs(current); + if (!tctx_inflight(tctx, !cancel_all)) + break; + /* read completions before cancelations */ - inflight = tctx_inflight(tctx, !cancel_all); + inflight = tctx_inflight(tctx, false); if (!inflight) break; From patchwork Wed Jul 24 11:16:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13740859 Received: from mail-ed1-f43.google.com (mail-ed1-f43.google.com [209.85.208.43]) (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 30FFD155C88 for ; Wed, 24 Jul 2024 11:16:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819767; cv=none; b=WrELCfoX7Qcvr+r4+VJv+uionlz6jJ3yIJO1nqdVfqXtNrODOYp+T1Pzw20bzr+KtqXXgkYlzbNx2iTl8ONpRiTxx08+jcsNrnYgncz+RO4m4Prsf1NHZlxEw75LVaeWzXXao45SbqM0vjS+xKxqfUXdqkMCsSAAbrx3G5JEhno= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819767; c=relaxed/simple; bh=05EpxvT1cTYIgY/t9g4gbpe2wKiIfso/7xdZWHyZpBk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AoH0ViQhf2EDDKtqngWr4mAyb/tAmpFxQlufW8tPB/WoVg2hT8rmY8qzD3CACam95nPfaMTpAI/7UQIrtoP+Q+6wSuFyF/X2VLWBJ5TQ2fCuq0rborK4H2lkQKiWKu1YaDjD1j0F+v2shTrLqiQQRkSkIiytP8KRs7Bkv2FBXbg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bOXvp2QS; arc=none smtp.client-ip=209.85.208.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bOXvp2QS" Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5a156556fb4so5892971a12.3 for ; Wed, 24 Jul 2024 04:16:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721819764; x=1722424564; 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=0gOWOrFeYLgn3gX7zaNQQ941x9glpLybPAboBIfEaVg=; b=bOXvp2QSoFERMxthHeaM2BhrL2wvzcV964ziGhwgdl0oXk8VozzXFJPVrJPZWTCEKd J9TVFaakbma83nZYmGiQv5rv1RYTfFvnYBaqxA+QofcUKTiLNAYHc4ZAZVDHPHO0VuV4 YplLmYf+r8+LfRWNp1m25jhaPeFgwCtO2xtHTOiWyBLj1I6Jr2sHdFspmoAcliZ7lQ5y B4X8HH3rSuRLxQCDwfS5T0GE1SwQcIRXpUCHs1F6ajVXa27mm4Q9bPwqGji/nl4TVX1O D9vcG6f3hqujmm8OLlqlM2HYxRPeF+oM7w29ZyvMbhn9U77wGS4yHd/5QK4j6KKcmzZD J7OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721819764; x=1722424564; 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=0gOWOrFeYLgn3gX7zaNQQ941x9glpLybPAboBIfEaVg=; b=jaCN2daSiFxsJeiN1/jSr6Hsygx3vmlFfc3nJglLPs0vfvpI60WqcLmnzoX2EiBzYS w1gkTknVp+khx+v9C4+7iZxSz6XJqSpbRkWbX4jRMbRx/CNl23I4m3nuknmo3JwwV2vF EjQ7nxpq2oNzpDcNeCsoAJdrFSictMgOyiXUHct/UwQZH/7zAnGnFoJzHLGXDurrPeuC Z2te/bY1ZiNLfwl1B1vUJnFs8jcTojvKBc1VwD3yWozGGyHOILQOb1bQTXaqPWhDxcDN jFAg45rdhkEdhvZTOKwwFj3ezIzPClYJVMoImg0blUiyFxWbcF/wLs1K/IC7QgYVAxwY YweA== X-Gm-Message-State: AOJu0YzxTM/Iq6mYnkwpFPKkvbywXivtKu+zeheR6vCkhjGSGxArlU1V 9YZm9BDo7dC6VQI+AR3KZ1LULjX2L0vxfK6XI7pABh9IS1NTCLl+Ufl+Xg== X-Google-Smtp-Source: AGHT+IFrmRRvnjKmcNxIc2XRzV44esAikkNrC4VT2HD6OJRaqVy36LPyLno09N7FadspzKpmr2cg0w== X-Received: by 2002:a50:931a:0:b0:5aa:32bb:146 with SMTP id 4fb4d7f45d1cf-5aa32bb1193mr2490845a12.38.1721819764129; Wed, 24 Jul 2024 04:16:04 -0700 (PDT) Received: from 127.0.0.1localhost ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5a745917f82sm5006310a12.85.2024.07.24.04.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:16:03 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH 2/6] io_uring: don't allow netpolling with SETUP_IOPOLL Date: Wed, 24 Jul 2024 12:16:17 +0100 Message-ID: <1e7553aee0a8ae4edec6742cd6dd0c1e6914fba8.1721819383.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 IORING_SETUP_IOPOLL rings don't have any netpoll handling, let's fail attempts to register netpolling in this case, there might be people who will mix up IOPOLL and netpoll. Cc: stable@vger.kernel.org Fixes: ef1186c1a875b ("io_uring: add register/unregister napi function") Signed-off-by: Pavel Begunkov --- io_uring/napi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/io_uring/napi.c b/io_uring/napi.c index 762254a7ff3f..327e5f3a8abe 100644 --- a/io_uring/napi.c +++ b/io_uring/napi.c @@ -222,6 +222,8 @@ int io_register_napi(struct io_ring_ctx *ctx, void __user *arg) }; struct io_uring_napi napi; + if (ctx->flags & IORING_SETUP_IOPOLL) + return -EINVAL; if (copy_from_user(&napi, arg, sizeof(napi))) return -EFAULT; if (napi.pad[0] || napi.pad[1] || napi.pad[2] || napi.resv) From patchwork Wed Jul 24 11:16:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13740860 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.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 F09DA14A4EF for ; Wed, 24 Jul 2024 11:16:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819768; cv=none; b=YC1KAKaHOotY60vHNuK7XNswLT7q4zLadPDVIGsEQZ95WcTNmgBHowNIB9ByoIgqQLOlQr1vN+mv5oMyLDxSAdX+5rZo9t7HVYwPIgC40zszVEyzSjJJbTo5g4L7xMPRTCkzk+yEwjeRmYenVAat8/uRwHKJkVcBK/CneYy+64U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819768; c=relaxed/simple; bh=3sdvc815DW75anbjVVeV+zP+kZVDiZoG/xwWKJkzMrQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HtwZEn2ctZjt3uuG91MC3ICqPI0jICkFR6xStnj0uSKG/MUHo6iVGM9FTmqPzUw3/4jiKYP9pn1van1fgDx2410stKQyStwA/77aqutH0uw5expN8zVAaIeikcSDQ3teNnyZIixu50DnYUBWYKef5hL0SL9jKlrRixYH8jUfJx0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=H8K8S9Be; arc=none smtp.client-ip=209.85.208.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H8K8S9Be" Received: by mail-ed1-f50.google.com with SMTP id 4fb4d7f45d1cf-595856e2336so1394236a12.1 for ; Wed, 24 Jul 2024 04:16:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721819765; x=1722424565; 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=K/70Vkq2b20w7LRsi+Hhz8GdJRzslLKPyFL21ZYqpEk=; b=H8K8S9BeE/w6B3wRBIHoO2BhxU2FRXPWC07IaQO7KVfWSYuzZRZjud6S2XI06aEJqV jGVEGpiQLPhevii5/ENmL4/puVjDxeqhuAuqGws1PqZGfUI3/StNxcH5VFrY+6dMm8FT vOQwdx4XgGngfyZy1bvFmUVbrJpy+02RFBe7E6USph+oqWtNoB1YriBthTbRFp9zzpXT hCrUjEHqshcT8Kd/2T2b6FuL+hYCOyRhdkbbbYMo10EvhD60Bsn8oaY0NgcMQQLMiHxL s9GkT52seqQnVsQfQCVzC368JPkeYdKunHybjzE+y5uBPkak91uAMC4Zu03TFrvX2V5R 08SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721819765; x=1722424565; 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=K/70Vkq2b20w7LRsi+Hhz8GdJRzslLKPyFL21ZYqpEk=; b=naP9DMl2oPNt0ABIlteQSy5rNX95twVvOdqoEWaIQwPp80IDYJ/W7vsIbRl1PaPUyp 4fqo/dA49AuAGMK47NxgKYACtzOEUDxKLyXitPJ6JmwLtei2rXF+N+zBbNywbfEjPFcj vJTMS/vErKdfZkA7H7e70rREywrDIb9pXMdnMT7q8n4C+AG20edAr2JRYopLgHwSkv5l IW9yTBnqMussNDj6dlTEJXT4R3kmSe3Hwt9eyeUBr3WTjaXXE2qmYngKiQ1ALkByGMnm K1om5K5zuHV5rUvaUipGfA4AskyEnQSZVqv6qKIm31vu2afetOrtim2s0/u5u1a5QHG1 +n0A== X-Gm-Message-State: AOJu0Yyi3O4R/bhB5rV1O6bFVr04S30aDCRRQAdV/oP0wzvwzpUMq8S7 tCPtPrJlroH2Iuoe3l3D82JzwW3zCkAg7jRxiGCg3I8pFYsLDlERD/eoDA== X-Google-Smtp-Source: AGHT+IHDKhUlpcs5d+NDR13HMumpqPfVusW/o6e463ggbj91rLCq7XVxhxWY0rs/xely8XEbgn57rA== X-Received: by 2002:a50:bac2:0:b0:58c:b2b8:31b2 with SMTP id 4fb4d7f45d1cf-5ab1b44f534mr1214885a12.17.1721819765102; Wed, 24 Jul 2024 04:16:05 -0700 (PDT) Received: from 127.0.0.1localhost ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5a745917f82sm5006310a12.85.2024.07.24.04.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:16:04 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH 3/6] io_uring: fix io_match_task must_hold Date: Wed, 24 Jul 2024 12:16:18 +0100 Message-ID: <3e65ee7709e96507cef3d93291746f2c489f2307.1721819383.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The __must_hold annotation in io_match_task() uses a non existing parameter "req", fix it. Fixes: 6af3f48bf6156 ("io_uring: fix link traversal locking") Signed-off-by: Pavel Begunkov --- io_uring/timeout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/timeout.c b/io_uring/timeout.c index 1c9bf07499b1..9973876d91b0 100644 --- a/io_uring/timeout.c +++ b/io_uring/timeout.c @@ -639,7 +639,7 @@ void io_queue_linked_timeout(struct io_kiocb *req) static bool io_match_task(struct io_kiocb *head, struct task_struct *task, bool cancel_all) - __must_hold(&req->ctx->timeout_lock) + __must_hold(&head->ctx->timeout_lock) { struct io_kiocb *req; From patchwork Wed Jul 24 11:16:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13740861 Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (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 DAE1B157484 for ; Wed, 24 Jul 2024 11:16:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819769; cv=none; b=nQnSYF1z/5L5UV4ttbFLVGlFcySKn3ZAH5jfCkwqD+xKfjoOms7zR7YEJRjzjplqJ0pIqOY50nkXyCAvDtiMTfSBg4ijluQPtHuI68A5mMYRKO7J2C2ObxGTCCxBlKETzBwA2b63yDfQv9Fi++Z1FUjQDs9GHQIK8cpJCRVeqFc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819769; c=relaxed/simple; bh=U/Zrm74Y6bAZ25qPGoTmtqdhNvJvPc6f7rwdKN3JKLA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=npp5GzKkS8ex8Ez/EuqyX8zjht8dbN6OobDlhuIUvmcMQEpcvMnHK9kXHT5wQqVTuR8oioUOz2frDnGosvpF2nKC+sUOZnxRl438ct9o1zQr5lE/2fV8Sm8mR5lzTqD3XYuWsGitWw2f51FU9k7eoOA63Hd4o4YlRI7DMI++uko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UtCutIds; arc=none smtp.client-ip=209.85.208.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UtCutIds" Received: by mail-ed1-f54.google.com with SMTP id 4fb4d7f45d1cf-59589a9be92so6447491a12.2 for ; Wed, 24 Jul 2024 04:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721819766; x=1722424566; 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=xPXl4cyMnqaZjdoGQ/w6s2umAK37vqhIOacq7LqJQpU=; b=UtCutIdsJp88fncPzip3xVAUBkyDcBl0Dp7Qy+T/yB6+7du97bq+ILhUWSoXXlW35v C6vzrOD3gwMZi4j8QlqS30QIs824T8v8w5lB1DZ4j71+S9bilHFwkMirDw2L16DL9qd2 BdG2yIvLKF3yeBZyWJvtrOCXgywzi5+mTz2peqvqNNLMuZs71/yyTd5t+4TZrLuH3b4p /pEdx8lVuSjRenwgl9oLA1Pyok9LnPN5Iuaj8bIcl5t+oDEDknci8OgmBLPSgI9iKLEu OHxLxxWh7gJ/nvnmkuumLXJjKw3iurY7lrl+rSsHC9QHrT71n5ki1rEzS0QU7u/Lc0Br BCYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721819766; x=1722424566; 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=xPXl4cyMnqaZjdoGQ/w6s2umAK37vqhIOacq7LqJQpU=; b=dcflJldFLEuvYQ2VgDNcIpggkC+/VVTrZTviB+HdXdm4JHOvEz1QG72lLBBDnTVphl aYmiRK0cgnjUL4uwOD4RB4mCXF+tEQEaphXc27Ufp0HjYwI1pKkWRA7fAH9UZ/iARgYt 1/0znxB+UEySlckGGYrCnvYkcKN9zUUVDYMJgF6mtlt1iKNmdVFWP8qqIn68bgPLj+fW eiudwgqDTRTMrQ2R8iRnI6/5udXiIbdoFE4kqc9DPomlSiOXx6MnhSdQEZPcXE/Oid10 wyr+Vf58ebxbI8kO/VZdlHEXVGvb74iAWqlTsVoVF1z7mOcVlnLCyPXVWi89Kql2lDWJ mj8Q== X-Gm-Message-State: AOJu0YzNwejULFCH/0+f3Dn2/yPbqG144qlLz7Qz9MX9tD7K3FM4IbqZ CslaX2gcFKIibzmsSI9G+MveMEyKRzuOLjnNpZcf7vRULRpCCcQYfyFXZg== X-Google-Smtp-Source: AGHT+IGCLGMScdOnN+Dl3YxvFDSj+VPB2oSzGfhyA9J550z4GqCQ9mWckBWoDvEk/YoW21/wspYrqg== X-Received: by 2002:a50:9e48:0:b0:5a2:87d3:6ee6 with SMTP id 4fb4d7f45d1cf-5aaee4bd9d8mr1159541a12.32.1721819765971; Wed, 24 Jul 2024 04:16:05 -0700 (PDT) Received: from 127.0.0.1localhost ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5a745917f82sm5006310a12.85.2024.07.24.04.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:16:05 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH 4/6] io_uring: simplify io_uring_cmd return Date: Wed, 24 Jul 2024 12:16:19 +0100 Message-ID: <8eae2be5b2a49236cd5f1dadbd1aa5730e9e2d4f.1721819383.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We don't have to return error code from an op handler back to core io_uring, so once io_uring_cmd() sets the results and handles errors we can juts return IOU_OK and simplify the code. Note, only valid with e0b23d9953b0c ("io_uring: optimise ltimeout for inline execution"), there was a problem with iopoll before. Signed-off-by: Pavel Begunkov --- io_uring/uring_cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c index a54163a83968..8391c7c7c1ec 100644 --- a/io_uring/uring_cmd.c +++ b/io_uring/uring_cmd.c @@ -265,7 +265,7 @@ int io_uring_cmd(struct io_kiocb *req, unsigned int issue_flags) req_set_fail(req); io_req_uring_cleanup(req, issue_flags); io_req_set_res(req, ret, 0); - return ret < 0 ? ret : IOU_OK; + return IOU_OK; } int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw, From patchwork Wed Jul 24 11:16:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13740862 Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) (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 4523814A4EF for ; Wed, 24 Jul 2024 11:16:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819771; cv=none; b=TjRH5bRMoDyVMKKrFQ8HflQDWe3ZtZetB+AnY1niQA1On83zm8kS0B/3zgxlYb9rDzpoxIt+yWyqJhzfChO3G9JORjR4lwiGv8PsqO9/54aAhaeHAopLZRWuko3sllRuJLnZtyohypmI2+ZyJJIKRkPSO2oFVjmoixg3lZAWLJU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819771; c=relaxed/simple; bh=imeA3vE4jQrsL5WVBvXJe96G47DMdm+AVT4a1WuBEj8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=latm7HWxqIYvHfiB8AQ8YeApKKJoXkad1HjW/vEIzUacIFjL79fsXtxmEIkZKhT9S9N21ZJS9v3TXbZT7gGTgRMmaW+XHdwWu42ShMn9tb/zjZDQ/VvWvPN2kxCm1rHBvu6u/wANS1FkJH1d9ur4oJB0iCqLeWFQY+a+hw1Bxxw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=D/blJki8; arc=none smtp.client-ip=209.85.218.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D/blJki8" Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a7a91cdcc78so89634966b.3 for ; Wed, 24 Jul 2024 04:16:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721819767; x=1722424567; 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=2IDRXaD5aJDjvygbnrDO7lP8PgaoSxeYXNcOZBIEhtU=; b=D/blJki8F3ekO150xyABaeEWCF0gWX68Yfv3LvUNZ7jGiyrUowiBAHuEAAL7VzjmWJ Qxu4GQvpXEEmRo4xn6X7tCiggAWGH9VQz6JAtxYjVrUMWX7tLbM4sWzgtZ3QI/TRb037 BYYXk2+eDMs3CFNxq9Ib1KCZd9D+ALEv4xh3WRHp7wtLD54TLIRm+rsYFpHrdhBkm10t KeCObRPHMU7KRvTH1xjY1lQPqv3oUfM9x63AcDPCkYeKJBeNizXmbUZ29b9S5suwWP75 jMsGuzkTIusZmSSt6vfE31qfWV2Ncua6SzND129NZsqNZ5YGuXLEga5nk3IWewgxPR4b TyZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721819767; x=1722424567; 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=2IDRXaD5aJDjvygbnrDO7lP8PgaoSxeYXNcOZBIEhtU=; b=CGik0m5kHJHxJrMDolw30WS6DqV2ts8XJQM/0Pc6r5o9wcslyDuvJZsXsJN7a+xYAB lq/dBJh3jsknSD0xDYlniZEObLANHl0W+jchuvCnjY9UftmOEQJucRaNbX8ulvrBTR0f 7APu2stlGh9wZUEWcfdDtqflzO1g5y4ahx2KjuWZDHy9aCgFbi8gJJdSLXPa+a7xDTJi KqTxFBtJjp5inBZc76UHddG+udNM9757Mq3dk8z6PIP5OFg7kXP4NpyB3ZwKeWPg+zIp DhS1ip37xw60C4b/+x4t+g/IjJrrBYH0tQzKcpqhUdyvkSmGfH4kkQDPIwov9jRzPh4U Bsqg== X-Gm-Message-State: AOJu0Yz3/F3mjE4ZXEg0X7A63DXQGXYRrkAEVdv/LYnHk0BMGHK2mb2t wmTBIJyqhE/DI3jT60s8x6XC4HEdqa9XYycAnJ8RM0393fl5oHqSOh7BQA== X-Google-Smtp-Source: AGHT+IH2lv7jpxntTtf99KZMZ/2/kqB4CMCq59l9/o9GslIn4aYm3rwqA9TQgEAGkvkbd8GyqQ1EFw== X-Received: by 2002:a50:d7d3:0:b0:58e:2f7c:a9c with SMTP id 4fb4d7f45d1cf-5aaa50c9dbemr2320548a12.26.1721819766917; Wed, 24 Jul 2024 04:16:06 -0700 (PDT) Received: from 127.0.0.1localhost ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5a745917f82sm5006310a12.85.2024.07.24.04.16.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:16:06 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH 5/6] io_uring: kill REQ_F_CANCEL_SEQ Date: Wed, 24 Jul 2024 12:16:20 +0100 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We removed the reliance on the flag by the cancellation path and now it's unused. Signed-off-by: Pavel Begunkov --- include/linux/io_uring_types.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h index 3bb6198d1523..e62aa9f0629f 100644 --- a/include/linux/io_uring_types.h +++ b/include/linux/io_uring_types.h @@ -461,7 +461,6 @@ enum { REQ_F_SUPPORT_NOWAIT_BIT, REQ_F_ISREG_BIT, REQ_F_POLL_NO_LAZY_BIT, - REQ_F_CANCEL_SEQ_BIT, REQ_F_CAN_POLL_BIT, REQ_F_BL_EMPTY_BIT, REQ_F_BL_NO_RECYCLE_BIT, @@ -536,8 +535,6 @@ enum { REQ_F_HASH_LOCKED = IO_REQ_FLAG(REQ_F_HASH_LOCKED_BIT), /* don't use lazy poll wake for this request */ REQ_F_POLL_NO_LAZY = IO_REQ_FLAG(REQ_F_POLL_NO_LAZY_BIT), - /* cancel sequence is set and valid */ - REQ_F_CANCEL_SEQ = IO_REQ_FLAG(REQ_F_CANCEL_SEQ_BIT), /* file is pollable */ REQ_F_CAN_POLL = IO_REQ_FLAG(REQ_F_CAN_POLL_BIT), /* buffer list was empty after selection of buffer */ From patchwork Wed Jul 24 11:16:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Begunkov X-Patchwork-Id: 13740863 Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (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 F05D8157484 for ; Wed, 24 Jul 2024 11:16:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819772; cv=none; b=TGC1k9ZLt1Neop7hb1pQsmx4P7EhiMjTDiJIaVSJ6peyelTnMQlhh0LO2cT5TUf59p/5LUgDq/BusexZadNhY1982dbRHovT3B8bv3kR8UX1y2F7Co5fyZJHAyqc4hjEuAIP0zjRMf3dIWD7S7BAwB39Kgu0+UcmItTMNycfa08= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721819772; c=relaxed/simple; bh=YhY3z+W1X0D9gHwO7eWabrVEsRS6BZJMNPo7BZbqWNA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XDsuvFLXci6dsJjpJbMtJ86GuQ1PF8USuTQYYVds4Rzsnzi98ztdaO+OkerpEW9gjfmyt/1NABSeYSalVinsqTd1fzMjAtXk7RSvi9q5pkuMLq/pFxrOFOg4simm1iepFZnXtJQ9jp59jLmaSUZVIE5mtZvjrHjqCbpdcgIqUIY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PGzN7c/D; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PGzN7c/D" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2ef248ab2aeso60578191fa.0 for ; Wed, 24 Jul 2024 04:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721819768; x=1722424568; 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=YlfOiDcV+xFMbCLirMw48k16oIhVBdnv0gB3Y16FZ4E=; b=PGzN7c/DOVOJxvRTTL+RBPVsJdxCgdJQ3u2Zmc9B06VyzibkWtSyCaBTxmgMNi9fp8 vsBqxkTBrQpX4CvFUb26geThoyUJRb9rhDluMfAjqk3KWN1+p9KRE0XSxUrPHKZ273F/ i/FwVCZhf0DSYcYFAF8RCgfWSNVHlIm1x67c8wAy2h6oSYJW2mpkxOX6evdHbnGMHbWK NdUKw2IanhwxL9qbC8uVsCJ9A6wzDba+QOqeMDKRFIWuKJxRXc6nQSRPt0Hiq4fSdMU7 UDIeGPFS7A/gkFHD/2LpH/MeiCOfIEWa2FoSzgaFGvdOWL2yxG/fbx7gyGkoWspRQfmo CVKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721819768; x=1722424568; 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=YlfOiDcV+xFMbCLirMw48k16oIhVBdnv0gB3Y16FZ4E=; b=YBl4N/2yjNTk4yUidZL88fbtXJdFPhLNQuF441ShObymO69zQnDYwJirVkIdstsepI 9gHiQlIb/iUOmSx35YjWATTWzkXYOSTcWLnEDf07wuNmGXqVehXXaW0MQI05h6YMz3Bx RVkM2Mt0ke5Jri9H2fKpGx6LqG1qjlU986aKcpIu8gSQzyxhF53pQNw/2JtWe9e7Ui1I Fl2KkPF7HXZS1mgiiVfdjAWYio99fRpWhll15OdqCEK4ZHEPCvMDj7NIVJPsQI4Sl5jk gTbEyAWf9frNxNZ3WRnGq81R8KK1KdJTV2+/eWMJHXBMtuBQ9OKiul4DVzmyXukiMSrv XM2w== X-Gm-Message-State: AOJu0YwxQnmnvLmVX478hobGFbM9MwXfqw6vCkSSrc5p+lYBZslzfWT8 gprUgCX3lwWtzG9x79oCcmMvywsBu4DoWvpbgi/i56doYXZnRJUcZz06fw== X-Google-Smtp-Source: AGHT+IEUc1xK3pIP5UmYhH+Hqo2YWS6wWD6UUXoAymavBeCbxF3XsgVgG/GkmLw4yp7+wdTjycnE8w== X-Received: by 2002:a2e:9789:0:b0:2f0:1fd5:2f32 with SMTP id 38308e7fff4ca-2f02b99e528mr22464031fa.48.1721819768195; Wed, 24 Jul 2024 04:16:08 -0700 (PDT) Received: from 127.0.0.1localhost ([163.114.131.193]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5a745917f82sm5006310a12.85.2024.07.24.04.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jul 2024 04:16:07 -0700 (PDT) From: Pavel Begunkov To: io-uring@vger.kernel.org Cc: Jens Axboe , asml.silence@gmail.com Subject: [PATCH 6/6] io_uring: align iowq and task request error handling Date: Wed, 24 Jul 2024 12:16:21 +0100 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There is a difference in how io_queue_sqe and io_wq_submit_work treat error codes they get from io_issue_sqe. The first one fails anything unknown but latter only fails when the code is negative. It doesn't make sense to have this discrepancy, align them to the io_queue_sqe behaviour. Signed-off-by: Pavel Begunkov --- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 10c409e56241..2626424f5d73 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1849,7 +1849,7 @@ void io_wq_submit_work(struct io_wq_work *work) } while (1); /* avoid locking problems by failing it from a clean context */ - if (ret < 0) + if (ret) io_req_task_queue_fail(req, ret); }