diff options
Diffstat (limited to 'fs/ioctl.c')
-rw-r--r-- | fs/ioctl.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/ioctl.c b/fs/ioctl.c index 421aab465dab..e8e89edba576 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c | |||
@@ -427,19 +427,11 @@ static int ioctl_fioasync(unsigned int fd, struct file *filp, | |||
427 | /* Did FASYNC state change ? */ | 427 | /* Did FASYNC state change ? */ |
428 | if ((flag ^ filp->f_flags) & FASYNC) { | 428 | if ((flag ^ filp->f_flags) & FASYNC) { |
429 | if (filp->f_op && filp->f_op->fasync) | 429 | if (filp->f_op && filp->f_op->fasync) |
430 | /* fasync() adjusts filp->f_flags */ | ||
430 | error = filp->f_op->fasync(fd, filp, on); | 431 | error = filp->f_op->fasync(fd, filp, on); |
431 | else | 432 | else |
432 | error = -ENOTTY; | 433 | error = -ENOTTY; |
433 | } | 434 | } |
434 | if (error) | ||
435 | return error; | ||
436 | |||
437 | spin_lock(&filp->f_lock); | ||
438 | if (on) | ||
439 | filp->f_flags |= FASYNC; | ||
440 | else | ||
441 | filp->f_flags &= ~FASYNC; | ||
442 | spin_unlock(&filp->f_lock); | ||
443 | return error; | 435 | return error; |
444 | } | 436 | } |
445 | 437 | ||
@@ -507,10 +499,7 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | |||
507 | break; | 499 | break; |
508 | 500 | ||
509 | case FIOASYNC: | 501 | case FIOASYNC: |
510 | /* BKL needed to avoid races tweaking f_flags */ | ||
511 | lock_kernel(); | ||
512 | error = ioctl_fioasync(fd, filp, argp); | 502 | error = ioctl_fioasync(fd, filp, argp); |
513 | unlock_kernel(); | ||
514 | break; | 503 | break; |
515 | 504 | ||
516 | case FIOQSIZE: | 505 | case FIOQSIZE: |