Skip to content

Commit

Permalink
Do not upgrade userobj accounting for snapshot dataset
Browse files Browse the repository at this point in the history
'zfs recv' could disown a living objset without calling
dmu_objset_disown(). This will cause the problem that the objset
would be released while upgrading thread is still running.

This patch avoids the problem by checking if a dataset is snapshot
before calling dmu_objset_userobjspace_upgrade().

ZoL-bug-id: #5295

Signed-off-by: Jinshan Xiong <[email protected]>
  • Loading branch information
Jinshan Xiong committed Oct 25, 2016
1 parent 24cdeaf commit 77ecb31
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/sys/dmu_objset.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ boolean_t dmu_objset_userobjspace_present(objset_t *os);
static inline boolean_t dmu_objset_userobjspace_upgradable(objset_t *os)
{
return (dmu_objset_type(os) == DMU_OST_ZFS &&
!dmu_objset_is_snapshot(os) &&
dmu_objset_userobjused_enabled(os) &&
!dmu_objset_userobjspace_present(os));
}
Expand Down

0 comments on commit 77ecb31

Please sign in to comment.