f2fs: change i_compr_blocks of inode to atomic value
authorDaeho Jeong <daehojeong@google.com>
Tue, 8 Sep 2020 02:44:10 +0000 (11:44 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 11 Sep 2020 18:11:26 +0000 (11:11 -0700)
commitc2759ebaf7e8f5510d0a77bd5003a20375ea6ed5
tree36a905fc9badb003d76fd36342f98ad33dfaf7ec
parent32c0fec1aa85f1a9aebfd9445208f4223bcd96e8
f2fs: change i_compr_blocks of inode to atomic value

writepages() can be concurrently invoked for the same file by different
threads such as a thread fsyncing the file and a kworker kernel thread.
So, changing i_compr_blocks without protection is racy and we need to
protect it by changing it with atomic type value. Plus, we don't need
a 64bit value for i_compr_blocks, so just we will use a atomic value,
not atomic64.

Signed-off-by: Daeho Jeong <daehojeong@google.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/inode.c
fs/f2fs/super.c