From owner-freebsd-fs@freebsd.org Fri Jan 15 09:58:01 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E80DA84B64 for ; Fri, 15 Jan 2016 09:58:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 174A412D6 for ; Fri, 15 Jan 2016 09:57:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u0F9voAQ040493 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 15 Jan 2016 11:57:50 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u0F9voAQ040493 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u0F9vnrp040492; Fri, 15 Jan 2016 11:57:49 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 15 Jan 2016 11:57:49 +0200 From: Konstantin Belousov To: Rick Macklem Cc: FreeBSD Filesystems Subject: Re: panic ffs_truncate3 (maybe fuse being evil) Message-ID: <20160115095749.GC3942@kib.kiev.ua> References: <1696608910.154845456.1452438117036.JavaMail.zimbra@uoguelph.ca> <20160110154518.GU3625@kib.kiev.ua> <1773157955.158922767.1452698181137.JavaMail.zimbra@uoguelph.ca> <1351730674.159022044.1452699617235.JavaMail.zimbra@uoguelph.ca> <20160114092934.GL72455@kib.kiev.ua> <964333498.161527381.1452827658163.JavaMail.zimbra@uoguelph.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <964333498.161527381.1452827658163.JavaMail.zimbra@uoguelph.ca> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jan 2016 09:58:01 -0000 On Thu, Jan 14, 2016 at 10:14:18PM -0500, Rick Macklem wrote: > Kostik wrote: > > What is the exact value of lblkno ? > > > It was -1 for the crash I looked at. (Since all are the same backtrace and > happen for the same test sequence, I suspect they all are.) > > > There are two kinds of buffers with negative lblk which may exist on > > the UFS vnode queues. One is indirect block, and another is the metadata > > block. Metadata lblks are -1 and -2, indir blocks numbers are calculated > > by formula you can see in calculation of indir_lbn[] in ffs_truncate(). > > > Thanks. I knew indirect blocks were -ve block #s, but I didn't know about > the metadata ones. s/metadata/ext attributes data/ Sorry. > So, if I've understood you correctly, a -1 b_lblkno is an extattr one and > the assert should allow it and not panic? Yes. > > I can change the assert, although it will end up about 6 lines of code;-) > If you think I should do this, I will do so and test it. It is under INVARIANTS anyway. I do see a value in checking that truncation is consistent. We did have many bugs there, which usually caused user data loss. Some caution is worth it, IMO.