Bug 147903

Summary: [zfs] [panic] Kernel panics on faulty zfs device
Product: Base System Reporter: Michiel Leenaars <michiel.ml>
Component: kernAssignee: Bugmeister <bugmeister>
Status: Closed Overcome By Events    
Severity: Affects Only Me Keywords: crash
Priority: Normal    
Version: 8.0-RELEASE   
Hardware: Any   
OS: Any   

Description Michiel Leenaars 2010-06-16 12:40:01 UTC
Hi there,

one of the four drives in my desktop machine attached to a zpool has apparently something corrupted. Whenever I boot with that (external) disk attached, my machine crashes with a panic and reboots. It took some time to find out that when I unplugged that particular drive, I am able to boot the system, the zpool is not online then. When I replug the (usb) drive back in, it keeps on connecting and disconnecting - repeating this message: 

umass0:0:0:-1: Attached to scbus0
ugen4.2: <LaCie> at usbus4 (disconnected)
umass0: at uhub4, port 5, addr 2 (disconnected)
ugen4.2: <LaCie> at usbus4
umass0: <Bulk Only Interface> on usbus4
umass0:  SCSI over Bulk-Only; quirks = 0x0000

When I run zpool status obviously it gives that it cannot open that disk:

  pool: tank
 state: UNAVAIL
status: One or more devices could not be opened.  There are insufficient
        replicas for the pool to continue functioning.
action: Attach the missing device and online it using 'zpool online'.
   see: http://www.sun.com/msg/ZFS-8000-3C
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        tank        UNAVAIL      0     0     0  insufficient replicas
          ad6       ONLINE       0     0     0
          ad10      ONLINE       0     0     0
          ad12      ONLINE       0     0     0
          da0       UNAVAIL      0     0     0  cannot open

The first when I cleared the errors and had the disk plugged in

$ zpool clear tank da0

zfs tried to get the device online and the system rebooted. Meanwhile, some more damage occurred, because somehow I don't have sufficient rights to clear the zpool errors - even though I am logged in as root. 

cannot clear errors for tank: permission denied

So there seem to be two issues: first is an zfs error handling issue that somehow manages to crash the system. The second is the lock out for the superuser to reattach a device (hopefully for resilvering).

How-To-Repeat: Well, my system does it every time I reboot with this hard drive attached, but I'm not sure how other could reproduce it.
Comment 1 Michiel Leenaars 2010-06-19 21:53:23 UTC
I have removed the failing disk from the LaCie USB-casing, and have connected to 
another USB device. Now the USB error has disappeared, but when I boot without 
the disk and then attach it I still get this kernel trap and a rebooting system 
when it automatically starts the ZFS pool after the missing disk is found:

kernel trap 12 with interrupts disabled

Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id - 00
fault virtual address  = 0x11
fault code                 = supervisor write data, page not present
instruction pointer    = 0x20:0xffffffff80586940
stack pointer            = 0x28:0xffffff8000027980
frame pointer            = 0x28:0xffffff8000027990
code segment           = base rx0, limit 0xfffff, type 0x1b
                                  = DPL 0, pres 1, long 1, def32 0, grna 1
processor eflags       = resume, IOPL =0
current process         = 11 (idel: cpu0)
trap number              = 12
panic: page fault
cpuid = 0
Uptime: 10m12s
Cannot dump. Device not defined or unavailable
Automatic reboot in 15 seconds - press a key on the console to abort
Rebooting...
cpu_reset: Stopping other CPU's

Would upgrading to another FreeBSD environment help?

Best,
Michiel Leenaars
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2010-06-21 04:30:16 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:58: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 Mark Linimon freebsd_committer freebsd_triage 2025-01-19 06:06:45 UTC
^Triage: I'm sorry that this PR did not get addressed in a timely fashion.

By now, the version that it was created against is long out of support.
As well, many newer versions of ZFS have been imported.

Please re-open if it is still a problem on a supported version.