aboutsummaryrefslogtreecommitdiff
path: root/fs/fcntl.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-23 16:23:23 +0100
committerIngo Molnar <mingo@elte.hu>2008-12-23 16:23:23 +0100
commit1ccedb7cdba6886939dd8b4c8f965a826f696e56 (patch)
tree0f5fc519a68faca5318c296315c9b6c502907056 /fs/fcntl.c
parenta98f8fd24fb24fcb9a359553e64dd6aac5cf4279 (diff)
parent929096fe9ff1f4b3645cf3919527ab47e8d5e17c (diff)
Merge commit 'v2.6.28-rc9' into x86/apic
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;
}