From owner-freebsd-stable@freebsd.org Sat Apr 13 12:33:00 2019 Return-Path: Delivered-To: freebsd-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 561C51577BB2 for ; Sat, 13 Apr 2019 12:33:00 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay05.pair.com (relay05.pair.com [216.92.24.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F54F82A35 for ; Sat, 13 Apr 2019 12:32:58 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay05.pair.com (Postfix) with ESMTP id DC0211A3598; Sat, 13 Apr 2019 08:32:56 -0400 (EDT) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.15.2/8.15.2) with ESMTPS id x3DCWkEr064645 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 13 Apr 2019 14:32:46 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.15.2/8.15.2/Submit) id x3DCWjrW064644; Sat, 13 Apr 2019 14:32:45 +0200 (CEST) (envelope-from pho) Date: Sat, 13 Apr 2019 14:32:45 +0200 From: Peter Holm To: Kirk McKusick Cc: Jamie Landeg-Jones , jamie@catflap.dyslexicfish.net, Warner Losh , freebsd-stable@freebsd.org Subject: Re: Replicable file-system corruption due to fsck/ufs Message-ID: <20190413123245.GA64592@x2.osted.lan> References: <20190411043620.GA87473@x2.osted.lan> <201904122313.x3CND02n069663@chez.mckusick.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904122313.x3CND02n069663@chez.mckusick.com> User-Agent: Mutt/1.11.1 (2018-12-01) X-Rspamd-Queue-Id: 1F54F82A35 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-0.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.957,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.09)[0.088,0]; NEURAL_HAM_LONG(-0.69)[-0.687,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[holm.cc]; AUTH_NA(1.00)[]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mailwash28.pair.com]; R_SPF_NA(0.00)[]; FORGED_SENDER(0.30)[peter@holm.cc,pho@holm.cc]; RECEIVED_SPAMHAUS_PBL(0.00)[204.223.58.87.zen.spamhaus.org : 127.0.0.11]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:7859, ipnet:216.92.0.0/16, country:US]; FROM_NEQ_ENVFROM(0.00)[peter@holm.cc,pho@holm.cc]; IP_SCORE(-0.14)[asn: 7859(-0.63), country: US(-0.06)] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Apr 2019 12:33:00 -0000 On Fri, Apr 12, 2019 at 04:13:00PM -0700, Kirk McKusick wrote: > > Peter Holm wrote: > > > >> I see this even with a single truncate on HEAD. > >> > >> $ ./truncate10.sh > >> 96 -rw-r--r-- 1 root wheel 1073741824 11 apr. 06:33 test > >> ** /dev/md10a > >> ** Last Mounted on /mnt > >> ** Phase 1 - Check Blocks and Sizes > >> INODE 3: FILE SIZE 1073741824 BEYOND END OF ALLOCATED FILE, SIZE SHOULD BE 268435456 > >> ADJUST? yes > > > > Thanks.. I should have tested that myself.. doh! I was trying to > > closer replicate my real file that triggered the problem which > > contained a number of sparse areas. > > > > And thanks for adding Kirk to the discussion. I wanted to first be > > sure it wasn't just me :-) > > > > Cheers, Jamie > > This is indeed a bug in the calculation of the location of the last > block of a file. I believe that the following patch to head will > fix it. > > Peter, can you please test and let me know. > > If Peter confirms that it fixes the bug, I will check it into head > and MFC it to 12-stable and 11-stable after a 2-week settle-in time. > > Kirk McKusick > Yes, this patch works for me. -- Peter