diff options
author | Matthew Ahrens <[email protected]> | 2017-06-23 12:32:16 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2018-07-24 17:10:42 -0700 |
commit | 802b1a7b3b413486d4ff249f84c5e6cfd005ed55 (patch) | |
tree | b3fc2c2baf1a024577787f4f719ff2e375a080b8 /module/zfs/dnode.c | |
parent | b7ddeaef3dee6b12f22f67cef184590b5a3f10ed (diff) |
OpenZFS 9338 - moved dnode has incorrect dn_next_type
Authored by: Matthew Ahrens <[email protected]>
Reviewed by: Prashanth Sreenivasa <[email protected]>
Reviewed by: Serapheim Dimitropoulos <[email protected]>
Reviewed by: Dan Kimmel <[email protected]>
Reviewed by: Giuseppe Di Natale <[email protected]>
Reviewed by: George Melikov <[email protected]>
Approved by: Robert Mustacchi <[email protected]>
Ported-by: Brian Behlendorf <[email protected]>
While investigating a different problem, I noticed that moved dnodes
(those processed by dnode_move_impl() via kmem_move()) have an incorrect
dn_next_type. This could cause the on-disk dn_type to be changed to an
invalid value. The fix to copy the dn_next_type in dnode_move_impl().
Porting notes:
* For the moment this potential issue cannot occur on Linux since
the SPL does not provide the kmem_move() functionality.
OpenZFS-issue: https://illumos.org/issues/9338
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/0717e6f13
Closes #7715
Diffstat (limited to 'module/zfs/dnode.c')
-rw-r--r-- | module/zfs/dnode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c index 7672a62fa..7939a7ba6 100644 --- a/module/zfs/dnode.c +++ b/module/zfs/dnode.c @@ -770,6 +770,8 @@ dnode_move_impl(dnode_t *odn, dnode_t *ndn) ndn->dn_datablksz = odn->dn_datablksz; ndn->dn_maxblkid = odn->dn_maxblkid; ndn->dn_num_slots = odn->dn_num_slots; + bcopy(&odn->dn_next_type[0], &ndn->dn_next_type[0], + sizeof (odn->dn_next_type)); bcopy(&odn->dn_next_nblkptr[0], &ndn->dn_next_nblkptr[0], sizeof (odn->dn_next_nblkptr)); bcopy(&odn->dn_next_nlevels[0], &ndn->dn_next_nlevels[0], |