From owner-freebsd-current@freebsd.org Wed Aug 8 22:17:00 2018 Return-Path: Delivered-To: freebsd-current@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 EAABE106D576 for ; Wed, 8 Aug 2018 22:16:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 76C1E97358 for ; Wed, 8 Aug 2018 22:16:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w78MGmMN071545 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 9 Aug 2018 01:16:51 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w78MGmMN071545 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w78MGlua071544; Thu, 9 Aug 2018 01:16:47 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 9 Aug 2018 01:16:47 +0300 From: Konstantin Belousov To: Rick Macklem Cc: "freebsd-current@FreeBSD.org" , peter@holm.cc Subject: Re: ffs_truncate3 panics Message-ID: <20180808221647.GH1884@kib.kiev.ua> References: <20180807131445.GC1884@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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-current@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 22:17:00 -0000 On Wed, Aug 08, 2018 at 12:30:54PM +0000, Rick Macklem wrote: > Konstantin Belousov wrote: > >On Tue, Aug 07, 2018 at 12:28:33PM +0000, Rick Macklem wrote: > >> Hi, > >> > >> During testing of the pNFS server I get an ffs_truncate3 panic every once in a while. > >> A few things that might be relevant: > >> - Seems to happen more often when soft update journaling is enabled, but will > >> happen when it is disabled. > >> - Normally happens when a fairly large subtree of the file system is being removed. > - Oh, and this is an old i386 with 256Mbytes (not one of them new fangled computers, > where memory is in Gbytes;-) > > >> > >> These file systems are a bit odd, since all the regular files in them are empty but > >> have extended attributes that are accessed during the subtree removal. (The > >> extended attributes tell the server where the data files are.) > >> > >> I replaced the panic() with a printf() and every time the printf() happens... > >> bo->bo_dirty.bv_cnt == 0 and bo->bo_clean.bv_cnt == 1. > >> After one of these printf()s, the system continues to run ok. When the file > >> system is fsck'd after this has occurred, it passes fine and I haven't seen and > >> indication of file system corruption after running with this file system for > >> quite a while after the printf()s first occurred. > >The lack of corruption is, most likely, because the files are removed. > >Would the files truncated to zero length and then extended, I am almost > >sure that a corruption occur. > > > >Can you print the only buffer on the clean queue when the panic occur ? > ffst3 vtyp=1 bodirty=0 boclean=1 > buf at 0x428a110 > b_flags = 0x20001020, b_xflags=0x2, b_vflags=0x0 > b_error = 0, b_bufsize = 4096, b_bcount = 4096, b_resid = 0 > b_bufobj = (0xfd8ba94), b_data = 0x5170000, b_blkno = -1, b_lblkno = -1, b_dep = 0 > b_kvabase = 0x5170000, b_kvasize = 32768 So the buffer was indeed for extended attrs, and never written to the disk. I am quite interested what was the inode content prior to the truncation, esp. the di_extsize. Could you try to formulate a way to reproduce the panic so that Peter can recreate it, please ? > > >Also, it is interesting to know the initial length of the file. > Since they are regular files, they are 0 length. (Just inodes with extended attributes.) > > >> > >> Since the panic() only occurs when "options INVARIANTS" is enabled and I don't > >> see evidence of file system corruption, I'm wondering if this panic() is valid and > >> needed? > > rick