1#!/bin/sh 2# 3# Copyright (c) 2008 Peter Holm <pho@FreeBSD.org> 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 9# 1. Redistributions of source code must retain the above copyright 10# notice, this list of conditions and the following disclaimer. 11# 2. Redistributions in binary form must reproduce the above copyright 12# notice, this list of conditions and the following disclaimer in the 13# documentation and/or other materials provided with the distribution. 14# 15# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25# SUCH DAMAGE. 26# 27# $FreeBSD$ 28# 29 30# Mount regression test 31 32# panic: vm_fault: fault on nofault entry, addr: deadc000 33# cpuid = 1 34# KDB: enter: panic 35# [thread pid 69453 tid 100388 ] 36# Stopped at kdb_enter+0x2b: nop 37# db> where 38# Tracing pid 69453 tid 100388 td 0xc4b5c1b0 39# kdb_enter(c091d9db) at kdb_enter+0x2b 40# panic(c0938fa0,deadc000,e6b44834,c06c650e,c0a57d20,...) at panic+0x14b 41# vm_fault(c1869000,deadc000,1,0) at vm_fault+0x1e0 42# trap_pfault(e6b4499c,0,deadc112) at trap_pfault+0x137 43# trap(8,c0910028,28,deadc0de,deadc0de,...) at trap+0x3f5 44# calltrap() at calltrap+0x5 45# --- trap 0xc, eip = 0xc0667def, esp = 0xe6b449dc, ebp = 0xe6b44a00 --- 46# g_io_request(c66d6bdc,c4a1d840,d7c99940,d7c99940,e6b44a34,...) at g_io_request+0x5f 47# g_vfs_strategy(c40624c4,d7c99940,d7c99940,0,c4e16dec,...) at g_vfs_strategy+0x49 48# ffs_geom_strategy(c40624c4,d7c99940,4ba0,0,c09dad00,...) at ffs_geom_strategy+0x141 49# ufs_strategy(e6b44a7c) at ufs_strategy+0xb5 50# VOP_STRATEGY_APV(c09da7c0,e6b44a7c) at VOP_STRATEGY_APV+0x95 51# bufstrategy(c50d2be0,d7c99940) at bufstrategy+0x55 52# breadn(c50d2b2c,0,0,1000,0,...) at breadn+0xf7 53# bread(c50d2b2c,0,0,1000,0,...) at bread+0x20 54# ffs_read(e6b44bb0) at ffs_read+0x23f 55# VOP_READ_APV(c09da7c0,e6b44bb0) at VOP_READ_APV+0x7e 56# ufs_readdir(e6b44c38) at ufs_readdir+0xd1 57# VOP_READDIR_APV(c09da7c0,e6b44c38) at VOP_READDIR_APV+0x7e 58# getdirentries(c4b5c1b0,e6b44d04) at getdirentries+0x13f 59# syscall(3b,3b,3b,8240160,1,...) at syscall+0x256 60 61 62[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 63 64mount | grep /tmp && umount -f /tmp 65 66# The test: 67 68mount -r /tmp 69mount -r /tmp 70umount /tmp 71 72ls -lR /tmp > /dev/null # panic 73 74# End of test 75 76mount /tmp 77