Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4296838ybg; Mon, 21 Oct 2019 06:54:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqww/x4HzNFRveHjfYoQa29+xsUEVIahkpS6VVBPXP3RDw6c8NuS/nLuioQC0dQ6ImIb/y1/ X-Received: by 2002:a50:ce06:: with SMTP id y6mr25271580edi.259.1571666093647; Mon, 21 Oct 2019 06:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571666093; cv=none; d=google.com; s=arc-20160816; b=N06avGZ3/CfCSQ5N8WXklMBZXEPB6Dm9DXq9TVGcBQ8PqjvmMdWR9YbHYR4ObEwkJm gcQuAob/Olko60SI3LQQU0xt4hsip5UhEPkKec6XRBKS9rfBaLAf5cUwHb5EOtqgItkb XzBFLd66J5U4FCfos4pG0m2S7Uy547oPywLB/iinKfnUfqKkK9OTAA3tUqXTztkygMhn fTCs4c9Oc2gHG3DfiZzrRrTvG6d+dsG626NtpA5B1KuU/2zQ6FwW2WukPoYXpaDNDbzv co48Ygxdlg/VFgDJbDVqBVmMR8FUKLPoOPLz4kNhpB+U4ZNRxAU1id7nPmdMyD9I9lbL 0ofg== 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=4sSMDPvpZ2hTMMWgqdRZhtPPt/u3rsxSNTr7fQEvMFU=; b=U+oGRUZziSka3POWgbpO8UR8JjCag7UmTPbUSi/Jo+rtz4Vj4A+T4ZpVC+DOQuquZ/ GmO6flOmPndOGVHZpYd5W9DU24PAkV1B/I1zrEmphIQz8QRdNvL2hJ4XVjc4jtwID6/D d6VtCxKhzTxPEj65PD+D6AdkwYeHMOL3BAGzkqaEebG1m7T7VxPlGwivavR0WbsUYLJh MN5wStvY5XRPI/efY4bNfc7Td1nYapJcDUBV6j5i7sawlySc8OgZrd9Vpv4ZrHLDrUuS JuNI9sP7f0nRSZMfBAP++Sr+3GgFwTDO1pI4hdQiYbd0Vni59ZWn+gcS4ePkgrMWQZrB jp+A== 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 y15si1108652ejq.159.2019.10.21.06.54.28; Mon, 21 Oct 2019 06:54:53 -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 S1728096AbfJUNxk (ORCPT + 99 others); Mon, 21 Oct 2019 09:53:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:34878 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727152AbfJUNxk (ORCPT ); Mon, 21 Oct 2019 09:53:40 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 772EEB9B8; Mon, 21 Oct 2019 13:53:38 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id CF5211E4AA2; Mon, 21 Oct 2019 15:53:37 +0200 (CEST) Date: Mon, 21 Oct 2019 15:53:37 +0200 From: Jan Kara To: Matthew Bobrowski Cc: tytso@mit.edu, jack@suse.cz, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, darrick.wong@oracle.com Subject: Re: [PATCH v5 09/12] ext4: move inode extension/truncate code out from ->iomap_end() callback Message-ID: <20191021135337.GH25184@quack2.suse.cz> References: <629e86cf14761cdb716bce57feec9997abdd6ff6.1571647179.git.mbobrowski@mbobrowski.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <629e86cf14761cdb716bce57feec9997abdd6ff6.1571647179.git.mbobrowski@mbobrowski.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon 21-10-19 20:18:56, Matthew Bobrowski wrote: > In preparation for implementing the iomap direct I/O modifications, > the inode extension/truncate code needs to be moved out from the > ext4_iomap_end() callback. For direct I/O, if the current code > remained, it would behave incorrrectly. Updating the inode size prior > to converting unwritten extents would potentially allow a racing > direct I/O read to find unwritten extents before being converted > correctly. > > The inode extension/truncate code now resides within a new helper > ext4_handle_inode_extension(). This function has been designed so that > it can accommodate for both DAX and direct I/O extension/truncate > operations. > > Signed-off-by: Matthew Bobrowski > --- > fs/ext4/file.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++- > fs/ext4/inode.c | 48 +-------------------------------- > 2 files changed, 71 insertions(+), 48 deletions(-) > The patch looks good to me. You can add: Reviewed-by: Jan Kara One nit below: > +static ssize_t ext4_handle_inode_extension(struct inode *inode, ssize_t written, > + loff_t offset, size_t count) IMHO a bit more logical ordering of arguments would be 'inode, offset, written, count'... Honza -- Jan Kara SUSE Labs, CR