mac80211: Fix Unreachable Mesh Station Problem when joining to another MBSS
[pandora-kernel.git] / fs / locks.c
index 0d68f1f..814c51d 100644 (file)
@@ -1446,7 +1446,7 @@ int generic_setlease(struct file *filp, long arg, struct file_lock **flp)
        struct inode *inode = dentry->d_inode;
        int error;
 
-       if ((current_fsuid() != inode->i_uid) && !capable(CAP_LEASE))
+       if ((!uid_eq(current_fsuid(), inode->i_uid)) && !capable(CAP_LEASE))
                return -EACCES;
        if (!S_ISREG(inode->i_mode))
                return -EINVAL;
@@ -1636,12 +1636,13 @@ EXPORT_SYMBOL(flock_lock_file_wait);
 SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
 {
        struct file *filp;
+       int fput_needed;
        struct file_lock *lock;
        int can_sleep, unlock;
        int error;
 
        error = -EBADF;
-       filp = fget(fd);
+       filp = fget_light(fd, &fput_needed);
        if (!filp)
                goto out;
 
@@ -1674,7 +1675,7 @@ SYSCALL_DEFINE2(flock, unsigned int, fd, unsigned int, cmd)
        locks_free_lock(lock);
 
  out_putf:
-       fput(filp);
+       fput_light(filp, fput_needed);
  out:
        return error;
 }