linux-stable/Documentation/filesystems
Lukas Czerner 0d94230343 fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE
commit cbfecb927f upstream.

Currently the I_DIRTY_TIME will never get set if the inode already has
I_DIRTY_INODE with assumption that it supersedes I_DIRTY_TIME.  That's
true, however ext4 will only update the on-disk inode in
->dirty_inode(), not on actual writeback. As a result if the inode
already has I_DIRTY_INODE state by the time we get to
__mark_inode_dirty() only with I_DIRTY_TIME, the time was already filled
into on-disk inode and will not get updated until the next I_DIRTY_INODE
update, which might never come if we crash or get a power failure.

The problem can be reproduced on ext4 by running xfstest generic/622
with -o iversion mount option.

Fix it by allowing I_DIRTY_TIME to be set even if the inode already has
I_DIRTY_INODE. Also make sure that the case is properly handled in
writeback_single_inode() as well. Additionally changes in
xfs_fs_dirty_inode() was made to accommodate for I_DIRTY_TIME in flag.

Thanks Jan Kara for suggestions on how to make this work properly.

Cc: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: stable@kernel.org
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Suggested-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220825100657.44217-1-lczerner@redhat.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-10-26 12:34:27 +02:00
..
caching
cifs ksmbd: update SMB3 multi-channel support in ksmbd.rst 2021-08-13 08:18:15 +09:00
ext4 ext4, doc: fix incorrect h_reserved size 2022-04-27 14:39:01 +02:00
nfs
spufs
9p.rst
adfs.rst
affs.rst
afs.rst AFS: Documentation: fix a few typos in afs.rst 2021-01-21 14:06:00 -07:00
api-summary.rst block: move fs/block_dev.c to block/bdev.c 2021-09-07 08:39:40 -06:00
autofs-mount-control.rst
autofs.rst
automount-support.rst
befs.rst
bfs.rst
btrfs.rst
ceph.rst
coda.rst
configfs.rst
cramfs.rst
dax.rst docs: convert dax.txt to rst 2021-06-04 11:31:02 -06:00
debugfs.rst debugfs: remove return value of debugfs_create_bool() 2021-05-21 20:59:03 +02:00
devpts.rst
directory-locking.rst
dlmfs.rst
dnotify.rst
ecryptfs.rst
efivarfs.rst
erofs.rst erofs: introduce chunk-based file on-disk format 2021-08-20 22:38:01 +08:00
ext2.rst docs: fix a cross-ref 2021-06-13 17:02:46 -06:00
ext3.rst
f2fs.rst f2fs: support fault injection for dquot_initialize() 2022-06-09 10:23:13 +02:00
fiemap.rst
files.rst
fscrypt.rst fscrypt: allow 256-bit master keys with AES-256-XTS 2021-11-18 19:16:11 +01:00
fsverity.rst fs-verity: support reading signature with ioctl 2021-02-07 14:51:19 -08:00
fuse-io.rst
fuse.rst
gfs2-glocks.rst
gfs2-uevents.rst
gfs2.rst
hfs.rst
hfsplus.rst
hpfs.rst
idmappings.rst docs: update mapping documentation 2022-07-02 16:41:15 +02:00
index.rst Merge git://github.com/Paragon-Software-Group/linux-ntfs3 2021-09-04 11:15:50 -07:00
inotify.rst
isofs.rst
journalling.rst
locking.rst overlayfs update for 5.15 2021-09-02 09:21:27 -07:00
locks.rst
mount_api.rst
netfs_library.rst netfs: Documentation for helper library 2021-04-23 10:14:32 +01:00
nilfs2.rst
ntfs.rst
ntfs3.rst Doc/fs/ntfs3: Fix rst format and make it cleaner 2021-09-20 18:53:12 +03:00
ocfs2-online-filecheck.rst
ocfs2.rst
omfs.rst
orangefs.rst
overlayfs.rst ovl: skip checking lower file's i_writecount on truncate 2021-08-17 11:47:44 +02:00
path-lookup.rst Merge branch 'work.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2021-07-03 11:41:14 -07:00
path-lookup.txt
porting.rst Merge branch 'work.namei' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2021-07-03 11:41:14 -07:00
proc.rst procfs/dmabuf: add inode number to /proc/*/fdinfo 2021-07-01 11:06:04 -07:00
qnx6.rst
quota.rst
ramfs-rootfs-initramfs.rst Documentation: Fix intiramfs script name 2021-07-18 23:48:14 +09:00
relay.rst
romfs.rst
seq_file.rst seq_file: document how per-entry resources are managed. 2021-02-26 09:41:05 -08:00
sharedsubtree.rst
splice.rst
squashfs.rst
sysfs.rst
sysv-fs.rst
tmpfs.rst
ubifs-authentication.rst
ubifs.rst
udf.rst
vfat.rst docs: filesystems: Fix a mundane typo 2021-03-25 11:51:23 -06:00
vfs.rst fs: record I_DIRTY_TIME even if inode already has I_DIRTY_INODE 2022-10-26 12:34:27 +02:00
virtiofs.rst
xfs-delayed-logging-design.rst
xfs-self-describing-metadata.rst
zonefs.rst