Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4038840ybl; Mon, 12 Aug 2019 10:19:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqygXClc4xDakotJGqWKAsmRrnK0OK9E/g9E+4x8N1dfHdcZVwfB5rUsaUhjg8GBf4x37eEk X-Received: by 2002:a65:4489:: with SMTP id l9mr31937929pgq.207.1565630346345; Mon, 12 Aug 2019 10:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565630346; cv=none; d=google.com; s=arc-20160816; b=DMnc7VT9EgYLub2X0YUNkvV+oWct80p7U7uYzU6/H3qPOiNqEyQUlRh3A37yDmdR9u gRi4z8O5alRzfGWGGdxKwQBBn2fEAgUgHi/4NgsTJuyoTz6Ad0FUlH03CNAaN5lRYAZV 40MvtsbNlhP/yW34S+F2YoQqw+vTLyThf2cahH96gpdSQVvKGyg6jvvDnyt4n3R7k+n/ bBLFy3TEd2U0IrEWnw0R1i4BYrIQcFl4Bzn+feLxh5WvVk+tK5g6mQH/HUvH8eWV8MuD fyd4RaNogcYj3L3GpD0y7HB8Jd/Wa6464tK4fPyCUol+lg0IoGzISXi9sfK+A2jFlbhL UFNQ== 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:dkim-signature; bh=2hDI1ZzVIacAqTMuHLmt8TLr06BIGisIfD/1FImKGgc=; b=OlA1E6YDPPheRVPU/NWBVOko2Y6nmu0Dlgmteqd+asNr+4neszkT/pfmaNXeA20U7t 8iUOOK8usE5OtaI+CCNatvJ8DBtkB2pa0qQXjWxSMhQY/gvT5yoq9ncYW4p+NXJgHIsh Wkxvsa3it1pTiipsEQLcJ1zLNwC6MkigK1F4oujVErplFP05GGyRRPdVemZcrN4qx9YZ lxJuyxK/pnOElqfewKElcJT9VrrdNiwaSjbuxFnAMduSQOlPZS0oobUa6v3GCo9PlxUL C5N8tWq3zFaXI5flUmo7lwHnamaOUqVzzy5xPEpZhadz4v4cpt4KkQvPwuDkz7POwEvC gCpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=q+nc2GKq; 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 g17si8960137pgd.357.2019.08.12.10.18.52; Mon, 12 Aug 2019 10:19:06 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=q+nc2GKq; 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 S1726990AbfHLRSk (ORCPT + 99 others); Mon, 12 Aug 2019 13:18:40 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37300 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbfHLRSk (ORCPT ); Mon, 12 Aug 2019 13:18:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: 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=2hDI1ZzVIacAqTMuHLmt8TLr06BIGisIfD/1FImKGgc=; b=q+nc2GKq1xRiRsCrjqQxkIEEE lmMbVUI3DOl6jvyDMKiXV8pEAZIIjR3EJ1GftbzjTOhdEbCvEM6FdRkAoXj118SrvsWgkCWZDosyH iVOFuaMOcBfiaV9z9KgfVJy5f18/3oiuAWDY9EgT+n3ZKMtRcUZrGfAVhYbxJ+K4Ti0rH2NjY+j9x MPUqdY0ceYy00oUtGSlLkRasi7RI44PrDDE57+qaYOrWkDGr7FSlheBdjuslWdR+0N9Znn/fqJ8CI 5tPnf6LOCSHmsmUxB54rmnTcdJIJN+yDx5i9IIyi2UbUz8JCFtOuQL6UFM/f/wEZp6/cx3tan0XHV E/Nevnu2g==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hxDxv-0001NR-Qr; Mon, 12 Aug 2019 17:18:39 +0000 Date: Mon, 12 Aug 2019 10:18:39 -0700 From: Christoph Hellwig To: Matthew Bobrowski Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, jack@suse.cz, tytso@mit.edu, riteshh@linux.ibm.com Subject: Re: [PATCH 2/5] ext4: move inode extension/truncate code out from ext4_iomap_end() Message-ID: <20190812171839.GC24564@infradead.org> References: <774754e9b2afc541df619921f7743d98c5c6a358.1565609891.git.mbobrowski@mbobrowski.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <774754e9b2afc541df619921f7743d98c5c6a358.1565609891.git.mbobrowski@mbobrowski.org> User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Aug 12, 2019 at 10:52:53PM +1000, Matthew Bobrowski wrote: > In preparation for implementing the direct IO write code path modifications > that make us of iomap infrastructure we need to move out the inode > extension/truncate code from ext4_iomap_end() callback. For direct IO, if the > current code remained it would behave incorrectly. If we update the inode size > prior to converting unwritten extents we run the risk of allowing a racing > direct IO read operation to find unwritten extents before they are converted. > > The inode extension/truncate has been moved out into a new function > ext4_handle_inode_extension(). This will be used by both direct IO and DAX > code paths if the write results with the inode being extended. ext4_iomap_end is empty now, so you could as well remove it entirely.