linux-stable/fs/ext4
Matthew Bobrowski c14187f1b4 ext4: iomap that extends beyond EOF should be marked dirty
[ Upstream commit 2e9b51d782 ]

This patch addresses what Dave Chinner had discovered and fixed within
commit: 7684e2c438. This changes does not have any user visible
impact for ext4 as none of the current users of ext4_iomap_begin()
that extend files depend on IOMAP_F_DIRTY.

When doing a direct IO that spans the current EOF, and there are
written blocks beyond EOF that extend beyond the current write, the
only metadata update that needs to be done is a file size extension.

However, we don't mark such iomaps as IOMAP_F_DIRTY to indicate that
there is IO completion metadata updates required, and hence we may
fail to correctly sync file size extensions made in IO completion when
O_DSYNC writes are being used and the hardware supports FUA.

Hence when setting IOMAP_F_DIRTY, we need to also take into account
whether the iomap spans the current EOF. If it does, then we need to
mark it dirty so that IO completion will call generic_write_sync() to
flush the inode size update to stable storage correctly.

Signed-off-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/8b43ee9ee94bee5328da56ba0909b7d2229ef150.1572949325.git.mbobrowski@mbobrowski.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-01-04 19:12:47 +01:00
..
acl.c
acl.h
balloc.c ext4: use ext4_warning() for sb_getblk failure 2018-08-01 12:02:31 -04:00
bitmap.c
block_validity.c ext4: fix potential use after free after remounting with noblock_validity 2019-10-07 18:57:05 +02:00
dir.c ext4: check for directory entries too close to block end 2019-12-31 16:36:27 +01:00
ext4.h ext4: fix potential use after free after remounting with noblock_validity 2019-10-07 18:57:05 +02:00
ext4_extents.h ext4: verify the depth of extent tree in ext4_find_extent() 2018-06-14 12:55:10 -04:00
ext4_jbd2.c
ext4_jbd2.h ext4: use jbd2_inode dirty range scoping 2019-07-28 08:29:29 +02:00
extents.c ext4: fix warning inside ext4_convert_unwritten_extents_endio 2019-10-05 13:10:11 +02:00
extents_status.c
extents_status.h
file.c ext4: enforce the immutable flag on open files 2019-07-28 08:29:29 +02:00
fsmap.c
fsmap.h
fsync.c Revert "ext4: use ext4_write_inode() when fsyncing w/o a journal" 2019-02-15 08:10:13 +01:00
hash.c
ialloc.c ext4: avoid declaring fs inconsistent due to invalid file handles 2019-01-09 17:38:43 +01:00
indirect.c ext4: cleanup bh release code in ext4_ind_remove_space() 2019-04-05 22:32:55 +02:00
inline.c ext4: fix a potential fiemap/page fault deadlock w/ inline_data 2019-01-16 22:04:36 +01:00
inode.c ext4: iomap that extends beyond EOF should be marked dirty 2020-01-04 19:12:47 +01:00
ioctl.c ext4: disallow files with EXT4_JOURNAL_DATA_FL from EXT4_IOC_SWAP_BOOT 2019-11-06 13:05:37 +01:00
Kconfig
Makefile
mballoc.c ext4: make sanity check in mballoc more strict 2019-05-22 07:37:42 +02:00
mballoc.h
migrate.c ext4: add ext4_sb_bread() to disambiguate ENOMEM cases 2019-01-09 17:38:43 +01:00
mmp.c ext4: don't mark mmp buffer head dirty 2018-09-15 17:11:25 -04:00
move_extent.c ext4: use jbd2_inode dirty range scoping 2019-07-28 08:29:29 +02:00
namei.c ext4: fix ext4_empty_dir() for directories with holes 2019-12-31 16:36:26 +01:00
page-io.c
readpage.c ext4: readpages() should submit IO as read-ahead 2018-08-17 16:20:29 -07:00
resize.c ext4: avoid drop reference to iloc.bh twice 2019-05-22 07:37:42 +02:00
super.c ext4: add more paranoia checking in ext4_expand_extra_isize handling 2019-12-05 09:21:32 +01:00
symlink.c
sysfs.c for-4.19/block-20180812 2018-08-14 10:23:25 -07:00
truncate.h ext4: handle layout changes to pinned DAX mappings 2018-07-29 17:00:22 -04:00
xattr.c ext4: ignore e_value_offs for xattrs with value-in-ea-inode 2019-05-22 07:37:42 +02:00
xattr.h
xattr_security.c
xattr_trusted.c
xattr_user.c