aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorDan McDonald <[email protected]>2016-05-11 12:03:51 -0700
committerBrian Behlendorf <[email protected]>2016-05-12 13:39:06 -0700
commit8adb798aa50849cc3f6e099fcae7c29db1b83e39 (patch)
tree7faaae6273fbf6ae9c45d41980f5be246728acf5 /module/zfs
parentc15706490e5d018542ab4bef1a5ab83122a4b351 (diff)
OpenZFS 6093 - zfsctl_shares_lookup
6093 zfsctl_shares_lookup should only VN_RELE() on zfs_zget() success Reviewed by: Gordon Ross <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: George Wilson <[email protected]> Approved by: Robert Mustacchi <[email protected]> Ported-by: Brian Behlendorf <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/6093 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/0f92170 Closes #4630 This function was always implemented slightly differently under Linux and therefore never suffered from this issue. The patch has been updated and applied as cleanup in order to minimize differences with the upstream OpenZFS code.
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/zfs_ctldir.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/module/zfs/zfs_ctldir.c b/module/zfs/zfs_ctldir.c
index 937feac23..8949a8ad1 100644
--- a/module/zfs/zfs_ctldir.c
+++ b/module/zfs/zfs_ctldir.c
@@ -28,6 +28,7 @@
* Rohan Puri <[email protected]>
* Brian Behlendorf <[email protected]>
* Copyright (c) 2013 by Delphix. All rights reserved.
+ * Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
*/
/*
@@ -1245,21 +1246,16 @@ zfsctl_shares_lookup(struct inode *dip, char *name, struct inode **ipp,
return (SET_ERROR(ENOTSUP));
}
- error = zfs_zget(zsb, zsb->z_shares_dir, &dzp);
- if (error) {
- ZFS_EXIT(zsb);
- return (error);
+ if ((error = zfs_zget(zsb, zsb->z_shares_dir, &dzp)) == 0) {
+ error = zfs_lookup(ZTOI(dzp), name, &ip, 0, cr, NULL, NULL);
+ iput(ZTOI(dzp));
}
- error = zfs_lookup(ZTOI(dzp), name, &ip, 0, cr, NULL, NULL);
-
- iput(ZTOI(dzp));
ZFS_EXIT(zsb);
return (error);
}
-
/*
* Initialize the various pieces we'll need to create and manipulate .zfs
* directories. Currently this is unused but available.