kernel - Fix SMP race against fp seek position lock
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 29 May 2015 21:09:37 +0000 (14:09 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 29 May 2015 21:09:37 +0000 (14:09 -0700)
commit9f36effdbdc984a086d7ff25c484665807460d67
tree961254e08f0ce389cb00dd9ca047b8155ad1e84f
parent959fe512d6c588fbce597fe3d4a5dc50a61cf8c0
kernel - Fix SMP race against fp seek position lock

* Fix a SMP race against write-appends.  Atomic ops are used on the
  struct file->f_flag field to interlock write-append operations.
  However, the fcntl() and flock() code was also modifying file->f_flag
  using non-atomic ops.

* Fix fcntl() and flock() to use atomic ops.

* Problem could lead to processes stuck forever in "fpoff".

Reported-by: Sevan Janiyan
sys/kern/kern_descrip.c
sys/kern/vfs_syscalls.c