Skip to content

Commit 8adb798

Browse files
Dan McDonaldbehlendorf
authored andcommitted
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: openzfs/openzfs@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.
1 parent c157064 commit 8adb798

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

module/zfs/zfs_ctldir.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* Rohan Puri <[email protected]>
2929
* Brian Behlendorf <[email protected]>
3030
* Copyright (c) 2013 by Delphix. All rights reserved.
31+
* Copyright 2015, OmniTI Computer Consulting, Inc. All rights reserved.
3132
*/
3233

3334
/*
@@ -1245,21 +1246,16 @@ zfsctl_shares_lookup(struct inode *dip, char *name, struct inode **ipp,
12451246
return (SET_ERROR(ENOTSUP));
12461247
}
12471248

1248-
error = zfs_zget(zsb, zsb->z_shares_dir, &dzp);
1249-
if (error) {
1250-
ZFS_EXIT(zsb);
1251-
return (error);
1249+
if ((error = zfs_zget(zsb, zsb->z_shares_dir, &dzp)) == 0) {
1250+
error = zfs_lookup(ZTOI(dzp), name, &ip, 0, cr, NULL, NULL);
1251+
iput(ZTOI(dzp));
12521252
}
12531253

1254-
error = zfs_lookup(ZTOI(dzp), name, &ip, 0, cr, NULL, NULL);
1255-
1256-
iput(ZTOI(dzp));
12571254
ZFS_EXIT(zsb);
12581255

12591256
return (error);
12601257
}
12611258

1262-
12631259
/*
12641260
* Initialize the various pieces we'll need to create and manipulate .zfs
12651261
* directories. Currently this is unused but available.

0 commit comments

Comments
 (0)