Fwd: ZFS v28: kernel panics while reading an extended attribute

Martin Matuska mm at FreeBSD.org
Tue Aug 2 06:39:06 UTC 2011


I can confirm the bug found by Alexander Zagrebin in ZFS v28, he
suggests the attached bugfix.
Is the patch acceptable?

How to reproduce the bug:
setextattr user testattr 1 testfile
zfs snapshot test at s1
getextattr user testattr .zfs/snapshot/s1/testfile
PANIC

----- Original message -----
Subject: 	ZFS v28: kernel panics while reading an extended attribute
Date: 	Tue, 2 Aug 2011 08:47:19 +0400
From: 	Alexander Zagrebin <alex at zagrebin.ru>
To: 	freebsd-fs at freebsd.org, freebsd-stable at freebsd.org
Cc: 	freebsd-current at freebsd.org



Hi!

It seems, I've found a bug in the ZFS v28 on the latest stable:
if we have a snapshot with some files having an extended attributes,
then attempt to read an extended attributes's value leads to a well
reproducible kernel panic.

The part of backtrace follows:

#6  0xffffffff804bbe44 in calltrap ()
    at /usr/src/sys/amd64/amd64/exception.S:228
#7  0xffffffff80950ea7 in zil_commit (zilog=0x0, foid=5795917)
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c:1497
#8  0xffffffff80979e6b in zfs_freebsd_read (ap=Variable "ap" is not available.)
    at /usr/src/sys/modules/zfs/../../cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c:622
#9  0xffffffff80979750 in zfs_getextattr (ap=0xffffff80dd5d8820)
    at vnode_if.h:384
#10 0xffffffff8038921b in extattr_get_vp (vp=0xffffff0056a01588,
    attrnamespace=1, attrname=0xffffff80dd5d89a0 "DOSATTRIB", data=Variable "data" is not available.)
    at vnode_if.h:1332

It seems that ZIL isn't available for snapshots, but zfs_freebsd_read
doesn't check this when calling zil_commit.

The attached patch fixes this issue.

Can anybody confirm this?

-- 
Alexander Zagrebin


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-zfs_vnops.c
Type: text/x-diff
Size: 552 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/zfs-devel/attachments/20110802/76ecc7c7/patch-zfs_vnops.bin
-------------- next part --------------
_______________________________________________
freebsd-fs at freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-fs
To unsubscribe, send any mail to "freebsd-fs-unsubscribe at freebsd.org"



More information about the zfs-devel mailing list