linux-stable/fs/ext4
Harshad Shirwadkar 35ecf664fd ext4: fix rename whiteout with fast commit
commit 8210bb29c1 upstream.

This patch adds rename whiteout support in fast commits. Note that the
whiteout object that gets created is actually char device. Which
imples, the function ext4_inode_journal_mode(struct inode *inode)
would return "JOURNAL_DATA" for this inode. This has a consequence in
fast commit code that it will make creation of the whiteout object a
fast-commit ineligible behavior and thus will fall back to full
commits. With this patch, this can be observed by running fast commits
with rename whiteout and seeing the stats generated by ext4_fc_stats
tracepoint as follows:

ext4_fc_stats: dev 254:32 fc ineligible reasons:
XATTR:0, CROSS_RENAME:0, JOURNAL_FLAG_CHANGE:0, NO_MEM:0, SWAP_BOOT:0,
RESIZE:0, RENAME_DIR:0, FALLOC_RANGE:0, INODE_JOURNAL_DATA:16;
num_commits:6, ineligible: 6, numblks: 3

So in short, this patch guarantees that in case of rename whiteout, we
fall back to full commits.

Amir mentioned that instead of creating a new whiteout object for
every rename, we can create a static whiteout object with irrelevant
nlink. That will make fast commits to not fall back to full
commit. But until this happens, this patch will ensure correctness by
falling back to full commits.

Fixes: 8016e29f43 ("ext4: fast commit recovery path")
Cc: stable@kernel.org
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20210316221921.1124955-1-harshadshirwadkar@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-03-25 09:04:17 +01:00
..
acl.c ext4: main fast-commit commit path 2020-10-21 23:22:37 -04:00
acl.h
balloc.c ext4: fast commit recovery path 2020-10-21 23:22:38 -04:00
bitmap.c
block_validity.c ext4: rename system_blks to s_system_blks inside ext4_sb_info 2020-10-18 10:36:59 -04:00
dir.c ext4: use generic casefolding support 2020-10-28 13:43:13 -04:00
ext4.h ext4: fix rename whiteout with fast commit 2021-03-25 09:04:17 +01:00
ext4_extents.h ext4: fix EXT_MAX_EXTENT/INDEX to check for zeroed eh_max 2020-06-03 23:16:49 -04:00
ext4_jbd2.c ext4: fast commit recovery path 2020-10-21 23:22:38 -04:00
ext4_jbd2.h ext4: drop ext4_journal_free_reserved() 2020-06-03 23:16:53 -04:00
extents.c ext4: fix an IS_ERR() vs NULL check 2020-12-30 11:54:13 +01:00
extents_status.c ext4: fast commit recovery path 2020-10-21 23:22:38 -04:00
extents_status.h ext4: fix extent_status trace points 2020-01-25 02:03:03 -05:00
fast_commit.c ext4: fix rename whiteout with fast commit 2021-03-25 09:04:17 +01:00
fast_commit.h ext4: disable fast commit with data journalling 2020-11-06 23:01:05 -05:00
file.c ext4: don't leak old mountpoint samples 2021-01-19 18:27:22 +01:00
fsmap.c jbd2: rename j_maxlen to j_total_len and add jbd2_journal_max_txn_bufs 2020-11-06 23:01:02 -05:00
fsmap.h
fsync.c ext4: make s_mount_flags modifications atomic 2020-11-06 23:01:05 -05:00
hash.c ext4: use generic casefolding support 2020-10-28 13:43:13 -04:00
ialloc.c The siginificant new ext4 feature this time around is Harshad's new 2020-10-22 10:31:08 -07:00
indirect.c ext4: use ext4_sb_bread() instead of sb_bread() 2020-10-18 10:37:14 -04:00
inline.c ext4: unlock xattr_sem properly in ext4_inline_data_truncate() 2020-11-06 22:52:36 -05:00
inode-test.c kunit: allow kunit tests to be loaded as a module 2020-01-09 16:42:29 -07:00
inode.c ext4: fix potential error in ext4_do_update_inode 2021-03-25 09:04:17 +01:00
ioctl.c ext4: fix superblock checksum failure when setting password salt 2021-01-19 18:27:31 +01:00
Kconfig ext: EXT4_KUNIT_TESTS should depend on EXT4_FS instead of selecting it 2021-03-04 11:38:15 +01:00
Makefile ext4 / jbd2: add fast commit initialization 2020-10-21 23:22:26 -04:00
mballoc.c ext4: avoid s_mb_prefetch to be zero in individual scenarios 2021-01-06 14:56:56 +01:00
mballoc.h ext4: limit the length of per-inode prealloc list 2020-08-19 12:04:36 -04:00
migrate.c ext4: handle ext4_mark_inode_dirty errors 2020-06-03 23:16:50 -04:00
mmp.c ext4: use common helpers in all places reading metadata buffers 2020-10-18 10:37:14 -04:00
move_extent.c ext4: use common helpers in all places reading metadata buffers 2020-10-18 10:37:14 -04:00
namei.c ext4: fix rename whiteout with fast commit 2021-03-25 09:04:17 +01:00
page-io.c ext4: add inline encryption support 2020-07-08 10:29:43 -07:00
readpage.c Improvements to ext4's block allocator performance for very large file 2020-08-21 11:03:38 -07:00
resize.c ext4: use ext4_sb_bread() instead of sb_bread() 2020-10-18 10:37:14 -04:00
super.c ext4: don't try to processed freed blocks until mballoc is initialized 2021-03-17 17:06:25 +01:00
symlink.c
sysfs.c ext4: indicate that fast_commit is available via /sys/fs/ext4/feature/... 2020-10-28 13:43:22 -04:00
truncate.h ext4: handle layout changes to pinned DAX mappings 2018-07-29 17:00:22 -04:00
verity.c ext4: fix error handling in ext4_end_enable_verity() 2021-03-25 09:04:17 +01:00
xattr.c ext4: do not try to set xattr into ea_inode if value is empty 2021-03-25 09:04:17 +01:00
xattr.h ext4: support xattr gnu.* namespace for the Hurd 2020-06-12 13:23:34 -04:00
xattr_hurd.c ext4: support xattr gnu.* namespace for the Hurd 2020-06-12 13:23:34 -04:00
xattr_security.c
xattr_trusted.c
xattr_user.c