diff options
author | David S. Miller <davem@davemloft.net> | 2008-12-16 05:03:50 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-16 05:03:50 +0100 |
commit | eb14f019597cd86c21a6c601d7e900f40030c2e7 (patch) | |
tree | 36fb2f36a1747f98988f87215db1eef3a71d45eb /fs/ioctl.c | |
parent | 8390/8390p: Fix compat netdev ops handling. (diff) | |
parent | Merge master.kernel.org:/home/rmk/linux-2.6-arm (diff) | |
download | linux-eb14f019597cd86c21a6c601d7e900f40030c2e7.tar.xz linux-eb14f019597cd86c21a6c601d7e900f40030c2e7.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/e1000e/ich8lan.c
Diffstat (limited to 'fs/ioctl.c')
-rw-r--r-- | fs/ioctl.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/ioctl.c b/fs/ioctl.c index d152856c371b..43e8b2c0664b 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -400,11 +400,9 @@ static int ioctl_fioasync(unsigned int fd, struct file *filp, /* Did FASYNC state change ? */ if ((flag ^ filp->f_flags) & FASYNC) { - if (filp->f_op && filp->f_op->fasync) { - lock_kernel(); + if (filp->f_op && filp->f_op->fasync) error = filp->f_op->fasync(fd, filp, on); - unlock_kernel(); - } else + else error = -ENOTTY; } if (error) @@ -440,11 +438,17 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, break; case FIONBIO: + /* BKL needed to avoid races tweaking f_flags */ + lock_kernel(); error = ioctl_fionbio(filp, argp); + unlock_kernel(); break; case FIOASYNC: + /* BKL needed to avoid races tweaking f_flags */ + lock_kernel(); error = ioctl_fioasync(fd, filp, argp); + unlock_kernel(); break; case FIOQSIZE: |