summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjxiong <[email protected]>2016-10-26 04:21:05 +0800
committerBrian Behlendorf <[email protected]>2016-10-25 13:21:05 -0700
commit16fa68f07d268192552693f83a747c9141ea726b (patch)
tree6ad1de819a90c220161532d9b391201271ac1c9b
parent6568379eea8f01ad87a6cbcb66111112a1b5665f (diff)
Do not upgrade userobj accounting for snapshot dataset
'zfs recv' could disown a living objset without calling dmu_objset_disown(). This will cause the problem that the objset would be released while the upgrading thread is still running. This patch avoids the problem by checking if a dataset is a snapshot before calling dmu_objset_userobjspace_upgrade(). Snapshots are immutable and therefore it doesn't make sense to update them. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jinshan Xiong <[email protected]> Closes #5295 Closes #5328
-rw-r--r--include/sys/dmu_objset.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/dmu_objset.h b/include/sys/dmu_objset.h
index 68fb5cffb..2ec1ec87d 100644
--- a/include/sys/dmu_objset.h
+++ b/include/sys/dmu_objset.h
@@ -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));
}