Skip to content

Commit

Permalink
leases: fix a return-value mixup
Browse files Browse the repository at this point in the history
Fixes a return-value mixup from 85c5958
"locks: Fix potential OOPS in generic_setlease()", in which -ENOMEM replaced
what had been intended to stay -EAGAIN in the variable "error".

Signed-off-by: David M. Richter <richterd@citi.umich.edu>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
  • Loading branch information
David M. Richter authored and J. Bruce Fields committed Apr 25, 2008
1 parent b69d398 commit 5fcc60c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -1404,6 +1404,7 @@ int generic_setlease(struct file *filp, long arg, struct file_lock **flp)
rdlease_count++;
}

error = -EAGAIN;
if ((arg == F_RDLCK && (wrlease_count > 0)) ||
(arg == F_WRLCK && ((rdlease_count + wrlease_count) > 0)))
goto out;
Expand Down

0 comments on commit 5fcc60c

Please sign in to comment.