FBSD: plug refcount leak in pioctl
authorBen Kaduk <kaduk@mit.edu>
Wed, 29 May 2013 23:18:22 +0000 (19:18 -0400)
committerDerrick Brashear <shadow@your-file-system.com>
Tue, 8 Oct 2013 12:48:47 +0000 (05:48 -0700)
commit2bbba424ad6728a221688f782b4df90bf6da4a63
tree05d5a2b66cde4b3b60258976356eb1e83fb7e45f
parentb0d75d0687a3436201411384c570448a49a9db15
FBSD: plug refcount leak in pioctl

When gop_lookupname_user returns a non-NULL vnode, the vnode came
from afs_GetVCache (by way of afs_lookup) which takes a reference
on the vnode entry.  There's no need to take another spurious
reference here.  The existing code already knows that there's a
reference in place, as there is an AFS_RELE down where FBSD80_ENV
unlocks the vnode if it's locked (that code is also suspicious).

Prior to this patch, things like 'fs flush /path/to/file' would
leak a reference on that cache entry, preventing clean shutdown.

Change-Id: Iefb7be16bb76b709ffd7cfc082ef9078adf9e354
Reviewed-on: http://gerrit.openafs.org/9957
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/afs_pioctl.c