From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10522C07E95 for ; Wed, 7 Jul 2021 18:24:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9F2A61C72 for ; Wed, 7 Jul 2021 18:24:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231469AbhGGS1b (ORCPT ); Wed, 7 Jul 2021 14:27:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231406AbhGGS1b (ORCPT ); Wed, 7 Jul 2021 14:27:31 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70D7BC061760 for ; Wed, 7 Jul 2021 11:24:50 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id h18-20020a05600c3512b029020e4ceb9588so4984140wmq.5 for ; Wed, 07 Jul 2021 11:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=+HYX85l9YOSXM0enYLzYwDeNAUAO5v7uBwqFqgIsPbM=; b=tZ9u3hVBHKbjpm0bVLyW9RDtddu3pSEJn245H+O1rdQXGBDvf2AncEET7/E7AavLO7 mT7j886r5EbWoa/RoH5u2lgQQTfZ6vsz5t4qurTh1+iX9c44Dv/UnLAuLrWkh5H11afv 2KNhhPvD3gfxeuYSwmNNX8QKx7dc24A9lJrCKSUrLeZQNHXL8q7kK3Ottir62/Lq1b3a eIyGE2adh26lhQ5wPm7VXVC7eHF+04ONI01HCaY8g/bgAimo6GdKGk52SLUd0Wp8oKMq f5OywFy1oIc3im7bzoX9yPxzLMxN0hFx/O9eOxLP6ioRuGLbdHBJrBRx+AQ0CtfS4MS0 uuHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=+HYX85l9YOSXM0enYLzYwDeNAUAO5v7uBwqFqgIsPbM=; b=ksAbGekfBh1h6eaE5d6O2/PRkjGbAf+pwImUmCaefNdLxvPirIgLBntrsl79RzU7h4 WxopdYFZlFtKwKbLczgmdJOQzTgMNEmr8vik7wMe78K520D9vFoHIVQ3Xy77iEUPjTFd maaIobfD+8PVXYrXAowKaMPP7ewv5Bb9bLDYk5ciTPSYTg3ogxBvicRg7ia03hV4AX3v vKiPQNpsWzccImQHG1id4qwo6kJumwEcoWEn93nT+r1wBGvidablutwygDQ8F4fDLRSt bbcA0OL3eQGCxlbiY1b+nSbd+dqknxU73/hCscBRBfK/+h+mplaUKHhlysCDDCsz6M2T xN+g== X-Gm-Message-State: AOAM531rubTeZmUVAQvD0id219JF9EXdlMbPRnqfLhDrJhOqS6fU7a+n 3CHIheKQB+KKLfps2IeUJjw= X-Google-Smtp-Source: ABdhPJzUJxcInBrm6etQJmAlvidSRoTE6CH55gw7FJ37+NwZ3JIOa1fALfu7VfqqtHwXA9RZzTfuCA== X-Received: by 2002:a7b:c218:: with SMTP id x24mr385385wmi.177.1625682289127; Wed, 07 Jul 2021 11:24:49 -0700 (PDT) Received: from localhost.localdomain ([85.255.234.206]) by smtp.gmail.com with ESMTPSA id l2sm19490405wms.20.2021.07.07.11.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jul 2021 11:24:48 -0700 (PDT) From: Pavel Begunkov To: Jens Axboe , io-uring@vger.kernel.org Subject: [PATCH 1/1] io_uring: fix drain alloc fail return code Date: Wed, 7 Jul 2021 19:24:24 +0100 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org After a recent change io_drain_req() started to fail requests with result=0 in case of allocation failure, where it should be and have been -ENOMEM. Fixes: 76cc33d79175a ("io_uring: refactor io_req_defer()") Signed-off-by: Pavel Begunkov --- fs/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 881856088990..8f2a66903f5a 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -6019,7 +6019,7 @@ static bool io_drain_req(struct io_kiocb *req) io_prep_async_link(req); de = kmalloc(sizeof(*de), GFP_KERNEL); if (!de) { - io_req_complete_failed(req, ret); + io_req_complete_failed(req, -ENOMEM); return true; } -- 2.32.0