Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ff29b902 authored by Chao Yu's avatar Chao Yu Committed by Pranav Vashi
Browse files

f2fs: reduce expensive checkpoint trigger frequency



[ Upstream commit aaf8c0b9ae042494cb4585883b15c1332de77840 ]

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)

Change-Id: Id7c4c5b70c239458b74f92edca537dd844b0be6f
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>
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarPranav Vashi <neobuddy89@gmail.com>
parent c5db999e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment