Skip to content
  • Chao Yu's avatar
    f2fs: exclude free nids building and allocation · 2411cf5b
    Chao Yu authored
    
    
    During nid allocation, it needs to exclude building and allocating flow
    of free nids, this is because while building free nid cache, there are two
    steps: a) load free nids from unused nat entries in NAT pages, b) update
    free nid cache by checking nat journal. The two steps should be atomical,
    otherwise an used nid can be allocated as free one after a) and before b).
    
    This patch adds missing lock which covers build_free_nids in
    unlock_operation and f2fs_balance_fs_bg to avoid that.
    
    Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    2411cf5b