Received: by 10.223.176.46 with SMTP id f43csp3343824wra; Mon, 22 Jan 2018 12:29:18 -0800 (PST) X-Google-Smtp-Source: AH8x22760byBWbHEpUqXzRnebT7fIT1UHI6Axg2XHwJoNgxMKJMKom+SWv8r5C78A1ByFRnYrb2V X-Received: by 10.107.104.8 with SMTP id d8mr155627ioc.119.1516652958395; Mon, 22 Jan 2018 12:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516652958; cv=none; d=google.com; s=arc-20160816; b=fvYkCNWdr6Ml8bAftSc3GaYjk3DulT66hfb76z2wxH6YIUdNhSGUhgXoNA2OWFR83a ABJz9Gg8gUVkwJi9dSDkhxtg8PZoD29NCyZdozjLfP0sTOz1CgXPXJnuajrxiGwkkxfZ WOjFfmJZ49qaRez75nkc0ZRplZFebrqxfRi7U3RUE9QM1s2HPMTQkLC0thT4jYJJfy/l x4VvkfbynjBjYhCDCy5jN0jlSn5hu2/gcLbx3D77Pf1DLE/ub+URcFzoTIYNgWdxexA3 EW5KGI1GcxMRPH6xOtOgAQjNEzWhp+4iNrXA/ddSHwnyichLwHvToO5mI0i0zrXbFGOt n+tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=5wX34j1Zx55MZAaz+9MZ83ZLFm2ZA+WBqUN8A7uW2U4=; b=veQ3BUNN3/d01AREmo68UloKi+b+gujKNQyJ1uqmeaNX/jXaVUiIGy0CF2y7t+EWIu anISXDp1Z5v+lWj+otqMG/3mAuTdrhLzsLaaqvqIHhtNryHZmHkShaiYRZnWttwI7rr2 ovZW2xiNF1d6kv67EHTmy5eGMssCoHyYD8iKfyhrVWtsAdtpR2QXW8U/dpRKbEUJEE5o KuwHO0PWOH3ZQTj7ouDHrWVc99AXqxekoKWpgue5pqKN/Tyia0hnWc6z3IeOHKOjZZpM mRsXVcaEQXPiFy9c7X0/bts/9uVY5eKedUiZ7lZJFc6kfSF0wU7MjEQSwjpDVA6vCjJa kfig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=is9ZruR+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o192si6607253itc.86.2018.01.22.12.29.06; Mon, 22 Jan 2018 12:29:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=is9ZruR+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751433AbeAVU2o (ORCPT + 99 others); Mon, 22 Jan 2018 15:28:44 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:41173 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751375AbeAVUNI (ORCPT ); Mon, 22 Jan 2018 15:13:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5wX34j1Zx55MZAaz+9MZ83ZLFm2ZA+WBqUN8A7uW2U4=; b=is9ZruR+aChinnwxthwOnbVG5 Yk2zF5aoHzFXr8WnATmWmxIbqF5tugZ/kpKVhZ9K816GK6UqhAf0OeE0i3hM2pPD4mvuChqi4Pa38 Hz8Gg3MWWBcIhVWQq481A11n62IIUmCtE20e+foQc6Mz7i0CmTRKshf8R65OWgydmXXr/4xYJxpy7 CNgoBcb2jUv77M4rixEz/GDFczcRBoyegl+K6nSiVtSJ/YpBhEL4Pjatw5vSY/m88p0h6y5R3q4qz qX9H/4rM6arPsAXlbLXCMxfN8XwhD5d9WRazR+UDTO1YdkDXZO5c5gdccFlys//fea7OB1iIz9aei 9TlwOdz1A==; Received: from 178.114.226.247.wireless.dyn.drei.com ([178.114.226.247] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ediSn-0007XN-VH; Mon, 22 Jan 2018 20:13:06 +0000 From: Christoph Hellwig To: viro@zeniv.linux.org.uk Cc: Avi Kivity , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 06/36] aio: delete iocbs from the active_reqs list in kiocb_cancel Date: Mon, 22 Jan 2018 21:12:13 +0100 Message-Id: <20180122201243.31610-7-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180122201243.31610-1-hch@lst.de> References: <20180122201243.31610-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org One we cancel an iocb there is no reason to keep it on the active_reqs list, given that the list is only used to look for cancelation candidates. Signed-off-by: Christoph Hellwig Acked-by: Jeff Moyer --- fs/aio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 2d40cf5dd4ec..0b6394b4e528 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -561,6 +561,8 @@ static int kiocb_cancel(struct aio_kiocb *kiocb) { kiocb_cancel_fn *cancel = kiocb->ki_cancel; + list_del_init(&kiocb->ki_list); + if (!cancel) return -EINVAL; kiocb->ki_cancel = NULL; @@ -607,8 +609,6 @@ static void free_ioctx_users(struct percpu_ref *ref) while (!list_empty(&ctx->active_reqs)) { req = list_first_entry(&ctx->active_reqs, struct aio_kiocb, ki_list); - - list_del_init(&req->ki_list); kiocb_cancel(req); } -- 2.14.2