linux/fs/udf
Jan Kara 6fb1ca92a6 udf: Fix race between write(2) and close(2)
Currently write(2) updating i_size and close(2) of the file can race in
such a way that udf_truncate_tail_extent() called from
udf_file_release() sees old i_size but already new extents added by the
running write call. This results in complaints like:
  UDF-fs: warning (device vdb2): udf_truncate_tail_extent: Too long extent
    after EOF in inode 877: i_size: 0 lbcount: 1073739776 extent 0+1073739776
  UDF-fs: error (device vdb2): udf_truncate_tail_extent: Extent after EOF
    in inode 877

Fix the problem by grabbing i_mutex in udf_file_release() to be sure
i_size is consistent with current state of extent list. Also avoid
truncating tail extent unnecessarily when the file is still open for
writing.

Signed-off-by: Jan Kara <jack@suse.cz>
2014-09-17 11:59:11 +02:00
..
balloc.c
dir.c
directory.c
ecma_167.h
file.c udf: Fix race between write(2) and close(2) 2014-09-17 11:59:11 +02:00
ialloc.c udf: saner calling conventions for udf_new_inode() 2014-09-04 21:37:41 +02:00
inode.c udf: Set i_generation field 2014-09-04 21:37:40 +02:00
Kconfig
lowlevel.c udf: use linux/uaccess.h 2014-07-15 22:40:23 +02:00
Makefile
misc.c
namei.c udf: saner calling conventions for udf_new_inode() 2014-09-04 21:37:41 +02:00
osta_udf.h
partition.c
super.c udf: Make udf_read_inode() and udf_iget() return error 2014-09-04 21:36:35 +02:00
symlink.c udf: use linux/uaccess.h 2014-07-15 22:40:23 +02:00
truncate.c
udf_i.h
udf_sb.h udf: Fortify LVID loading 2013-09-24 11:23:33 +02:00
udfdecl.h udf: saner calling conventions for udf_new_inode() 2014-09-04 21:37:41 +02:00
udfend.h
udftime.c
unicode.c fs/udf: re-use hex_asc_upper_{hi,lo} macros 2014-07-15 22:40:24 +02:00