Bug 213112 - [zfs] [panic] solaris assert: !RRM_LOCK_HELD(&zfsvfs->z_teardown_lock), file zfs_vnops.c, line 1457 (5978)
Summary: [zfs] [panic] solaris assert: !RRM_LOCK_HELD(&zfsvfs->z_teardown_lock), file ...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Andriy Gapon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-30 06:42 UTC by Andriy Voskoboinyk
Modified: 2016-10-12 11:49 UTC (History)
1 user (show)

See Also:


Attachments
LOR + panic with sys_extattr_get_fd() (326.14 KB, image/jpeg)
2016-09-30 06:42 UTC, Andriy Voskoboinyk
no flags Details
LOR + panic with sys_extattr_get_file() (506.56 KB, image/jpeg)
2016-09-30 06:43 UTC, Andriy Voskoboinyk
no flags Details
patch for extended attributes (1.05 KB, patch)
2016-09-30 14:47 UTC, Andriy Gapon
no flags Details | Diff
Possible fix for zfs_lookup() (sys_extattr_get_file()) (581 bytes, patch)
2016-09-30 17:42 UTC, Andriy Voskoboinyk
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-09-30 06:42:25 UTC
Created attachment 175298 [details]
LOR + panic with sys_extattr_get_fd()

How-to-reproduce:
1) start winecfg
2) wait for 10...20 seconds

uname -mrsv:
FreeBSD 12.0-CURRENT FreeBSD 12.0-CURRENT #109 r306459M: Fri Sep 30 00:59:15 EEST 2016     andriy@laptop:/usr/obj.debug/usr/src/sys/CUSTOM-ACPI-DEBUG  i386
Comment 1 Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-09-30 06:43:57 UTC
Created attachment 175299 [details]
LOR + panic with sys_extattr_get_file()
Comment 2 Andriy Gapon freebsd_committer freebsd_triage 2016-09-30 14:28:35 UTC
It seems that you have DIAGNOSTIC turned on.
Thank you for testing!
You can remove sections guarded with DIAGNOSTIC in zfs_vnops.c to fix the panic.  The checks done there are simply incorrect for extended attributes.
See https://svnweb.freebsd.org/changeset/base/306292 for a note about that.
Comment 3 Andriy Gapon freebsd_committer freebsd_triage 2016-09-30 14:47:51 UTC
Created attachment 175306 [details]
patch for extended attributes

Please try this patch.  If it works for you, then I'll commit it rather than removing the diagnostic code.
Thanks!
Comment 4 Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-09-30 17:42:05 UTC
Created attachment 175316 [details]
Possible fix for zfs_lookup() (sys_extattr_get_file())

Yes, it fixes panic in zfs_lock() (first attachment).
For the second a possible fix is attached.
Comment 5 Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-09-30 17:45:20 UTC
(In reply to Andriy Voskoboinyk from comment #4)
(I cannot reproduce the panic with it (the LOR is still here); however, there may be needed an additional check for *vp)
Comment 6 commit-hook freebsd_committer freebsd_triage 2016-10-04 08:09:35 UTC
A commit references this bug:

Author: avg
Date: Tue Oct  4 08:09:25 UTC 2016
New revision: 306665
URL: https://svnweb.freebsd.org/changeset/base/306665

Log:
  zfs: fix a wrong assertion for extended attributes

  For the extended attributes the order between z_teardown_lock and the
  vnode lock is different.
  The bug was triggered only with DIAGNOSTIC turned on.
  This fix is developed in cooperation with avos.

  PR:		213112
  Reported by:	avos
  Tested by:	avos
  MFC after:	1 week

Changes:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Comment 7 Andriy Gapon freebsd_committer freebsd_triage 2016-10-04 08:11:58 UTC
Andriy,

thank you for the second part of the fix and for testing it.
I believe that the LOR was always there... Does you experience differ?
Comment 8 Andriy Voskoboinyk freebsd_committer freebsd_triage 2016-10-09 09:46:00 UTC
No idea; I have DIAGNOSTIC / WITNESS / others enabled for a long time, so this LOR
was hidden by panic anyway. BTW, the test case requires STAGING=on in wine-devel options (off by default).
Comment 9 commit-hook freebsd_committer freebsd_triage 2016-10-12 11:49:08 UTC
A commit references this bug:

Author: avg
Date: Wed Oct 12 11:48:15 UTC 2016
New revision: 307142
URL: https://svnweb.freebsd.org/changeset/base/307142

Log:
  MFC r306665: zfs: fix a wrong assertion for extended attributes

  PR:		213112

Changes:
_U  stable/11/
  stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Comment 10 commit-hook freebsd_committer freebsd_triage 2016-10-12 11:49:10 UTC
A commit references this bug:

Author: avg
Date: Wed Oct 12 11:48:48 UTC 2016
New revision: 307143
URL: https://svnweb.freebsd.org/changeset/base/307143

Log:
  MFC r306665: zfs: fix a wrong assertion for extended attributes

  PR:		213112

Changes:
_U  stable/10/
  stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c