aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fcntl.c
diff options
context:
space:
mode:
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 ac4f7db9f134..549daf8005fb 100644
--- a/fs/fcntl.c
+++ b/fs/fcntl.c
@@ -19,6 +19,7 @@
19#include <linux/signal.h> 19#include <linux/signal.h>
20#include <linux/rcupdate.h> 20#include <linux/rcupdate.h>
21#include <linux/pid_namespace.h> 21#include <linux/pid_namespace.h>
22#include <linux/smp_lock.h>
22 23
23#include <asm/poll.h> 24#include <asm/poll.h>
24#include <asm/siginfo.h> 25#include <asm/siginfo.h>
@@ -175,6 +176,11 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
175 if (error) 176 if (error)
176 return error; 177 return error;
177 178
179 /*
180 * We still need a lock here for now to keep multiple FASYNC calls
181 * from racing with each other.
182 */
183 lock_kernel();
178 if ((arg ^ filp->f_flags) & FASYNC) { 184 if ((arg ^ filp->f_flags) & FASYNC) {
179 if (filp->f_op && filp->f_op->fasync) { 185 if (filp->f_op && filp->f_op->fasync) {
180 error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0); 186 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)
185 191
186 filp->f_flags = (arg & SETFL_MASK) | (filp->f_flags & ~SETFL_MASK); 192 filp->f_flags = (arg & SETFL_MASK) | (filp->f_flags & ~SETFL_MASK);
187 out: 193 out:
194 unlock_kernel();
188 return error; 195 return error;
189} 196}
190 197