volser: set error, not code, before rfail
authorBenjamin Kaduk <kaduk@mit.edu>
Sun, 22 Nov 2015 19:24:43 +0000 (13:24 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Thu, 3 Dec 2015 04:59:51 +0000 (23:59 -0500)
The rfail cleanup handler overwrites 'code' ~unconditionally, but
does use an existing 'error' value if present.  Since the intent
is to return failure to the caller, preserve the code in the error
variable and do so.

FIXES 131897

Change-Id: I25db2f9ad75a5b856626d39d35f97a09f26bd7a9
Reviewed-on: http://gerrit.openafs.org/12108
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/volser/vsprocs.c

index cdf7dc8..c2dfa21 100644 (file)
@@ -4067,7 +4067,7 @@ UV_ReleaseVolume(afs_uint32 afromvol, afs_uint32 afromserver,
 
        code = CheckTrans(fromconn, &fromtid, afrompart, &orig_status);
        if (code) {
-           code = ENOENT;
+           error = ENOENT;
            goto rfail;
        }