• Z
    xfs: always init fdblocks in mount · 8ee0b29d
    Zheng Bin 提交于
    hulk inclusion
    category: bugfix
    bugzilla: 31088
    CVE: NA
    
    ---------------------------
    
    Use fuzz(hydra) to test XFS and automatically generate
    tmp.img(XFS v5 format, but some metadata is wrong)
    
    xfs_repair information(just one AG):
    agf_freeblks 0, counted 3224 in ag 0
    agf_longest 0, counted 3224 in ag 0
    sb_fdblocks 3228, counted 3224
    
    Test as follows:
    mount tmp.img tmpdir
    cp file1M tmpdir
    sync
    
    In 4.19-stable, sync will stuck, while in linux-next, sync not stuck.
    The reason is same to commit d0c7feaf
    ("xfs: add agf freeblocks verify in xfs_agf_verify"), cause agf_longest
    is 0, we can not block this in xfs_agf_verify.
    
    Make sure fdblocks is always inited in mount(also init ifree, icount).
    
    xfs_mountfs
      xfs_check_summary_counts
        xfs_initialize_perag_data
    Signed-off-by: NZheng Bin <zhengbin13@huawei.com>
    Reviewed-by: NHou Tao <houtao1@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    8ee0b29d
xfs_mount.c 35.1 KB