aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/ops_file.c')
-rw-r--r--fs/gfs2/ops_file.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/gfs2/ops_file.c b/fs/gfs2/ops_file.c
index b50180e22779..329c4dcdecdb 100644
--- a/fs/gfs2/ops_file.c
+++ b/fs/gfs2/ops_file.c
@@ -513,18 +513,18 @@ static int gfs2_lock(struct file *file, int cmd, struct file_lock *fl)
513 513
514 if (sdp->sd_args.ar_localflocks) { 514 if (sdp->sd_args.ar_localflocks) {
515 if (IS_GETLK(cmd)) { 515 if (IS_GETLK(cmd)) {
516 struct file_lock tmp; 516 posix_test_lock(file, fl);
517 int ret;
518 ret = posix_test_lock(file, fl, &tmp);
519 fl->fl_type = F_UNLCK;
520 if (ret)
521 memcpy(fl, &tmp, sizeof(struct file_lock));
522 return 0; 517 return 0;
523 } else { 518 } else {
524 return posix_lock_file_wait(file, fl); 519 return posix_lock_file_wait(file, fl);
525 } 520 }
526 } 521 }
527 522
523 if (cmd == F_CANCELLK) {
524 /* Hack: */
525 cmd = F_SETLK;
526 fl->fl_type = F_UNLCK;
527 }
528 if (IS_GETLK(cmd)) 528 if (IS_GETLK(cmd))
529 return gfs2_lm_plock_get(sdp, &name, file, fl); 529 return gfs2_lm_plock_get(sdp, &name, file, fl);
530 else if (fl->fl_type == F_UNLCK) 530 else if (fl->fl_type == F_UNLCK)