]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
LINUX: Use correct type of error in flock code
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Wed, 11 Aug 2010 16:25:36 +0000 (17:25 +0100)
committerRuss Allbery <rra@debian.org>
Wed, 29 Dec 2010 18:28:52 +0000 (10:28 -0800)
The flock code gets a kernel error code from afs_posix_lock_file()
but then passes this error code through afs_convert_code (which sees
that it is already negative, and returns EIO). Instead, we should just
return afs_posix_lock_file()'s code direct to our caller.

Reviewed-on: http://gerrit.openafs.org/2534
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 5abe706a7e237d3872db3638d947a14c935370d5)
Change-Id: I8e12c9804cc81c8c88f820f55abd4ce863525c9a
Reviewed-on: http://gerrit.openafs.org/3533
(cherry picked from commit beaf16069ed9a9f3355adfdf5e03b2bb28c21a8a)

src/afs/LINUX/osi_vnodeops.c

index 55190d7e306c48b024c16422baa4136b827c7945..4e2816725f7b023dcaa109d98526497509e34f45 100644 (file)
@@ -507,7 +507,7 @@ afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp)
 #endif /* F_GETLK64 && F_GETLK != F_GETLK64 */
 
     AFS_GLOCK();
-    code = afs_lockctl(vcp, &flock, cmd, credp);
+    code = afs_convert_code(afs_lockctl(vcp, &flock, cmd, credp));
     AFS_GUNLOCK();
 
 #ifdef AFS_LINUX24_ENV
@@ -567,7 +567,7 @@ afs_linux_lock(struct file *fp, int cmd, struct file_lock *flp)
        flp->fl_end = flock.l_start + flock.l_len - 1;
 
     crfree(credp);
-    return afs_convert_code(code);
+    return code;
 }
 
 #ifdef STRUCT_FILE_OPERATIONS_HAS_FLOCK