]> err.no Git - linux-2.6/blobdiff - kernel/acct.c
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee13...
[linux-2.6] / kernel / acct.c
index f18e0b8df3e1d036e6276befb3e707c4610944de..f4330acead468a8cd228d0249918dbd748e7fbf2 100644 (file)
@@ -483,12 +483,16 @@ static void do_acct_process(struct file *file)
        ac.ac_ppid = current->parent->tgid;
 #endif
 
-       read_lock(&tasklist_lock);      /* pin current->signal */
+       mutex_lock(&tty_mutex);
+       /* FIXME: Whoever is responsible for current->signal locking needs
+          to use the same locking all over the kernel and document it */
+       read_lock(&tasklist_lock);
        ac.ac_tty = current->signal->tty ?
                old_encode_dev(tty_devnum(current->signal->tty)) : 0;
        read_unlock(&tasklist_lock);
+       mutex_unlock(&tty_mutex);
 
-       spin_lock(&current->sighand->siglock);
+       spin_lock_irq(&current->sighand->siglock);
        ac.ac_utime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_utime)));
        ac.ac_stime = encode_comp_t(jiffies_to_AHZ(cputime_to_jiffies(pacct->ac_stime)));
        ac.ac_flag = pacct->ac_flag;
@@ -496,7 +500,7 @@ static void do_acct_process(struct file *file)
        ac.ac_minflt = encode_comp_t(pacct->ac_minflt);
        ac.ac_majflt = encode_comp_t(pacct->ac_majflt);
        ac.ac_exitcode = pacct->ac_exitcode;
-       spin_unlock(&current->sighand->siglock);
+       spin_unlock_irq(&current->sighand->siglock);
        ac.ac_io = encode_comp_t(0 /* current->io_usage */);    /* %% */
        ac.ac_rw = encode_comp_t(ac.ac_io / 1024);
        ac.ac_swaps = encode_comp_t(0);