aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_ctldir.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/zfs/zfs_ctldir.c')
-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.