]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commit
f2fs: wait on atomic writes to count F2FS_CP_WB_DATA
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 28 Dec 2018 19:00:38 +0000 (11:00 -0800)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 20 Mar 2019 19:09:18 +0000 (14:09 -0500)
commit8a4ef7d33c074034d3c0e9d7fde9e8a703d9e8a5
treedf82351a2e5dba226a9359c7870714f70d9298eb
parentb1ecc2b5770edf1da112b410e8b24659c859e5cb
f2fs: wait on atomic writes to count F2FS_CP_WB_DATA

BugLink: https://bugs.launchpad.net/bugs/1821074
commit 31867b23d7d1ee3535136c6a410a6cf56f666bfc upstream.

Otherwise, we can get wrong counts incurring checkpoint hang.

IO_W (CP:  -24, Data:   24, Flush: (   0    0    1), Discard: (   0    0))

Thread A                        Thread B
- f2fs_write_data_pages
 -  __write_data_page
  - f2fs_submit_page_write
   - inc_page_count(F2FS_WB_DATA)
     type is F2FS_WB_DATA due to file is non-atomic one
- f2fs_ioc_start_atomic_write
 - set_inode_flag(FI_ATOMIC_FILE)
                                - f2fs_write_end_io
                                 - dec_page_count(F2FS_WB_CP_DATA)
                                   type is F2FS_WB_DATA due to file becomes
                                   atomic one

Cc: <stable@vger.kernel.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
fs/f2fs/file.c