summaryrefslogtreecommitdiffstats
path: root/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
diff options
context:
space:
mode:
authormav <mav@FreeBSD.org>2015-10-03 07:22:24 +0000
committermav <mav@FreeBSD.org>2015-10-03 07:22:24 +0000
commit53fc33bdada52f555b8b55b9e07bfdc004df4c44 (patch)
tree6fca87e9eda53a67f4d77bdab20d027c5f168d6f /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
parent68ec6bda1b9121a640af91331ebf82b0108c4c96 (diff)
downloadFreeBSD-src-53fc33bdada52f555b8b55b9e07bfdc004df4c44.zip
FreeBSD-src-53fc33bdada52f555b8b55b9e07bfdc004df4c44.tar.gz
MFC r286545:
5630 stale bonus buffer in recycled dnode_t leads to data corruption Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: George Wilson <george@delphix.com> Reviewed by: Will Andrews <will@freebsd.org> Approved by: Robert Mustacchi <rm@joyent.com> Author: Justin T. Gibbs <justing@spectralogic.com>
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
index 96deeb7..8848677 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
@@ -1205,12 +1205,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);
OpenPOWER on IntegriCloud