]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs: Use common cleanup code for lockctl EINVAL
authorAndrew Deason <adeason@sinenomine.net>
Tue, 2 Oct 2012 20:04:47 +0000 (15:04 -0500)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 13 Aug 2014 15:24:49 +0000 (11:24 -0400)
afs_lockctl has common cleanup code in the 'done' label. Use it here,
instead of trying to duplicate it.

Currently this code path appears to not be dropping the discon lock,
which this rectifies.

Reviewed-on: http://gerrit.openafs.org/8196
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
(cherry picked from commit eae608d99a5ae94624200f91af6ed818c9f6612b)

This commit fixes a vrequest leak introduced by change
I1c60701d4e4f85aedfea6be58a03468ab34edb96.  On master, the corresponding
changes appear in the opposite order.

Change-Id: I1f7a5794f19abb1495bbab6014c3ccde99cf0e1d
Reviewed-on: http://gerrit.openafs.org/11381
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/afs/VNOPS/afs_vnop_flock.c

index 56c37c82a62024f328516d240863a579bb1e5bb6..805230b0773ad412c5752fb4c0e316d570ce0527 100644 (file)
@@ -639,8 +639,8 @@ int afs_lockctl(struct vcache * avc, struct AFS_FLOCK * af, int acmd,
     else if (af->l_type == F_UNLCK)
        code = LOCK_UN;
     else {
-       afs_PutFakeStat(&fakestate);
-       return EINVAL;          /* unknown lock type */
+       code = EINVAL;          /* unknown lock type */
+       goto done;
     }
     if (((acmd == F_SETLK)
 #if    (defined(AFS_SGI_ENV) || defined(AFS_SUN5_ENV)) && !defined(AFS_SUN58_ENV)