FreeBSD Bugzilla – Attachment 202890 Details for
Bug 236480
[zfs] [panic] solaris assert: dn->dn_type != DMU_OT_NONE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix dn->dn_type != DMU_OT_NONE in dbuf_create()
zfs-dnode-race (text/plain), 2.83 KB, created by
ncrogers
on 2019-03-15 21:20:29 UTC
(
hide
)
Description:
Fix dn->dn_type != DMU_OT_NONE in dbuf_create()
Filename:
MIME Type:
Creator:
ncrogers
Created:
2019-03-15 21:20:29 UTC
Size:
2.83 KB
patch
obsolete
>Attempt to fix a ZFS race bug that causes the fs and thereby the >system to "hang" under an unknown and rare deadlock condition. The >hang/deadlock behavior APPEARS to transition into a complete kernel >panic when INVARIANTS is enabled in the kernel, but the causality >between the below bug reports is still debatable. > >https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236220 >https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=236480 > >****************************************************************************** >Andriy Gapon freebsd_committer 2019-03-14 23:04:59 UTC > > I believe that the problem could be a race condition between dnode_hold > and dnode_sync_free possibly introduced in base r337669 which is the > large dnode feature from ZoL. > Perhaps, the problem has already been fixed in ZoL... > > This looks like the fix that I had in mind: > https://github.com/behlendorf/zfs/commit/50f32ed74e42aa28522e9681fb8ae55239fa33a7 > but note that it is from a personal branch, not ZoL. > > Here is a relevant bug report: > https://github.com/zfsonlinux/zfs/issues/5396 > and another one: > https://github.com/zfsonlinux/zfs/issues/6522 > > And this is what ultimately went into ZoL: > https://github.com/zfsonlinux/zfs/commit/4c5b89f59e4e5c8f5b4680040118ebde09598bbe > Much larger and much harder to understand. > >****************************************************************************** >https://github.com/behlendorf/zfs/commit/50f32ed74e42aa28522e9681fb8ae55239fa33a7.patch > >From 50f32ed74e42aa28522e9681fb8ae55239fa33a7 Mon Sep 17 00:00:00 2001 >From: Brian Behlendorf <behlendorf1@llnl.gov> >Date: Thu, 24 Aug 2017 17:29:11 -0700 >Subject: [PATCH] Fix dn->dn_type != DMU_OT_NONE in dbuf_create() > >As part of commit 50c957f7 this check was pulled up before the >call to dnode_create(). This is racy since the dnode_phys_t >in the dbuf could be updated after the check passed but before >it's created by dnode_create(). Close the race by adding the >original check back to detect this unlikely case. > >Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> >Closes #5396 >Closes #6522 > >****************************************************************************** > >Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c >=================================================================== >--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c (revision 345185) >+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c (working copy) >@@ -1324,7 +1324,9 @@ > mutex_enter(&dn->dn_mtx); > type = dn->dn_type; > if (dn->dn_free_txg || >- ((flag & DNODE_MUST_BE_FREE) && !refcount_is_zero(&dn->dn_holds))) { >+ ((flag & DNODE_MUST_BE_ALLOCATED) && type == DMU_OT_NONE) || >+ ((flag & DNODE_MUST_BE_FREE) && >+ (type != DMU_OT_NONE || !refcount_is_zero(&dn->dn_holds)))) { > mutex_exit(&dn->dn_mtx); > zrl_remove(&dnh->dnh_zrlock); > dbuf_rele(db, FTAG); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 236480
:
202858
|
202859
| 202890