aboutsummaryrefslogtreecommitdiff
path: root/fs/fcntl.c
diff options
context:
space:
mode:
authorUwe Kleine-Koenig <ukl@pengutronix.de>2008-12-12 11:18:54 +0100
committerUwe Kleine-Koenig <ukl@pengutronix.de>2008-12-12 11:18:54 +0100
commit7971db5a4b4176ad5df590fce07a962c643a2740 (patch)
tree6ad8e09c5376c4e4c532c3411b0171ba1011acd9 /fs/fcntl.c
parentd403700bf8fc903584e830967f5d64075770848c (diff)
parentc4edfced662fa64deeed89c7d8c9f96d86130c19 (diff)
Merge branch 'for-rmk-misc' into for-rmk
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r--fs/fcntl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fcntl.c b/fs/fcntl.c
index ac4f7db9f13..549daf8005f 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -19,6 +19,7 @@
#include <linux/signal.h>
#include <linux/rcupdate.h>
#include <linux/pid_namespace.h>
+#include <linux/smp_lock.h>
#include <asm/poll.h>
#include <asm/siginfo.h>
@@ -175,6 +176,11 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
if (error)
return error;
+ /*
+ * We still need a lock here for now to keep multiple FASYNC calls
+ * from racing with each other.
+ */
+ lock_kernel();
if ((arg ^ filp->f_flags) & FASYNC) {
if (filp->f_op && filp->f_op->fasync) {
error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0);
@@ -185,6 +191,7 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
filp->f_flags = (arg & SETFL_MASK) | (filp->f_flags & ~SETFL_MASK);
out:
+ unlock_kernel();
return error;
}