Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5004863ybg; Mon, 21 Oct 2019 18:49:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzF+Qk0pa6mFGH/37CVWLtopIZEzcNyqzQCjposp6sV3MwCLweXr8RuS7wswqklML7BPfDR X-Received: by 2002:a17:906:9497:: with SMTP id t23mr2518157ejx.202.1571708998150; Mon, 21 Oct 2019 18:49:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571708998; cv=none; d=google.com; s=arc-20160816; b=c0zV0LgKck0fdApjnGnm3mB9olRNeLEK5qsBwwdxV81ibb4vDyfOqsyodqXifEnoNY eYrMjxLowFyYOKj+TGhwU/tSRzdoAo5z4ZfKv4Lfp9HnaxrNPXLwQDXUz3Z8ixI1kSbG i+nOegbS2B4iRUII3hv5pzbdnmPKAbpTXCCXz4rU7H9HSRZ2KfRc88M6ikz1HoM995ak b33hSW0Wc2HSuPXslknU3UlfJ9THIDfXkwYsNw3p6HwVImtcetCzeozyxE9evkcjAuza q1Gn47GGHTJz8ckc2YLBB6Gjtqx4GxSSSgNAp+0D+rarttO+AFXQAfoy0Mgpelr9UgIq maeQ== 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=cYd8ROhMNq1Yx+vOsBONaKOy7KeVJVgFB+LYLRUxDgE=; b=0fbbej9UxYX2pKBB7kYDPp3hpbzvjkteKsl8FyhMFHUcruO41J1KFbE1i/pVIROgks QHCMIixrDeoU3jBdLf/UfcWnnm6wrvECdiKM9+Z+GShh5AePOgYhfwCD6gstVg4lLR7g 61BXFNKfUWTzy5aolm56X4mA/2WMJRqCIk7M/CvbOBLCa/YJZDtQHNWB/afUM3WlacB+ KqxghLjAYK0QBMI++EfQuF36TsJZUdty9vQIOB9aUKRQfG0KMztFGUCpJ7S/1EMbZcO0 mI45lh1c0OAMYSp+HTxe96osdT0J156hTl5txZAee1BKohm67zfJIoiKEEBJC2wYiwa8 FZdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=TFBptRq3; 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 q5si9441301ejb.174.2019.10.21.18.49.27; Mon, 21 Oct 2019 18:49:58 -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=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=TFBptRq3; 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 S1728819AbfJVBt0 (ORCPT + 99 others); Mon, 21 Oct 2019 21:49:26 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:45625 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728375AbfJVBtZ (ORCPT ); Mon, 21 Oct 2019 21:49:25 -0400 Received: by mail-pf1-f196.google.com with SMTP id b4so670891pfr.12 for ; Mon, 21 Oct 2019 18:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbobrowski-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cYd8ROhMNq1Yx+vOsBONaKOy7KeVJVgFB+LYLRUxDgE=; b=TFBptRq3ve/tPAMq3b0V8kT4Xd0iReoVP7HNznmMumSnWXMSWwlza3Uc6AyyQVElIx hKLIAKeVXZ7CYXilmRzi+njAv2oVri01gkVEniuAoyefK2hxnP2PDVLv3DCBqjSF8499 U5AYYP7gRGFwu1rfFp4TcLNu6tSIcf99XvGLBg81/W8vU8XVWTGi+7L9Bz4EVPws2jPk mT7fzvaj5ZrX70loZoXKYAbH2sMI3xAM100X52Xm7Knfdy3gBImXszpF+VQi6tSqWzGx 5ju+WnTH5bhnY2KHyAuyIi5wu8tCq0tzqjb1zcUpoBgMKMGVVAlcfYBfEXnVfUc+9pwE 9cGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cYd8ROhMNq1Yx+vOsBONaKOy7KeVJVgFB+LYLRUxDgE=; b=aEXyyL7KPYvSP13UF0Jia76yILei5nh3K18uWkLoVixN14XPw8+67E71bcqpmzX8sE zD3ldzdo/6FcPzfUxVyBFUeHN2lAykFSbO0M8flZQFxNJqdb9Kl+DUfUZJGCeiYc2juf K6SnBzVmjexAUzvO8hR+h7e58GhHWbJtmgBGg4LiLy897VAKmMUBw/wHWdoLpoEDGTM3 CBa4FxIZqW7d5QHP2tKJl12aG+7OwhqfaSliIo6zpWu6gdUszkVkKIAUIrjluTh4TaXO Z7T1Huz7JaEEjQACBR6iNH5kc71bfZsKSdiKDSx3fJFdFu+KVQMniQjyU0kv/7A2WRg/ 7lLg== X-Gm-Message-State: APjAAAXwyhodoZoa/kBim7ZlWHGGJqPSC8ARu7rvpyN8YhAlkwJ+WlQN kseNoOiZxt8+06qbAuXDoTpV X-Received: by 2002:a63:c446:: with SMTP id m6mr976716pgg.136.1571708964617; Mon, 21 Oct 2019 18:49:24 -0700 (PDT) Received: from athena.bobrowski.net (n1-41-199-60.bla2.nsw.optusnet.com.au. [1.41.199.60]) by smtp.gmail.com with ESMTPSA id y144sm17865523pfb.188.2019.10.21.18.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 18:49:23 -0700 (PDT) Date: Tue, 22 Oct 2019 12:49:17 +1100 From: Matthew Bobrowski To: Jan Kara Cc: tytso@mit.edu, 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 02/12] ext4: iomap that extends beyond EOF should be marked dirty Message-ID: <20191022014917.GB5092@athena.bobrowski.net> References: <995387be9841bde2151c85880555c18bec68a641.1571647179.git.mbobrowski@mbobrowski.org> <20191021132818.GB25184@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191021132818.GB25184@quack2.suse.cz> 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, Oct 21, 2019 at 03:28:18PM +0200, Jan Kara wrote: > On Mon 21-10-19 20:17:46, Matthew Bobrowski wrote: > > This patch is effectively addressed what Dave Chinner had found and > > fixed within this commit: 8a23414ee345. Justification for needing this > > modification has been provided below: > > > > When doing a direct IO that spans the current EOF, and there are > > written blocks beyond EOF that extend beyond the current write, the > > only metadata update that needs to be done is a file size extension. > > > > However, we don't mark such iomaps as IOMAP_F_DIRTY to indicate that > > there is IO completion metadata updates required, and hence we may > > fail to correctly sync file size extensions made in IO completion when > > O_DSYNC writes are being used and the hardware supports FUA. > > > > Hence when setting IOMAP_F_DIRTY, we need to also take into account > > whether the iomap spans the current EOF. If it does, then we need to > > mark it dirty so that IO completion will call generic_write_sync() to > > flush the inode size update to stable storage correctly. > > > > Signed-off-by: Matthew Bobrowski > > Looks good to me. You could possibly also comment in the changelog that > currently, this change doesn't have user visible impact for ext4 as none of > current users of ext4_iomap_begin() that extend files depend of > IOMAP_F_DIRTY. Sure, I will add this. > Also this patch would make slightly more sense to be before 1/12 so that > you don't have there those two strange unused arguments. But these are just > small nits. You're right. I will rearrange it in v6 so that this patch comes first. > Feel free to add: > > Reviewed-by: Jan Kara Thanks Jan! ----