Use f_lock to protect f_flags
Traditionally, changes to struct file->f_flags have been done under BKL protection, or with no protection at all. This patch causes all f_flags changes after file open/creation time to be done under protection of f_lock. This allows the removal of some BKL usage and fixes a number of longstanding (if microscopic) races. Reviewed-by:Christoph Hellwig <hch@lst.de> Cc: Al Viro <viro@ZenIV.linux.org.uk> Signed-off-by:
Jonathan Corbet <corbet@lwn.net>
Showing
- drivers/char/tty_io.c 2 additions, 3 deletionsdrivers/char/tty_io.c
- drivers/usb/gadget/file_storage.c 6 additions, 1 deletiondrivers/usb/gadget/file_storage.c
- fs/fcntl.c 2 additions, 0 deletionsfs/fcntl.c
- fs/ioctl.c 4 additions, 3 deletionsfs/ioctl.c
- fs/nfsd/vfs.c 4 additions, 1 deletionfs/nfsd/vfs.c
- include/linux/fs.h 1 addition, 1 deletioninclude/linux/fs.h
- ipc/mqueue.c 2 additions, 0 deletionsipc/mqueue.c
- sound/core/oss/pcm_oss.c 2 additions, 0 deletionssound/core/oss/pcm_oss.c
- sound/oss/au1550_ac97.c 2 additions, 0 deletionssound/oss/au1550_ac97.c
- sound/oss/audio.c 2 additions, 0 deletionssound/oss/audio.c
- sound/oss/sh_dac_audio.c 2 additions, 0 deletionssound/oss/sh_dac_audio.c
- sound/oss/swarm_cs4297a.c 2 additions, 0 deletionssound/oss/swarm_cs4297a.c
- sound/oss/vwsnd.c 2 additions, 0 deletionssound/oss/vwsnd.c
Loading
Please register or sign in to comment