diff options
author | David Vrabel <david.vrabel@csr.com> | 2008-12-08 16:18:47 +0000 |
---|---|---|
committer | David Vrabel <david.vrabel@csr.com> | 2008-12-08 16:18:47 +0000 |
commit | c35fa3ea1ae8198bd65c2c6e59d9ebd68c115a59 (patch) | |
tree | 878768b69df25459b448aa890352342c4a3c6e2d /fs/fcntl.c | |
parent | dcc7461eef7341e84e2f7274f904ce01a43b2506 (diff) | |
parent | 218d11a8b071b23b76c484fd5f72a4fe3306801e (diff) | |
download | linux-stable-c35fa3ea1ae8198bd65c2c6e59d9ebd68c115a59.tar.gz linux-stable-c35fa3ea1ae8198bd65c2c6e59d9ebd68c115a59.tar.bz2 linux-stable-c35fa3ea1ae8198bd65c2c6e59d9ebd68c115a59.zip |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-upstream
Diffstat (limited to 'fs/fcntl.c')
-rw-r--r-- | fs/fcntl.c | 7 |
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 @@ #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; } |