MFV 286709:

6093 zfsctl_shares_lookup should only VN_RELE() on zfs_zget() success

Reviewed by: Gordon Ross <gwr@nexenta.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Robert Mustacchi <rm@joyent.com>
Author: Dan McDonald <danmcd@omniti.com>

illumos/illumos-gate@0f92170f1e
This commit is contained in:
Alexander Motin 2015-08-13 00:10:36 +00:00
commit 3b1f51e911
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=286710

View File

@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013 by Delphix. All rights reserved.
* Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
*/
/*
@ -1149,10 +1150,11 @@ zfsctl_shares_lookup(ap)
ZFS_EXIT(zfsvfs);
return (SET_ERROR(ENOTSUP));
}
if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0)
if ((error = zfs_zget(zfsvfs, zfsvfs->z_shares_dir, &dzp)) == 0) {
error = VOP_LOOKUP(ZTOV(dzp), vpp, cnp);
VN_RELE(ZTOV(dzp));
}
VN_RELE(ZTOV(dzp));
ZFS_EXIT(zfsvfs);
return (error);