Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4594349ybl; Mon, 13 Jan 2020 16:46:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzKlARVqw1S5z5TnvdPt2lKa+uWRAmfT2ZqXa+Lk1/49tuCK0TIXvQAX9zGt1LRR6jj5aVE X-Received: by 2002:aca:39d6:: with SMTP id g205mr13834153oia.122.1578962777768; Mon, 13 Jan 2020 16:46:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578962777; cv=none; d=google.com; s=arc-20160816; b=HO/HJe3M68WykpzyWVAHCp6+9ZaGPFCU8NBxwNkBXbOjBMbTYeUBiModV2nvwhgYcZ TEE7aHCgKoezDGLmmWZ3Io5RMw7QyWxtyK8XKXM/JDXM/C/0/Ca4kEFh9Pr+gwZaX2JV zgJsKFK+r1J7dxrh2Aah5HjJCSVYURGZ/7tmDuR/SIgwTDmp/0hVmdPADXmx68HlWntw 7CauAO4TYLM5O29dGn8/xn0OwwVj/3mitOfUO4COHryRiUi9dWN11lvKuE4FrXKFFiqD 6v+YScaXjaqEiqKvUoJFbael8HZI660nZs/blpwb9myQiRsK2iy06ipN98OfFOxuRPmY ZULQ== 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=xDuB0+Tsw/hteVJfLjD6n5gLSxVVaJDGLHFhceR9Fz0=; b=iS1bhLGO+YxtQ+sPbFjJiT/XmHPZFRE8zPX/Zt/QvX/iPf9ObJ9f67dv/Gwe2pAfFO ToPVofaDgXhLfxMpvF2POKyIuVDAhDm6vwtGwb41B6VrfzsRi6B8/fer3phYCAiQj8Mr 0+3idAJNg5q1jJlQEV0P4o31jRj45VbZowFNf+ilgws4CssakJ6mO5FF9WrpJc7cP149 u+iCUcC/bjRRvdJldCHcRcV7zuuB8+BpSUreQUMNzDUH7yZbFJk5fSqUll+FHwIzgvj1 LSX1aN37W5brlNU5UuTz84aFattwg9sue+jaTzhCnmHNkq6/H4dA+xbz1dH4UiI/0mSL 2wHQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k19si5039116otb.118.2020.01.13.16.46.07; Mon, 13 Jan 2020 16:46:17 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728844AbgANAkt (ORCPT + 99 others); Mon, 13 Jan 2020 19:40:49 -0500 Received: from mga06.intel.com ([134.134.136.31]:49386 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728778AbgANAks (ORCPT ); Mon, 13 Jan 2020 19:40:48 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2020 16:40:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,431,1571727600"; d="scan'208";a="219440214" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga008.fm.intel.com with ESMTP; 13 Jan 2020 16:40:47 -0800 Date: Mon, 13 Jan 2020 16:40:47 -0800 From: Ira Weiny To: "Darrick J. Wong" Cc: linux-kernel@vger.kernel.org, Alexander Viro , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC PATCH V2 10/12] fs/xfs: Fix truncate up Message-ID: <20200114004047.GC29860@iweiny-DESK2.sc.intel.com> References: <20200110192942.25021-1-ira.weiny@intel.com> <20200110192942.25021-11-ira.weiny@intel.com> <20200113222755.GP8247@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200113222755.GP8247@magnolia> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Jan 13, 2020 at 02:27:55PM -0800, Darrick J. Wong wrote: > On Fri, Jan 10, 2020 at 11:29:40AM -0800, ira.weiny@intel.com wrote: > > From: Ira Weiny > > > > When zeroing the end of a file we must account for bytes contained in > > the final page which are past EOF. > > > > Extend the range passed to iomap_zero_range() to reach LLONG_MAX which > > will include all bytes of the final page. > > > > Signed-off-by: Ira Weiny > > --- > > fs/xfs/xfs_iops.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c > > index a2f2604c3187..a34b04e8ac9c 100644 > > --- a/fs/xfs/xfs_iops.c > > +++ b/fs/xfs/xfs_iops.c > > @@ -910,7 +910,7 @@ xfs_setattr_size( > > */ > > if (newsize > oldsize) { > > trace_xfs_zero_eof(ip, oldsize, newsize - oldsize); > > - error = iomap_zero_range(inode, oldsize, newsize - oldsize, > > + error = iomap_zero_range(inode, oldsize, LLONG_MAX - oldsize, > > Huh? Won't this cause the file size to be set to LLONG_MAX? Not as I understand the code. But as I said in the cover I am not 100% sure of this fix. From what I can tell xfs_ioctl_setattr_dax_invalidate() should invalidate the mappings and the page cache and the traces I have indicate that the DAX mode is not changing or was properly held off. Any other suggestions as to the problem are welcome. Ira > > --D > > > &did_zeroing, &xfs_buffered_write_iomap_ops); > > } else { > > error = iomap_truncate_page(inode, newsize, &did_zeroing, > > -- > > 2.21.0 > >