Skip to content

Commit

Permalink
fzap_cursor_move_to_key() should drop l_rwlock
Browse files Browse the repository at this point in the history
Callers of zap_deref_leaf() must be careful to drop leaf->l_rwlock
since that function returns with the lock held on success.  All other
callers drop the lock correctly but it seems fzap_cursor_move_to_key()
does not.  This may block writers or cause VERIFY failures when the
lock is freed.

Signed-off-by: Brian Behlendorf <[email protected]>
Closes #1215
Closes openzfs/spl#143
Closes openzfs/spl#97
  • Loading branch information
nedbass authored and behlendorf committed Jan 24, 2013
1 parent 09a661e commit 1305d33
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions module/zfs/zap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1257,13 +1257,13 @@ fzap_cursor_move_to_key(zap_cursor_t *zc, zap_name_t *zn)
return (err);

err = zap_leaf_lookup(l, zn, &zeh);
if (err != 0)
return (err);

zc->zc_leaf = l;
zc->zc_hash = zeh.zeh_hash;
zc->zc_cd = zeh.zeh_cd;
if (err == 0) {
zc->zc_leaf = l;
zc->zc_hash = zeh.zeh_hash;
zc->zc_cd = zeh.zeh_cd;
}

rw_exit(&l->l_rwlock);
return (err);
}

Expand Down

0 comments on commit 1305d33

Please sign in to comment.