]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
leases: fix a return-value mixup
authorDavid M. Richter <richterd@citi.umich.edu>
Wed, 23 Apr 2008 20:28:59 +0000 (16:28 -0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 25 Apr 2008 16:58:22 +0000 (12:58 -0400)
Fixes a return-value mixup from 85c59580b30c82aa771aa33b37217a6b6851bc14
"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>
fs/locks.c

index 592faadbcec12f19b2f6ea158e956e2a3b01c838..b9f3a0bed3006810d5e87ddf61db6a55d46d3ce6 100644 (file)
@@ -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;