linux-stable/Documentation/filesystems
Lukas Czerner 9875320b08 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-21 12:37:47 +02:00
..
caching Page cache changes for 5.19 2022-05-24 19:55:07 -07:00
cifs Documentation: ksmbd: update Feature Status table 2022-03-20 11:03:41 -05:00
ext4 Documentation: ext4: fix cell spacing of table heading on blockmap table 2022-08-02 23:56:02 -04:00
nfs Documentation: Add an explanation of NFSv4 client identifiers 2022-05-17 15:33:21 -04:00
spufs
9p.rst
adfs.rst
affs.rst
afs.rst
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 docs: filesystems: Fix grammatical error "with" to "which" 2021-11-15 02:54:37 -07:00
automount-support.rst
befs.rst
bfs.rst
btrfs.rst Documentation: update btrfs list of features and link to readthedocs.io 2022-06-21 14:47:19 +02:00
ceph.rst doc: document new CephFS mount device syntax 2022-01-13 13:40:06 +01:00
coda.rst
configfs.rst
cramfs.rst
dax.rst Documentation/filesystem/dax: update DAX description on erofs 2022-03-16 09:38:38 +08: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: update documentation 2022-05-29 15:39:04 +08:00
ext2.rst ext2: remove nobh support 2022-08-02 12:34:04 -04:00
ext3.rst
f2fs.rst f2fs-for-6.0 2022-08-08 11:18:31 -07:00
fiemap.rst
files.rst
fscrypt.rst fscrypt: Add HCTR2 support for filename encryption 2022-06-10 16:40:18 +08:00
fsverity.rst fs-verity: mention btrfs support 2022-07-15 23:42:30 -07:00
fuse-io.rst
fuse.rst fuse: Add module param for CAP_SYS_ADMIN access bypassing allow_other 2022-07-21 16:06:19 +02:00
gfs2-glocks.rst
gfs2-uevents.rst
gfs2.rst
hfs.rst
hfsplus.rst
hpfs.rst
idmappings.rst docs: Add small intro to idmap examples 2022-05-09 11:20:43 +02:00
index.rst Documentation: remove reference to now removed mandatory-locking doc 2021-10-05 06:02:53 -04:00
inotify.rst
isofs.rst
journalling.rst
locking.rst fs: Add aops->migrate_folio 2022-08-02 12:34:03 -04:00
locks.rst docs: fs: locks.rst: update comment about mandatory file locking 2021-10-19 06:48:21 -04:00
mount_api.rst
netfs_library.rst netfs: do not unlock and put the folio twice 2022-07-14 10:10:12 +02: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 Revert "ovl: turn of SB_POSIXACL with idmapped layers temporarily" 2022-07-15 22:10:51 +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 fs: remove no_llseek 2022-07-16 09:19:47 -04:00
proc.rst doc: proc: fix the description to THPeligible 2022-07-17 17:14:33 -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-21 12:37:47 +02:00
virtiofs.rst
xfs-delayed-logging-design.rst xfs: expanding delayed logging design with background material 2022-07-07 18:56:09 +10:00
xfs-self-describing-metadata.rst
zonefs.rst documentation: zonefs: Document sysfs attributes 2022-04-26 14:53:06 +09:00