|
@@ -19,6 +19,7 @@
|
|
#include <linux/signal.h>
|
|
#include <linux/signal.h>
|
|
#include <linux/rcupdate.h>
|
|
#include <linux/rcupdate.h>
|
|
#include <linux/pid_namespace.h>
|
|
#include <linux/pid_namespace.h>
|
|
|
|
+#include <linux/smp_lock.h>
|
|
|
|
|
|
#include <asm/poll.h>
|
|
#include <asm/poll.h>
|
|
#include <asm/siginfo.h>
|
|
#include <asm/siginfo.h>
|
|
@@ -175,6 +176,11 @@ static int setfl(int fd, struct file * filp, unsigned long arg)
|
|
if (error)
|
|
if (error)
|
|
return 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 ((arg ^ filp->f_flags) & FASYNC) {
|
|
if (filp->f_op && filp->f_op->fasync) {
|
|
if (filp->f_op && filp->f_op->fasync) {
|
|
error = filp->f_op->fasync(fd, filp, (arg & FASYNC) != 0);
|
|
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);
|
|
filp->f_flags = (arg & SETFL_MASK) | (filp->f_flags & ~SETFL_MASK);
|
|
out:
|
|
out:
|
|
|
|
+ unlock_kernel();
|
|
return error;
|
|
return error;
|
|
}
|
|
}
|
|
|
|
|