Skip to content

Commit

Permalink
Merge branch 'for-upstream' of github.com:jdike/zfs into for-upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
jdike committed Aug 19, 2019
2 parents 2b07af0 + 4d010b4 commit 7641eaa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion module/zfs/sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ sa_cache_destructor(void *buf, void *unused)
mutex_destroy(&hdl->sa_lock);
}

static kmutex_t sa_id_lock;
static int sa_id = 0;

void
sa_cache_init(void)
{
Expand Down Expand Up @@ -1017,8 +1020,12 @@ sa_setup(objset_t *os, uint64_t sa_obj, sa_attr_reg_t *reg_attrs, int count,
mutex_init(&sa->sa_lock, NULL, MUTEX_NOLOCKDEP, NULL);
sa->sa_master_obj = sa_obj;

mutex_enter(&sa_id_lock);
sa_id++;
mutex_exit(&sa_id_lock);

os->os_sa = sa;
mutex_enter(&sa->sa_lock);
mutex_enter_nested(&sa->sa_lock, sa_id);
mutex_exit(&os->os_user_ptr_lock);
avl_create(&sa->sa_layout_num_tree, layout_num_compare,
sizeof (sa_lot_t), offsetof(sa_lot_t, lot_num_node));
Expand Down

0 comments on commit 7641eaa

Please sign in to comment.