summaryrefslogtreecommitdiffstats
path: root/module/zfs/dnode.c
diff options
context:
space:
mode:
authorJustin T. Gibbs <[email protected]>2015-03-12 11:10:35 +1100
committerBrian Behlendorf <[email protected]>2015-03-12 15:40:39 -0700
commit4c7b7eedcde7fababf457ca04445e6d9d1617e29 (patch)
tree4aad4ad89dc24211d74bcc64b285b98b6b03ff31 /module/zfs/dnode.c
parent73ad4a9f3cfc2e830de45c2a8be2823d01ab07a6 (diff)
Illumos 5630 - stale bonus buffer in recycled dnode_t leads to data corruption
5630 stale bonus buffer in recycled dnode_t leads to data corruption Author: Justin T. Gibbs <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Reviewed by: Will Andrews <[email protected]> Approved by: Robert Mustacchi <[email protected]> References: https://www.illumos.org/issues/5630 https://github.com/illumos/illumos-gate/commit/cd485b4 Ported-by: Chris Dunlop <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Richard Yao <[email protected]> Issue #3172
Diffstat (limited to 'module/zfs/dnode.c')
-rw-r--r--module/zfs/dnode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c
index dc082ff3e..ef74621a0 100644
--- a/module/zfs/dnode.c
+++ b/module/zfs/dnode.c
@@ -1158,12 +1158,18 @@ dnode_add_ref(dnode_t *dn, void *tag)
void
dnode_rele(dnode_t *dn, void *tag)
{
+ mutex_enter(&dn->dn_mtx);
+ dnode_rele_and_unlock(dn, tag);
+}
+
+void
+dnode_rele_and_unlock(dnode_t *dn, void *tag)
+{
uint64_t refs;
/* Get while the hold prevents the dnode from moving. */
dmu_buf_impl_t *db = dn->dn_dbuf;
dnode_handle_t *dnh = dn->dn_handle;
- mutex_enter(&dn->dn_mtx);
refs = refcount_remove(&dn->dn_holds, tag);
mutex_exit(&dn->dn_mtx);