]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
f2fs: fix to don't trigger writeback during recovery
authorChao Yu <yuchao0@huawei.com>
Sat, 26 May 2018 10:03:34 +0000 (18:03 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 1 Mar 2019 13:20:33 +0000 (14:20 +0100)
BugLink: http://bugs.launchpad.net/bugs/1815234
[ Upstream commit 64c74a7ab505ea40d1b3e5d02735ecab08ae1b14 ]

- f2fs_fill_super
 - recover_fsync_data
  - recover_data
   - del_fsync_inode
    - iput
     - iput_final
      - write_inode_now
       - f2fs_write_inode
        - f2fs_balance_fs
         - f2fs_balance_fs_bg
          - sync_dirty_inodes

With data_flush mount option, during recovery, in order to avoid entering
above writeback flow, let's detect recovery status and do skip in
f2fs_balance_fs_bg.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Yunlei He <heyunlei@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/f2fs/segment.c

index 99729d9c3e610ae276a269f7efe206a3fd3ae8e9..1545a3ef0e2450e552872f8651a66be8ad8b5e99 100644 (file)
@@ -474,6 +474,9 @@ void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need)
 
 void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi)
 {
+       if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
+               return;
+
        /* try to shrink extent cache when there is no enough memory */
        if (!available_free_memory(sbi, EXTENT_CACHE))
                f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER);