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=-12.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 6C070C433DF for ; Mon, 19 Oct 2020 15:49:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0689922283 for ; Mon, 19 Oct 2020 15:49:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SxbBK69O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730025AbgJSPtC (ORCPT ); Mon, 19 Oct 2020 11:49:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730051AbgJSPtC (ORCPT ); Mon, 19 Oct 2020 11:49:02 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5553C0613CE for ; Mon, 19 Oct 2020 08:49:00 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id e17so226358wru.12 for ; Mon, 19 Oct 2020 08:49:00 -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=5T81z/3cAm80o4UwKPOrmzs5r7IMXl4VQfCj9124BXA=; b=SxbBK69OMdX2oDQ9fT3+UNflO6a0mPBDPVKgjdBRYMKnDwTdMO+XFclya27YdFjxaB SVDBOZ05+HtmP4j1nO3pYBJzuztlGgl1xaKM0yEGtAXVyLcPOsV9yj0CK4LAzLIVEUe9 3eCuUXoKZ8wNs9DAvdB8egU+0yR4t3PDiVQIzlLBTxHtMajzruu4Vx4KwrRCqTtAw5ay 7ggM4BKuPsEH1kvj2VSPMxjMS2al54EKPsnteAuN4qPgfLp016kPcf0SQzonvFnl2nLk MP6VReKmf7ghtSHc9+ZAzRew0hL030RtqEMnupolMVROjqTfGbZxp1iE96rGy+S2B5MA wDAw== 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=5T81z/3cAm80o4UwKPOrmzs5r7IMXl4VQfCj9124BXA=; b=SDKtqzVT5EZx9JZN6hrk0GJRnLHOC+48oHVhhYTQiCW9Bo0L21lfDbZ8aH/JmWu0LU /0QtiRpLg/O0gGue5grmnq/TVfV0G260uAYIWfH5pfs6WPOnnIpYDxD1NZnTA5u+zZLE spP9ZWuKOPy6EDQTO1Ff6nYMqWxm99AJVy2VgnqVaYgHfL111EyMZQbj+eUpZNslI6ZO QAAQP+6Stlk7AFd/af2+kl02sA6GwCnmYgP4ZyBz023Bi6pqLsIxrvkvZSk/ycVe/aXe v7KNT+UJFFplmkWaolW8niY/KornRMbOo+1Bkb4f78e0UPXExbfc6ZE9/ibUydJW1acI NmHA== X-Gm-Message-State: AOAM533hMZYq8ghObtldWqVoOzF5FkOP912GH5E4Y2VwWe8zJaSbSQ/Z JYgHjwmCunxrxVhrQ3sUeMahlE+6Ki3sCQ== X-Google-Smtp-Source: ABdhPJz6biuGI5GSM/pSIzo0DAfDQNbAGwKXwullTJjyugD+igzBJgHA3++U1dD0BzzQ/NXHu6vh4w== X-Received: by 2002:a5d:6a49:: with SMTP id t9mr198456wrw.194.1603122539668; Mon, 19 Oct 2020 08:48:59 -0700 (PDT) Received: from localhost.localdomain (host109-152-100-164.range109-152.btcentralplus.com. [109.152.100.164]) by smtp.gmail.com with ESMTPSA id a15sm115728wrp.90.2020.10.19.08.48.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Oct 2020 08:48:59 -0700 (PDT) From: Pavel Begunkov To: Jens Axboe , io-uring@vger.kernel.org Subject: [PATCH for-5.10] io_uring: remove req cancel in ->flush() Date: Mon, 19 Oct 2020 16:45:54 +0100 Message-Id: <21aca47e03c82a06e4ea1140b328a86d04d1f422.1603122023.git.asml.silence@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org Every close(io_uring) causes cancellation of all inflight requests carrying ->files. That's not nice but was neccessary up until recently. Now task->files removal is handled in the core code, so that part of flush can be removed. Signed-off-by: Pavel Begunkov --- fs/io_uring.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 95d2bb7069c6..6536e24eb44e 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -8748,16 +8748,12 @@ void __io_uring_task_cancel(void) static int io_uring_flush(struct file *file, void *data) { - struct io_ring_ctx *ctx = file->private_data; + bool exiting = !data; - /* - * If the task is going away, cancel work it may have pending - */ if (fatal_signal_pending(current) || (current->flags & PF_EXITING)) - data = NULL; + exiting = true; - io_uring_cancel_task_requests(ctx, data); - io_uring_attempt_task_drop(file, !data); + io_uring_attempt_task_drop(file, exiting); return 0; } -- 2.24.0