Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4409448ybb; Tue, 14 Apr 2020 06:48:15 -0700 (PDT) X-Google-Smtp-Source: APiQypIOdKeDgu1kPB5AuVh9vmPEUzDg4m6+DipHHSxuofwPxZO7suBuQ7Kr7f7YinFVNmWDH/Xx X-Received: by 2002:a50:af85:: with SMTP id h5mr20926008edd.300.1586872095430; Tue, 14 Apr 2020 06:48:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586872095; cv=none; d=google.com; s=arc-20160816; b=DLZcIeU7P76nYJd3HId9J/ll5IZlxUv85EdnQBLyvCTOv7WZuKHk4k6R+sR4qwxPJk 8/KXKgmbunwqYb0jVWyvLZ0W96u5DmpL6cCMbBTuOKWSuv3ihn8UUtd8kY18Ad0SOQNE VlAj4zsBCUShh2Zl/VxOoUkUPtCYbxDrHoJAHn2d6GPDPJ3EzNQIOxF5kGICwhDgSF2J caurepUT/bFI5ozQVK1cZaakRfRCbCgMdjXGth8waz63ueubnTYuYvMSuhDtUqmLCEri nSvzNKEHjnhxvX91v0uTuS8jPGcgElMXY7YOt0PfAfeBfWvniCIZF622UqWKSN4i9vFb LAwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=n+++m/bfjUZK79ZMV3Ry4zhYhdn/qUVzndoKDErgBrM=; b=OkJjdJ3FQFZ/ZoGIu89K9S7jcN9MgSgyBVkXBAGxEakT0IYhrnlNehnd/48Db7mkv3 mtQv5sm2Xn18pgzczd2lhaby6n0MzG9dq7C228TP4xofW8wPvZEmwkLp03NajBe1cK/g onQ832M0z+97S0t1Say87Mx9WnL3iOKVW568e22E+EP/+gNzjY7K1POVbjwnOVj++k5g iON0fTl+U9bkzs6ImZHVafD7IPT2+Ad7JYfAmH8Udlyzq1vQBR/+2wkRFQiKGTaN16W2 BersInyp9mhSvmTT3K05w8y4hok03L+4UBsrJjj5/mE9730x43mvRmYC3w5vXHY8UVjg r9NQ== 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 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i12si8641918edx.459.2020.04.14.06.47.48; Tue, 14 Apr 2020 06:48:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728721AbgDNBaS (ORCPT + 99 others); Mon, 13 Apr 2020 21:30:18 -0400 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:38349 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728719AbgDNBaS (ORCPT ); Mon, 13 Apr 2020 21:30:18 -0400 Received: from callcc.thunk.org (pool-72-93-95-157.bstnma.fios.verizon.net [72.93.95.157]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 03E1U9DQ024756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Apr 2020 21:30:09 -0400 Received: by callcc.thunk.org (Postfix, from userid 15806) id CDAEE42013D; Mon, 13 Apr 2020 21:30:08 -0400 (EDT) Date: Mon, 13 Apr 2020 21:30:08 -0400 From: "Theodore Y. Ts'o" To: Jan Kara Cc: linux-ext4@vger.kernel.org, Dmitry Monakhov , stable@vger.kernel.org Subject: Re: [PATCH] ext4: Do not zeroout extents beyond i_disksize Message-ID: <20200414013008.GA90651@mit.edu> References: <20200331105016.8674-1-jack@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200331105016.8674-1-jack@suse.cz> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Mar 31, 2020 at 12:50:16PM +0200, Jan Kara wrote: > We do not want to create initialized extents beyond end of file because > for e2fsck it is impossible to distinguish them from a case of corrupted > file size / extent tree and so it complains like: > > Inode 12, i_size is 147456, should be 163840. Fix? no > > Code in ext4_ext_convert_to_initialized() and > ext4_split_convert_extents() try to make sure it does not create > initialized extents beyond inode size however they check against > inode->i_size which is wrong. They should instead check against > EXT4_I(inode)->i_disksize which is the current inode size on disk. > That's what e2fsck is going to see in case of crash before all dirty > data is written. This bug manifests as generic/456 test failure (with > recent enough fstests where fsx got fixed to properly pass > FALLOC_KEEP_SIZE_FL flags to the kernel) when run with dioread_lock > mount option. > > CC: stable@vger.kernel.org > Fixes: 21ca087a3891 ("ext4: Do not zero out uninitialized extents beyond i_size") > Signed-off-by: Jan Kara Applied, thanks. - Ted