Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp381224ybh; Thu, 12 Mar 2020 03:54:13 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu5vWt1gA+/N5AHGNUVNl/f/dFnqFnWJGmZZq1zvjPWEvpFtb4TfVvIR2N52ZQlV3bDxa7V X-Received: by 2002:a54:418a:: with SMTP id 10mr96296oiy.105.1584010453022; Thu, 12 Mar 2020 03:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584010453; cv=none; d=google.com; s=arc-20160816; b=Csic/1tTgQhrbzi8DhFbtlwyA/Ru8zDmeqnREr5MCJr4+RohC2A/AI08WyYy3s7aYh +745tdEZ2d9w5H3iGGKATkKrleGsrhfSrNA/X5H2cc6wR40mc1yv2vLrrT4zVAnWsfzj /fETEtruWAAK6biqiPlpeAZOFYmXpyh4ujqvvIysUtWEpDk77Vz+KVgROfaJe5TNStmN l5kSmAc29x5ShV75icY0GwBugrcxXu+DgOVJxbaaPjpnYZMrJEpKpgtRkQQls3LZutON lksOOmUIZrDwZQvx4QVEnIx+H01WrYUiTiYS0QV1LMtqs1y3K7VRrbVOI2oJeU+AOj03 Kcpw== 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=jCJl1hh52e0oDLAM8AX7zE3hDggzSDn2cnvZI19isV4=; b=G4qiu7EpddmMY/UhmWNP+HSTUwaJyH7OqAUl8fdUYjRuGCvcIR9sDv+qxuEmksQzSy tNlz9LgiiV+bAiqSUBxMAOSai/BnRN4YXrIGR3tCyEX57wIJhbOiOG7zNIDObKjq158X RzUFOh/29uXUrFo3bXHA3hyzIlQHWjfwn+wpT9oQZsg+9PEtoNbJ6079gMjih77RjrQ8 0KjB/lTCzhMntVggtP7KcMimtNvYBn4AZUIf6nhvq/+Rorn8+KfYi3IDQ/WzknwDWyM/ zTVoaCXT2VJIL+Yw5d6XXRHq4rlFI2+8R/orajAlQc18ZNuRbCJC1q/kW6TQ5RJ/b7EZ zV7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 y139si1614072ooa.14.2020.03.12.03.54.01; Thu, 12 Mar 2020 03:54:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726567AbgCLKxs (ORCPT + 99 others); Thu, 12 Mar 2020 06:53:48 -0400 Received: from verein.lst.de ([213.95.11.211]:36273 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725978AbgCLKxs (ORCPT ); Thu, 12 Mar 2020 06:53:48 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 476C168C4E; Thu, 12 Mar 2020 11:53:45 +0100 (CET) Date: Thu, 12 Mar 2020 11:53:45 +0100 From: Christoph Hellwig To: David Howells Cc: Christoph Hellwig , mbobrowski@mbobrowski.org, darrick.wong@oracle.com, jack@suse.cz, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: Is ext4_dio_read_iter() broken? - and xfs_file_dio_aio_read() Message-ID: <20200312105345.GA13559@lst.de> References: <20200312104239.GA13235@lst.de> <969260.1584004779@warthog.procyon.org.uk> <1015227.1584007677@warthog.procyon.org.uk> <1023937.1584010180@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1023937.1584010180@warthog.procyon.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu, Mar 12, 2020 at 10:49:40AM +0000, David Howells wrote: > Christoph Hellwig wrote: > > > > > at the end of the function - but surely iocb should be expected to have > > > > been freed when iocb->ki_complete() was called? > > > > The iocb is refcounted and only completed when the refcount hits zero, > > and an extra reference is held until the submission has completed. > > Take a look at iocb_put(). > > Ah... This is in struct aio_kiocb and not struct kiocb - that's why I missed > it. Thanks. That being said we have a few other spots using ->ki_complete for asynchronous execution, which might not be as careful. As someone having written one or two of those I have my doubts I got everthing right and will audit those. > > David ---end quoted text---