Skip to content

Commit

Permalink
5768 zfsctl_snapshot_inactive() can leak a vnode hold
Browse files Browse the repository at this point in the history
Reviewed by: George Wilson <[email protected]>
Reviewed by: Prakash Surya <[email protected]>
Reviewed by: Adam Leventhal <[email protected]>
Reviewed by: Bayard Bell <[email protected]>
Approved by: Rich Lowe <[email protected]>
  • Loading branch information
ahrens committed Apr 7, 2015
1 parent 309d9ad commit 20a95fb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion usr/src/uts/common/fs/zfs/zfs_ctldir.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright (c) 2012, 2014 by Delphix. All rights reserved.
*/

/*
Expand Down Expand Up @@ -1212,10 +1212,15 @@ zfsctl_snapshot_inactive(vnode_t *vp, cred_t *cr, caller_context_t *ct)

mutex_enter(&sdp->sd_lock);

mutex_enter(&vp->v_lock);
if (vp->v_count > 1) {
vp->v_count--;
mutex_exit(&vp->v_lock);
mutex_exit(&sdp->sd_lock);
VN_RELE(dvp);
return;
}
mutex_exit(&vp->v_lock);
ASSERT(!vn_ismntpt(vp));

sep = avl_first(&sdp->sd_snaps);
Expand Down

0 comments on commit 20a95fb

Please sign in to comment.