Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1454208imc; Mon, 11 Mar 2019 14:14:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuCH2OByvkKN3qQG62VuulkV+6vhuZvNIGDAwfAC6DJl6G6jv35hq/0Q9lGXzTjlo1GpSD X-Received: by 2002:a17:902:2947:: with SMTP id g65mr35768912plb.258.1552338875832; Mon, 11 Mar 2019 14:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552338875; cv=none; d=google.com; s=arc-20160816; b=mM+SeubhnosIyj+KskvaN/Q88dso7bWohXuqhnSabQYHtSLYIIE0L95On41Oe8XkD+ Ksh82LiGLG9T6F69XAuGF3R2WwWNujpIHXBzHQVUiFeEHH2RBgjRuFbBSlCwKbFuXjyB je2VaQR2HPnzIFFjRnxnOfFZaPl6UcKgcotfE3AJQIGhte7hD3BwoYnlPs7/4ch/OKth SlNPmXz5D2QUyG9zyqX8XRuxULtTxIRGAW8W7ES8k+kbggbXUoMdp4wle/uDFKRM/C8M Guz/Xe45XW+u+8ht7zdnekUia91f3LWGH3ZtFqUBL7nqCQHB9PQCBZ54QcEulYil3GQl 7dvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=cL683QMeQUvxiFGhkmodSMmwqhhK0PznzrYNEDcFKLA=; b=cqOVr8h3oD2Oq5msuTt/xZ2LvxwNLnvA0YGr7vyh/kyf03U43cPtDy+OfJFx3GsxD8 jpdk/9VP6j/FUOoGImpAaFTtsv0DQvHpEIC0FWbEPzITqrBtazJrwmLT+Jz0Ob5fzSAb 0zwHT4HSWL+4fK2WnrccXfxMIvCQxlxzqTPu82CfSJy1QFG+TUFMndfPRPjbDZRSSemo zafirIV/S7TLO3PB64O+FaJvWp/AOgCJkqTkvLOCdZnuGF+ePXFm+UYob7EBr7KDlMxy +MxTDk0X4ys2V0kTP4U1kbu1NHUXBvrcCouAouHcruYcaLEPl8olwQqOlkKye+GLvxyU 1+Yw== ARC-Authentication-Results: i=1; mx.google.com; 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 11si5863723pfh.90.2019.03.11.14.14.19; Mon, 11 Mar 2019 14:14:35 -0700 (PDT) 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; 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 S1728368AbfCKVNg (ORCPT + 99 others); Mon, 11 Mar 2019 17:13:36 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:60050 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727916AbfCKVNf (ORCPT ); Mon, 11 Mar 2019 17:13:35 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92 #3 (Red Hat Linux)) id 1h3SEi-0001yq-42; Mon, 11 Mar 2019 21:13:28 +0000 Date: Mon, 11 Mar 2019 21:13:28 +0000 From: Al Viro To: Christoph Hellwig Cc: Linus Torvalds , Eric Dumazet , David Miller , Jason Baron , kgraul@linux.ibm.com, ktkhai@virtuozzo.com, kyeongdon.kim@lge.com, Linux List Kernel Mailing , Netdev , pabeni@redhat.com, syzkaller-bugs@googlegroups.com, xiyou.wangcong@gmail.com, zhengbin , bcrl@kvack.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, houtao1@huawei.com, yi.zhang@huawei.com Subject: Re: [PATCH 3/8] aio: store event at final iocb_put() Message-ID: <20190311211328.GN2217@ZenIV.linux.org.uk> References: <20190310070606.GA10138@ZenIV.linux.org.uk> <20190310070822.11564-1-viro@ZenIV.linux.org.uk> <20190310070822.11564-3-viro@ZenIV.linux.org.uk> <20190311194431.GD12602@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190311194431.GD12602@lst.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 11, 2019 at 08:44:31PM +0100, Christoph Hellwig wrote: > On Sun, Mar 10, 2019 at 07:08:17AM +0000, Al Viro wrote: > > From: Al Viro > > > > Instead of having aio_complete() set ->ki_res.{res,res2}, do that > > explicitly in its callers, drop the reference (as aio_complete() > > used to do) and delay the rest until the final iocb_put(). > > > > Signed-off-by: Al Viro > > --- > > fs/aio.c | 45 ++++++++++++++++++++------------------------- > > 1 file changed, 20 insertions(+), 25 deletions(-) > > > > diff --git a/fs/aio.c b/fs/aio.c > > index 2249a7a1d6b3..b9c4c1894020 100644 > > --- a/fs/aio.c > > +++ b/fs/aio.c > > @@ -1077,24 +1077,10 @@ static inline void iocb_destroy(struct aio_kiocb *iocb) > > kmem_cache_free(kiocb_cachep, iocb); > > } > > > > -static inline void iocb_put(struct aio_kiocb *iocb) > > -{ > > - if (refcount_dec_and_test(&iocb->ki_refcnt)) > > - iocb_destroy(iocb); > > -} > > Maybe iocb_put should just have been added in the place you move > it to in patch 1? Might as well...