summaryrefslogtreecommitdiffstats
path: root/fs/bad_inode.c
diff options
context:
space:
mode:
authorEryu Guan <guaneryu@gmail.com>2018-03-22 11:41:25 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-24 09:34:12 +0200
commitc636feb8ffe56f1cc1fafce87a67b1020761d24d (patch)
treecbfd2a2d04b84135ea030441c3199cac6b8a205b /fs/bad_inode.c
parenta06b798c309ed8c919522c639e89613a013c13c4 (diff)
downloadlinux-stable-c636feb8ffe56f1cc1fafce87a67b1020761d24d.tar.gz
linux-stable-c636feb8ffe56f1cc1fafce87a67b1020761d24d.tar.bz2
linux-stable-c636feb8ffe56f1cc1fafce87a67b1020761d24d.zip
ext4: protect i_disksize update by i_data_sem in direct write path
commit 73fdad00b208b139cf43f3163fbc0f67e4c6047c upstream. i_disksize update should be protected by i_data_sem, by either taking the lock explicitly or by using ext4_update_i_disksize() helper. But the i_disksize updates in ext4_direct_IO_write() are not protected at all, which may be racing with i_disksize updates in writeback path in delalloc buffer write path. This is found by code inspection, and I didn't hit any i_disksize corruption due to this bug. Thanks to Jan Kara for catching this bug and suggesting the fix! Reported-by: Jan Kara <jack@suse.cz> Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Eryu Guan <guaneryu@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/bad_inode.c')
0 files changed, 0 insertions, 0 deletions