Received: by 10.223.176.46 with SMTP id f43csp3345311wra; Mon, 22 Jan 2018 12:30:47 -0800 (PST) X-Google-Smtp-Source: AH8x227PTKoMEbmJ5K7xYMTDig8zpSsJK6jeRRoyfvc3Vpz8cGIbMtekyIIiW4YQPQDGeeySAv0y X-Received: by 10.107.142.147 with SMTP id q141mr171442iod.15.1516653047688; Mon, 22 Jan 2018 12:30:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516653047; cv=none; d=google.com; s=arc-20160816; b=CO1QiZTfZV4HxTbuzPpIPFb+FE5cJBO4igNGbal7KJsBT3vz04ghzU6J+9QH9Z/Fum XgNykwA+vMifFgRmwLVyGDtl9kkltqgxfdnR7WyXyKihMjUXQoj3jhUN9IJ3Mhm96Y3m SPGZwlW23/XF1uryGdEiPZWVgwlrkF/uhHwhrC/B3ttMAF2rzXZO2tLFCaI3HG30cCI2 GpcV9hsgkCd4ZqjCKaKxk7UeacMHgi+v1ByH8X437eKbuEfMqPQMHnZcrtdf5GSYS9JE 9dwC9t730KpD+QrTSvbhKhLCJsPf8qfBWwtjgrP/q0qBCzMA3e6E0UDAdLYJSIFehslW e7vA== 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=ig0gfteTn3tUvM4umvmsusqczizciWpm75Ay0ejZzQY=; b=xEgSX5OpKu9raPEe3yxmO33l0eVn6+KaxmnC0eyXA8h9hPt4UpMv6kf2KfMRfXepN5 DOOKAboQhOdNm8PpMSIisB9uCexpyL1vrkxqDNQKNTB7z3omNNVcMsCoeMZ254hWv4Bt nbBbVGYqJ2R/Ach/Rznfkz5NjHKcwbZOc9qnQeHsusapJEwQdWOAK3HmM1kmulW195sd TqYEdDAQXLZj+5l6aNIw8psS+Zkpf1hJFvuUO07F4UoV9Bw1OOcBpi6ZF/dlhclmShIY a2Fpn54EFmvuCNG0FlB8+37RKUnkXhbGybosAPOMPdsES3xZSAz6KglznQ8q3ZJ6oaYY LNyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=lVaxVTQj; 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 p2si6574625iti.35.2018.01.22.12.30.34; Mon, 22 Jan 2018 12:30:47 -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=lVaxVTQj; 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 S1751299AbeAVUM5 (ORCPT + 99 others); Mon, 22 Jan 2018 15:12:57 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:55383 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750947AbeAVUMz (ORCPT ); Mon, 22 Jan 2018 15:12:55 -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=ig0gfteTn3tUvM4umvmsusqczizciWpm75Ay0ejZzQY=; b=lVaxVTQjjJM220Ekp6zSCiiK7 6kRG9YVtKZqXwi+tY4vJ4nzNg+ZilUgAQXdPsgNGdKEG9r6FTkMVWJHc0oHZa4frkkaeOgaEQV273 66Xan7rv7EkVA7Fv7aXFqiacNJ7NJqlPJzrweaDpWus1dET/FYVY6y72USlJUiRUUQz8UvVV37MSN Z0RkyGEZJ4jAgRNRc/fwIeZmHZSGMFnILxj8XILJa9GVmM+s5ejD0CVRTizLLROSFv0YmcF5E3ptz evI4cFvPkDN4IGoAQ4NhMJErAJ4Wo4+oRRb+EJNh1l1Z2Vkan97bRdLg6Kwl7f0I5JUXN0URdCMez 2+vSXv7VQ==; 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 1ediSb-0007VA-7M; Mon, 22 Jan 2018 20:12:53 +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 02/36] aio: remove an outdated comment in aio_complete Date: Mon, 22 Jan 2018 21:12:09 +0100 Message-Id: <20180122201243.31610-3-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 These days we don't treat sync iocbs special in the aio completion code as they never use it. Remove the old comment, and move the BUG_ON for a sync iocb to the top of the function. Signed-off-by: Christoph Hellwig Acked-by: Jeff Moyer --- fs/aio.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 03d59593912d..41fc8ce6bc7f 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1088,6 +1088,8 @@ static void aio_complete(struct kiocb *kiocb, long res, long res2) unsigned tail, pos, head; unsigned long flags; + BUG_ON(is_sync_kiocb(kiocb)); + if (kiocb->ki_flags & IOCB_WRITE) { struct file *file = kiocb->ki_filp; @@ -1100,15 +1102,6 @@ static void aio_complete(struct kiocb *kiocb, long res, long res2) file_end_write(file); } - /* - * Special case handling for sync iocbs: - * - events go directly into the iocb for fast handling - * - the sync task with the iocb in its stack holds the single iocb - * ref, no other paths have a way to get another ref - * - the sync task helpfully left a reference to itself in the iocb - */ - BUG_ON(is_sync_kiocb(kiocb)); - if (iocb->ki_list.next) { unsigned long flags; -- 2.14.2