diff options
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, | |||
400 | 400 | ||
401 | /* Did FASYNC state change ? */ | 401 | /* Did FASYNC state change ? */ |
402 | if ((flag ^ filp->f_flags) & FASYNC) { | 402 | if ((flag ^ filp->f_flags) & FASYNC) { |
403 | if (filp->f_op && filp->f_op->fasync) { | 403 | if (filp->f_op && filp->f_op->fasync) |
404 | lock_kernel(); | ||
405 | error = filp->f_op->fasync(fd, filp, on); | 404 | error = filp->f_op->fasync(fd, filp, on); |
406 | unlock_kernel(); | 405 | else |
407 | } else | ||
408 | error = -ENOTTY; | 406 | error = -ENOTTY; |
409 | } | 407 | } |
410 | if (error) | 408 | if (error) |
@@ -440,11 +438,17 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | |||
440 | break; | 438 | break; |
441 | 439 | ||
442 | case FIONBIO: | 440 | case FIONBIO: |
441 | /* BKL needed to avoid races tweaking f_flags */ | ||
442 | lock_kernel(); | ||
443 | error = ioctl_fionbio(filp, argp); | 443 | error = ioctl_fionbio(filp, argp); |
444 | unlock_kernel(); | ||
444 | break; | 445 | break; |
445 | 446 | ||
446 | case FIOASYNC: | 447 | case FIOASYNC: |
448 | /* BKL needed to avoid races tweaking f_flags */ | ||
449 | lock_kernel(); | ||
447 | error = ioctl_fioasync(fd, filp, argp); | 450 | error = ioctl_fioasync(fd, filp, argp); |
451 | unlock_kernel(); | ||
448 | break; | 452 | break; |
449 | 453 | ||
450 | case FIOQSIZE: | 454 | case FIOQSIZE: |