Bug 133373 - [zfs] umass attachment causes ZFS checksum errors, data loss
Summary: [zfs] umass attachment causes ZFS checksum errors, data loss
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.0-CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Edward Tomasz Napierala
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-04 16:50 UTC by dgerow
Modified: 2009-10-02 08:33 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dgerow 2009-04-04 16:50:00 UTC
Attach a umass device to a system that has a moderate load on a ZFS
filesystem.  Upon this action, various programs will start throwing
input/output errors, and ZFS checksum errors will be logged to messages.

In this case, while running an average workstation load (fetchmail,
firefox, a few terminals, and tranmission), connecting a Cowon D2
triggers the error immediately.  Note that the longer the system has
been running, the more frequently the errors show up.

Appropriate snippets from /var/log/messages (nothing shows up in dmesg):

-----
Mar 31 23:29:56 plebeian kernel: ugen7.2: <COWON Systems, Inc.> at usbus7
Mar 31 23:29:56 plebeian kernel: umass0: <COWON Systems, Inc. COWON D2  @-e" 3.57, class 0/0, rev 2.00/1.00, addr 2> on usbus7
Mar 31 23:29:56 plebeian kernel: umass0:  SCSI over Bulk-Only; quirks = 0x0000
Mar 31 23:29:56 plebeian root: Unknown USB device: vendor 0x0e21 product 0x0800 bus uhub7
Mar 31 23:29:57 plebeian kernel: umass0:0:0:-1: Attached to scbus0
Mar 31 23:29:57 plebeian kernel: da0 at umass-sim0 bus 0 target 0 lun 0
Mar 31 23:29:57 plebeian kernel: da0: <COWON D2 0100> Removable Direct Access SCSI-0 device
Mar 31 23:29:57 plebeian kernel: da0: 40.000MB/s transfers
Mar 31 23:29:57 plebeian kernel: da0: 7808MB (15990784 512 byte sectors: 255H 63S/T 995C)
Mar 31 23:29:57 plebeian kernel: da1 at umass-sim0 bus 0 target 0 lun 1
Mar 31 23:29:57 plebeian kernel: da1: <COWON D2 0100> Removable Direct Access SCSI-0 device
Mar 31 23:29:57 plebeian kernel: da1: 40.000MB/s transfers
Mar 31 23:29:57 plebeian kernel: da1: 15359MB (31456320 512 byte sectors: 255H 63S/T 1958C)
Mar 31 23:29:57 plebeian kernel: GEOM_LABEL: Label for provider da0 is msdosfs/D2.
Mar 31 23:29:57 plebeian kernel: GEOM: da1: partition 1 does not start on a track boundary.
Mar 31 23:29:57 plebeian kernel: GEOM: da1: partition 1 does not end on a track boundary.
Mar 31 23:30:50 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=297610772480 size=131072
Mar 31 23:30:50 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=297610772480 size=131072
Mar 31 23:30:50 plebeian root: ZFS: zpool I/O failure, zpool=storage error=86
Mar 31 23:31:20 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=23159373824 size=131072
Mar 31 23:31:20 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=23159373824 size=131072
Mar 31 23:31:20 plebeian root: ZFS: zpool I/O failure, zpool=storage error=86
Mar 31 23:31:34 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=18063163392 size=131072
Mar 31 23:31:34 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=18063163392 size=131072
Mar 31 23:31:34 plebeian root: ZFS: zpool I/O failure, zpool=storage error=86
Mar 31 23:31:34 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=18062901248 size=131072
Mar 31 23:31:34 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=18062901248 size=131072
Mar 31 23:31:34 plebeian root: ZFS: zpool I/O failure, zpool=storage error=86
Mar 31 23:31:35 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=17453809664 size=131072
Mar 31 23:31:35 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=17453809664 size=131072
Mar 31 23:31:35 plebeian root: ZFS: zpool I/O failure, zpool=storage error=86
Mar 31 23:31:35 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=17453809664 size=131072
Mar 31 23:31:35 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=17453809664 size=131072
Mar 31 23:31:35 plebeian root: ZFS: zpool I/O failure, zpool=storage error=86
Mar 31 23:31:40 plebeian sudo:   dgerow : TTY=pts/4 ; PWD=/home/dgerow ; USER=root ; COMMAND=/etc/rc.d/sshd start
Mar 31 23:31:50 plebeian sudo:   dgerow : TTY=pts/4 ; PWD=/home/dgerow ; USER=root ; COMMAND=/etc/rc.d/sshd onestart
Mar 31 23:31:51 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=18045468672 size=131072
Mar 31 23:31:51 plebeian dgerow: /etc/rc.d/sshd: WARNING: failed to start sshd
Mar 31 23:31:51 plebeian root: ZFS: checksum mismatch, zpool=storage path=/dev/ad4s1d.eli offset=18045468672 size=131072
Mar 31 23:31:51 plebeian root: ZFS: zpool I/O failure, zpool=storage error=86
-----

I explicitly received errors reading from /etc/termcap after this.  So I
shut everything down -- there is a strong tendancy for applications to core
dump at this point -- and rebooted into single-user mode.  Then I checked
the status of the zfs pool (zpool status -v):

-----
  pool: storage
 state: ONLINE
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: http://www.sun.com/msg/ZFS-8000-8A
 scrub: none requested
config:

        NAME          STATE     READ WRITE CKSUM
        storage       ONLINE       0     0     0
          ad4s1d.eli  ONLINE       0     0     0

errors: Permanent errors have been detected in the following files:

        storage/usr:/local/share/zsh/4.3.9/functions/Completion/Debian.zwc
        storage/usr:/local/share/zsh/4.3.9/functions/Completion/Linux.zwc
        storage/usr:<0xf02d>
        storage/usr:/local/bin/mutt
        storage/usr:/sbin/sshd
        storage/usr:/local/sbin/cupsd
        storage/usr:/share/games/fortune/fortunes
        storage/usr:/local/lib/libgtk-x11-2.0.so.0
        storage/usr:/local/lib/firefox3/chrome/browser.jar
        storage/usr:/share/misc/termcap
        storage/usr:/share/misc/termcap.db
        storage/usr:/local/bin/transmission
        storage/usr:/local/bin/openbox
        storage/home:<0x331d>
        storage/home:/dgerow/X-Files/402 - Home.mp4
        storage/home:/dgerow/.mozilla/firefox/bk0ibcxu.default/urlclassifier3.sqlite
        storage/home:/dgerow/X-Files/705 - Rush.mp4
        storage/home:/dgerow/.procmail.log
-----

There doesn't seem to be a pattern as to which files are affected: mutt,
openbox, cupsd, and transmission were all running before the checksum
errors, whereas fortune, sshd, and procmail were all run post-checksum
errors.  zsh and firefox were running, of course, both before and after.

Oddly, and as was noted as quoted above, I'm not sure what 0x331d would
be.  I didn't explicitly delete anything after plugging in the D2,
though it is possible that a program removed a temporary file.  The scrub
found an additional five errors, and post scrub, my pool now looks like this:

-----
  pool: storage
 state: ONLINE
status: One or more devices has experienced an error resulting in data
        corruption.  Applications may be affected.
action: Restore the file in question if possible.  Otherwise restore the
        entire pool from backup.
   see: http://www.sun.com/msg/ZFS-8000-8A
 scrub: scrub completed after 0h34m with 6 errors on Wed Apr  1 00:22:25 2009
config:

        NAME          STATE     READ WRITE CKSUM
        storage       ONLINE       0     0     6
          ad4s1d.eli  ONLINE       0     0    12

errors: Permanent errors have been detected in the following files:

        storage/home:/dgerow/.mozilla/firefox/bk0ibcxu.default/urlclassifier3.sqlite
        storage/home:/dgerow/.config/transmission/resume/X-Files.2a82218f000bc93d.resume
        storage/home:/dgerow/.mozilla/firefox/bk0ibcxu.default/Cache/_CACHE_001_
        storage/home:/dgerow/mutt.core
        storage/home:/dgerow/X-Files/707 - Orison.mp4
-----

Further investigation showed that by not opening transmission, the bug
is not triggered, which seems to suggest that the problem is tied to the
number of open files (and possibly the size of those files, so perhaps
the ZFS cache itself).

How-To-Repeat: 1) Bring up a moderate filesystem load on a ZFS system.  I used a firefox
   session with ~10 open tabs, and transmission with one torrent (~200
   files, and 30GB).
2) Plug in a umass device.
3) Watch /var/log/messages as the errors occur.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-04-07 02:34:29 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-fs

Over to maintainer(s).
Comment 2 dgerow 2009-05-09 19:31:45 UTC
This PR can be closed, it was a problem with bounced buffers in the new
USB2 code, and has since been fixed.
Comment 3 Edward Tomasz Napierala freebsd_committer freebsd_triage 2009-10-02 08:32:43 UTC
Responsible Changed
From-To: freebsd-fs->trasz

I'll take it.
Comment 4 Edward Tomasz Napierala freebsd_committer freebsd_triage 2009-10-02 08:33:25 UTC
State Changed
From-To: open->closed

According to the submitter, the problem is already fixed.