From f7d298d367cc5deea00a44601f845f543993ef09 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 11 Aug 2010 23:14:31 +0100 Subject: [PATCH] LINUX: More flock fixes Turns out the we have two almost identical lock routines on Linux, one for POSIX locks, and one for flocks. Fix them both. Also, while we're at it, make the same fixes in the LINUX24 tree. Thanks to Andrew Deason for pointing out the oversight in the original patch (5abe706a7e237d3872db3638d947a14c935370d5) Change-Id: I59f0f1e12af36a97e490df36537ac17e8ed87303 Reviewed-on: http://gerrit.openafs.org/2535 Reviewed-by: Andrew Deason Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/afs/LINUX/osi_vnodeops.c | 4 ++-- src/afs/LINUX24/osi_vnodeops.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index a280d0e4ff..af0e24b20b 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -546,7 +546,7 @@ afs_linux_flock(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(); if ((code == 0 || flp->fl_type == F_UNLCK) && @@ -567,7 +567,7 @@ afs_linux_flock(struct file *fp, int cmd, struct file_lock *flp) { flp->fl_pid = flock.l_pid; crfree(credp); - return afs_convert_code(code); + return code; } #endif diff --git a/src/afs/LINUX24/osi_vnodeops.c b/src/afs/LINUX24/osi_vnodeops.c index 6e3576939f..1a490f01ff 100644 --- a/src/afs/LINUX24/osi_vnodeops.c +++ b/src/afs/LINUX24/osi_vnodeops.c @@ -541,7 +541,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 @@ -601,7 +601,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 @@ -630,7 +630,7 @@ afs_linux_flock(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(); if ((code == 0 || flp->fl_type == F_UNLCK) && @@ -651,7 +651,7 @@ afs_linux_flock(struct file *fp, int cmd, struct file_lock *flp) { flp->fl_pid = flock.l_pid; crfree(credp); - return afs_convert_code(code); + return code; } #endif