Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 7 Feb 2010 19:18:28 +0000 (11:18 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 7 Feb 2010 19:18:28 +0000 (11:18 -0800)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
  Take ima_file_free() to proper place.
  ima: rename PATH_CHECK to FILE_CHECK
  ima: rename ima_path_check to ima_file_check
  ima: initialize ima before inodes can be allocated
  fix ima breakage
  Take ima_path_check() in nfsd past dentry_open() in nfsd_open()
  freeze_bdev: don't deactivate successfully frozen MS_RDONLY sb
  befs: fix leak

drivers/char/tty_io.c
fs/fcntl.c

index c6f3b48be9dd68cc37c4847eb8cab4b268ec4c90..dcb9083ecde0982dd061720be8e2e324d3bde5ed 100644 (file)
@@ -1951,8 +1951,10 @@ static int tty_fasync(int fd, struct file *filp, int on)
                        pid = task_pid(current);
                        type = PIDTYPE_PID;
                }
-               retval = __f_setown(filp, pid, type, 0);
+               get_pid(pid);
                spin_unlock_irqrestore(&tty->ctrl_lock, flags);
+               retval = __f_setown(filp, pid, type, 0);
+               put_pid(pid);
                if (retval)
                        goto out;
        } else {
index 5ef953e6f908ea2d6f68061310a106fd0179d15a..97e01dc0d95fc4fe8464d729ce94d32b888b567d 100644 (file)
@@ -199,9 +199,7 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
 static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
                      int force)
 {
-       unsigned long flags;
-
-       write_lock_irqsave(&filp->f_owner.lock, flags);
+       write_lock_irq(&filp->f_owner.lock);
        if (force || !filp->f_owner.pid) {
                put_pid(filp->f_owner.pid);
                filp->f_owner.pid = get_pid(pid);
@@ -213,7 +211,7 @@ static void f_modown(struct file *filp, struct pid *pid, enum pid_type type,
                        filp->f_owner.euid = cred->euid;
                }
        }
-       write_unlock_irqrestore(&filp->f_owner.lock, flags);
+       write_unlock_irq(&filp->f_owner.lock);
 }
 
 int __f_setown(struct file *filp, struct pid *pid, enum pid_type type,