1. 22 4月, 2020 34 次提交
  2. 21 3月, 2020 2 次提交
  3. 20 3月, 2020 2 次提交
  4. 18 3月, 2020 2 次提交
    • Z
      xfs: avoid f_bfree overflow · 79d1a532
      Zheng Bin 提交于
      hulk inclusion
      category: bugfix
      bugzilla: 31088
      CVE: NA
      
      ---------------------------
      
      If fdblocks < mp->m_alloc_set_aside, statp->f_bfree will overflow.
      When we df -h /mnt(xfs mount point), will show this:
      Filesystem      Size  Used Avail Use% Mounted on
      /dev/loop0       17M  -64Z  -32K 100% /mnt
      
      We can construct an img like this:
      
      dd if=/dev/zero of=xfs.img bs=1M count=20
      mkfs.xfs -d agcount=1 xfs.img
      xfs_db -x xfs.img
      sb 0
      write fdblocks 0
      agf 0
      write freeblks 0
      write longest 0
      quit
      
      Make sure statp->f_bfree does not underflow.
      Signed-off-by: NZheng Bin <zhengbin13@huawei.com>
      Reviewed-by: NHou Tao <houtao1@huawei.com>
      Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
      79d1a532
    • 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 d0c7feaf8767
      ("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