summaryrefslogtreecommitdiffstats
path: root/fs/ext3
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2014-09-09 13:03:03 +0200
committerJan Kara <jack@suse.cz>2014-09-17 11:59:11 +0200
commit6fb1ca92a6409a9d5b0696447cd4997bc9aaf5a2 (patch)
treeb3e110ddf9b2e35e92f586418005a0fc0002f9a4 /fs/ext3
parent0b93a92be4cb48f22b78c95dea84089a1e72f860 (diff)
downloadlinux-6fb1ca92a6409a9d5b0696447cd4997bc9aaf5a2.tar.gz
linux-6fb1ca92a6409a9d5b0696447cd4997bc9aaf5a2.tar.bz2
linux-6fb1ca92a6409a9d5b0696447cd4997bc9aaf5a2.zip
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>
Diffstat (limited to 'fs/ext3')
0 files changed, 0 insertions, 0 deletions