mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 05:57:43 +00:00
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 <adeason@sinenomine.net> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
parent
5a2ae98327
commit
f7d298d367
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user