Commit dab85f89 authored by Chao Yu's avatar Chao Yu Committed by Treehugger Robot
Browse files

UPSTREAM: f2fs: reduce expensive checkpoint trigger frequency



We may trigger high frequent checkpoint for below case:
1. mkdir /mnt/dir1; set dir1 encrypted
2. touch /mnt/file1; fsync /mnt/file1
3. mkdir /mnt/dir2; set dir2 encrypted
4. touch /mnt/file2; fsync /mnt/file2
...

Although, newly created dir and file are not related, due to
commit bbf156f7 ("f2fs: fix lost xattrs of directories"), we will
trigger checkpoint whenever fsync() comes after a new encrypted dir
created.

In order to avoid such performance regression issue, let's record an
entry including directory's ino in global cache whenever we update
directory's xattr data, and then triggerring checkpoint() only if
xattr metadata of target file's parent was updated.

This patch updates to cover below no encryption case as well:
1) parent is checkpointed
2) set_xattr(dir) w/ new xnid
3) create(file)
4) fsync(file)

Bug: 370263554
Fixes: bbf156f7 ("f2fs: fix lost xattrs of directories")
Reported-by: default avatarwangzijie <wangzijie1@honor.com>
Reported-by: default avatarZhiguo Niu <zhiguo.niu@unisoc.com>
Tested-by: default avatarZhiguo Niu <zhiguo.niu@unisoc.com>
Reported-by: default avatarYunlei He <heyunlei@hihonor.com>
Change-Id: I5c9ba153aa2fc6b3ea65bc33ba887a99442fc133
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit aaf8c0b9)
(cherry picked from commit 65ed3483)
parent 422751d5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment