From owner-freebsd-bugs@freebsd.org Mon Feb 1 12:55:50 2021 Return-Path: Delivered-To: freebsd-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 173B2528516 for ; Mon, 1 Feb 2021 12:55:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4DTnxK73h4z3Lbp for ; Mon, 1 Feb 2021 12:55:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id F244A528326; Mon, 1 Feb 2021 12:55:49 +0000 (UTC) Delivered-To: bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2096528227 for ; Mon, 1 Feb 2021 12:55:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DTnxK6NhBz3LqN for ; Mon, 1 Feb 2021 12:55:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEC051BA93 for ; Mon, 1 Feb 2021 12:55:49 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 111CtnMm093208 for ; Mon, 1 Feb 2021 12:55:49 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 111CtncC093207 for bugs@FreeBSD.org; Mon, 1 Feb 2021 12:55:49 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 253158] Panic: snapacct_ufs2: bad block - Non-suJ mksnap_ffs(8) crash Date: Mon, 01 Feb 2021 12:55:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: Unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: bugzilla.freebsd@omnilan.de X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Feb 2021 12:55:50 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253158 Bug ID: 253158 Summary: Panic: snapacct_ufs2: bad block - Non-suJ mksnap_ffs(8) crash Product: Base System Version: Unspecified Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: bugzilla.freebsd@omnilan.de Hello, sorry for missing the patch and/or helpful code/debug links, but I want at least to record my long standing problem, which I haven't found time to sta= rt with before... I'm using "factory" ufs-snapshots since FreeBSD 8ish for almost all my deployments. Starting with 10, I'm observing crashes which I couldn't ever reproduce (be= low is a oneliner doing exactly what _should_ trigger the crash, but doesn't). But since the crashes have been guaratneed to show up for several years now= , I salvaged such a filessystem, which makes it possible to reproduce the crash. It's a mdimage(4) of a 36GB root memory disk, compressed 10G in size: http://www.omnilan.de/downloads/fs_slash.gz As soon as I utilize mksnap_ffs(8) on that md(4), (gunzip -c fs_slash.gz > /tmp/fs_slash mdconfig -a -t vnode -f /tmp/fs_slash mount /dev/md0 /mnt # to be adopted mksnap_ffs /mnt/.snap/.test ) I get the following kernel panic: panic: snapacct_ufs2: bad block cpuid =3D 3 time =3D 1612183847 KDB: stack backtrace: #0 0xffffffff80c515c5 at kdb_backtrace+0x65 #1 0xffffffff80c04251 at vpanic+0x181 #2 0xffffffff80c040c3 at panic+0x43 #3 0xffffffff80e86ab4 at snapacct_ufs2+0x164 #4 0xffffffff80e8998c at indiracct_ufs2+0x21c #5 0xffffffff80e86283 at expunge_ufs2+0x3a3 #6 0xffffffff80e84c51 at ffs_snapshot+0x2061 #7 0xffffffff80eac94c at ffs_mount+0x128c #8 0xffffffff80cd4c3d at vfs_domount+0x8bd #9 0xffffffff80cd3b87 at vfs_donmount+0x8e7 #10 0xffffffff80cd3269 at sys_nmount+0x69 #11 0xffffffff81038b3c at amd64_syscall+0x10c #12 0xffffffff8100f1fe at fast_syscall_common+0xf8 -------- Here's the description/test for what I essentially do at setup time, which leads to filesystems causing the mksnap_ffs(8) crash when e.g. FreeBSD boot= s up and runs background fsck(8) - which required a snaphshot, which crashes the machine... 1. Create a file with known size to fit content (this example exactly corresponds to the size of the known-bad fs_slash linked above # actually I'm using dd if=3D/dev/null instead of truncate(1) as used in th= e test loop) 2. newfs without SoftUpdates and/or Journaling, just use a label 3. Mount md(4) and copy content for pre-calculated size 4. do snapshot of the filesystem, move the snap inode, create hard link to = it as well as a symlink to the hardlink 5. umount - as done with real setup 6. additional test: re-mount, make another snapshot - that's where the realworld crash happens on about any 10-20th rollout 7. cleanup =3D=3D sh -c 'count=3D0; oldpwd=3D"$(pwd)"; while [ $count -lt 50 ]; do mdun=3D`tr= uncate -s 37312k /tmp/snaptest && mdconfig -n -a -t vnode -f /tmp/snaptest` ; newfs -L mksnapFFS -n -E /dev/md${mdun} && mount /dev/md${mdun} /mnt && find -x / \! -type d -flags nosnapshot | cpio -pmdu /mnt && mksnap_ffs /mnt/.snap/.test = && cd /mnt && { [ -d usr ] || mkdir usr ; } && mv .snap/.test usr && ln usr/.t= est .snap/.test && ln -s .test .snap/$(stat -f"%i %B %v test" /mnt/.snap/.test | sha1) && cd "${oldpwd}" && echo Successfull: $((count +=3D 1)) ; umount /mn= t ; mdconfig -d -u ${mdun} ; done' --=20 You are receiving this mail because: You are the assignee for the bug.=