Bug 162195 - panic with soft updates journaling during umount -f
Summary: panic with soft updates journaling during umount -f
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords: crash, needs-qa
Depends on:
Blocks:
 
Reported: 2011-10-31 11:30 UTC by Kirk Russell
Modified: 2023-10-25 00:44 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kirk Russell 2011-10-31 11:30:11 UTC
I have been testing a scratch filesystem, with soft updates journaling enabled.
During a test, if I run umount -f, I will see this panic:
    panic: check_inode_unwritten: busy inode

Here is the source to the load test:
http://www.ba23.org/bstgbugs/bstg0004.sh

Here is the output from /var/crash/core.txt:
http://www.ba23.org/bstgbugs/bstg0004.core.txt.gz

kleenex# sh bstg0004.sh 
/dev/ada0p4: 56320.0MB (115343360 sectors) block size 32768, fragment size 4096
        using 77 cylinder groups of 740.00MB, 23680 blks, 47360 inodes.
        with soft updates
super-block backups (for fsck -b #) at:
 192, 1515712, 3031232, 4546752, 6062272, 7577792, 9093312, 10608832, 12124352,
 13639872, 15155392, 16670912, 18186432, 19701952, 21217472, 22732992,
 24248512, 25764032, 27279552, 28795072, 30310592, 31826112, 33341632,
 34857152, 36372672, 37888192, 39403712, 40919232, 42434752, 43950272,
 45465792, 46981312, 48496832, 50012352, 51527872, 53043392, 54558912,
 56074432, 57589952, 59105472, 60620992, 62136512, 63652032, 65167552,
 66683072, 68198592, 69714112, 71229632, 72745152, 74260672, 75776192,
 77291712, 78807232, 80322752, 81838272, 83353792, 84869312, 86384832,
 87900352, 89415872, 90931392, 92446912, 93962432, 95477952, 96993472,
 98508992, 100024512, 101540032, 103055552, 104571072, 106086592, 107602112,
 109117632, 110633152, 112148672, 113664192, 115179712
Using inode 4 in cg 0 for 33554432 byte journal
newfs: soft updates journaling set
Test started   [fstorture 2.1-pfh]: Mon Oct 31 11:24:34 GMT 2011
Running for 3 seconds
panic: check_inode_unwritten: busy inode
cpuid = 0
KDB: enter: panic
[ thread pid 1383 tid 100058 ]
Stopped at      kdb_enter+0x3a: movl    $0,kdb_why
db>

How-To-Repeat: Change the variables to match your installation.  Then run the script.

#!/bin/sh
#
# Copyright 2011 Kirk J. Russell
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Web page about FsTorture
# - http://fstools.macosforge.org/trac/wiki/FsTorture
#
# Port FsTorture to Freebsd
# - get source http://fstools.macosforge.org/trac/wiki/ToolsDevelopment
# - get membership.h http://www.ba23.org/~kirk/bstgbugs/membership.h
# - get patch http://www.ba23.org/~kirk/bstgbugs/fstorture.patch
# - gmake CFLAGS=-I. LDFLAGS="-lpthread -lm"
#
# Run this script and you will get a panic with FreeBSD 9.0-RC1
#     panic: check_inode_unwritten: busy inode
#
# If you disable soft updates journaling, the panic will not happen.
#

fstorture=../fstorture/fstorture

# block special device used for testing
fsspec=/dev/ada0p4

# mount point used for filesystem testing
fsfile=/fubar
mkdir -p ${fsfile}

# run the test for less then 2 minutes
for tries in 1 2 3
do
        for secs in 1 1 2 3 5 7 13
        do
                # Enable soft updates journaling
                newfs -j ${fsspec}
                mount ${fsspec} ${fsfile}

                # run fstorture in the background
                mkdir ${fsfile}/a ${fsfile}/b
                timeout="$(printf "%d+2\n" ${secs} | bc)"
                ${fstorture} ${fsfile}/a ${fsfile}/b 25 -t ${timeout}s &

                # block and then force the umount
                sleep ${secs}
                umount -f ${fsfile}

                # clean up
                killall fstorture fstorture fstorture
                wait
        done
done
Comment 1 Kirk Russell 2012-09-16 19:45:07 UTC
I am still reproduce a similar panic with FreeBSD 9.1-RC1.

I wrote a script that does not use FsTorture:
    http://www.ba23.org/bstgbugs/bstg0005.sh

-- 
Kirk Russell            <kirk@ba23.org>           http://www.ba23.org/
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2014-04-20 02:41:31 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 3 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:44 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:18:20 UTC
Keyword: 

    crash

– in lieu of summary line prefix: 

    [panic]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
Comment 5 Graham Perrin freebsd_committer freebsd_triage 2022-12-10 20:12:07 UTC
Is this reproducible with more modern versions of the OS?
Comment 6 Kirk McKusick freebsd_committer freebsd_triage 2023-10-25 00:44:43 UTC
Extensive work and testing has been done on forcible unmounting with the addition of focible unmount on disk failure.

Though the source to the load test is no longer available to rerun this test we now have numerous forcible unmount tests that formerly failed but now work. So I am closing this bug. If a new example of a forcible unmount crashes the system, feel free to open a new bug report.