git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nilfs2: fix lock order reversal in nilfs_clean_segments ioctl
[safe/jmp/linux-2.6]
/
fs
/
locks.c
diff --git
a/fs/locks.c
b/fs/locks.c
index
90e87f5
..
ec3deea
100644
(file)
--- a/
fs/locks.c
+++ b/
fs/locks.c
@@
-1349,7
+1349,7
@@
int generic_setlease(struct file *filp, long arg, struct file_lock **flp)
struct inode *inode = dentry->d_inode;
int error, rdlease_count = 0, wrlease_count = 0;
struct inode *inode = dentry->d_inode;
int error, rdlease_count = 0, wrlease_count = 0;
- if ((current
->fsuid
!= inode->i_uid) && !capable(CAP_LEASE))
+ if ((current
_fsuid()
!= inode->i_uid) && !capable(CAP_LEASE))
return -EACCES;
if (!S_ISREG(inode->i_mode))
return -EINVAL;
return -EACCES;
if (!S_ISREG(inode->i_mode))
return -EINVAL;
@@
-1564,7
+1564,7
@@
EXPORT_SYMBOL(flock_lock_file_wait);
* %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other
* processes read and write access respectively.
*/
* %LOCK_MAND can be combined with %LOCK_READ or %LOCK_WRITE to allow other
* processes read and write access respectively.
*/
-
asmlinkage long sys_flock(unsigned int fd, unsigned int
cmd)
+
SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int,
cmd)
{
struct file *filp;
struct file_lock *lock;
{
struct file *filp;
struct file_lock *lock;
@@
-1580,7
+1580,8
@@
asmlinkage long sys_flock(unsigned int fd, unsigned int cmd)
cmd &= ~LOCK_NB;
unlock = (cmd == LOCK_UN);
cmd &= ~LOCK_NB;
unlock = (cmd == LOCK_UN);
- if (!unlock && !(cmd & LOCK_MAND) && !(filp->f_mode & 3))
+ if (!unlock && !(cmd & LOCK_MAND) &&
+ !(filp->f_mode & (FMODE_READ|FMODE_WRITE)))
goto out_putf;
error = flock_make_lock(filp, &lock, cmd);
goto out_putf;
error = flock_make_lock(filp, &lock, cmd);