1. 05 7月, 2023 3 次提交
    • Z
      ext4: Stop trying writing pages if no free blocks generated · 07a8109d
      Zhihao Cheng 提交于
      hulk inclusion
      category: bugfix
      bugzilla: https://gitee.com/openeuler/kernel/issues/I7CBCS
      
      --------------------------------
      
      Folllowing steps could make ext4_wripages trap into a dead loop:
      
      1. Consume free_clusters until free_clusters > 2 * sbi->s_resv_clusters,
         and free_clusters > EXT4_FREECLUSTERS_WATERMARK.
         // eg. free_clusters = 1422, sbi->s_resv_clusters = 512
         // nr_cpus = 4, EXT4_FREECLUSTERS_WATERMARK = 512
      2. umount && mount.  // dirty_clusters = 0
      3. Run free_clusters tasks concurrently to write different files, many
         tasks write(appendant) 4K data by da_write method. And each inode will
         consume one data block and one extent block in map_block.
         // There are (free_clusters - EXT4_FREECLUSTERS_WATERMARK = 910)
         // tasks choosing da_write method, left 512 tasks choose write_begin
         // method. If tasks which chooses da_write path run first.
         // dirty_clusters = 910, free_clusters = 1422
         // Tasks which choose write_begin path will get ENOSPC:
         //  free_clusters < (nclusters + dirty_clusters + resv_clusters)
         //  1422 < (1 + 910 + 512)
      4. After certain number of map_block iterations in ext4_writepages.
         // free_clusters = 0,
         // dirty_clusters = 910 - (1422 / 2) = 199
      5. Delete one 4K file.  // free_clusters = 1
      6. ext4_writepages traps into dead loop:
          mpage_map_and_submit_extent
           mpage_map_one_extent // ret = ENOSPC
             ext4_map_blocks -> ext4_ext_map_blocks -> ext4_mb_new_blocks ->
             ext4_claim_free_clusters:
               if (free_clusters >= (nclusters + dirty_clusters)) // false
           if (err == -ENOSPC && ext4_count_free_clusters(sb)) // true
             return err
           *give_up_on_write = true // won't be executed
      
      Fix it by terminating ext4_writepages if no free blocks generated.
      Signed-off-by: NZhihao Cheng <chengzhihao1@huawei.com>
      07a8109d
    • O
      !1280 cgroup: always put cset in cgroup_css_set_put_fork · fc143182
      openeuler-ci-bot 提交于
      Merge Pull Request from: @wufan618223 
       
          A successful call to cgroup_css_set_fork() will always have taken
          a ref on kargs->cset (regardless of CLONE_INTO_CGROUP), so always
          do a corresponding put in cgroup_css_set_put_fork().
      
          Without this, a cset and its contained css structures will be
          leaked for some fork failures.  The following script reproduces
          the leak for a fork failure due to exceeding pids.max in the
          pids controller.  A similar thing can happen if we jump to the
          bad_fork_cancel_cgroup label in copy_process().
      
          [ -z "$1" ] && echo "Usage $0 pids-root" && exit 1
          PID_ROOT=$1
          CGROUP=$PID_ROOT/foo
      
          [ -e $CGROUP ] && rmdir -f $CGROUP
          mkdir $CGROUP
          echo 5 > $CGROUP/pids.max
          echo $$ > $CGROUP/cgroup.procs
      
          fork_bomb()
          {
                  set -e
                  for i in $(seq 10); do
                          /bin/sleep 3600 &
                  done
          }
      
          (fork_bomb) &
          wait
          echo $$ > $PID_ROOT/cgroup.procs
          kill $(cat $CGROUP/cgroup.procs)
          rmdir $CGROUP 
       
      Link:https://gitee.com/openeuler/kernel/pulls/1280 
      
      Reviewed-by: Jialin Zhang <zhangjialin11@huawei.com> 
      Signed-off-by: Jialin Zhang <zhangjialin11@huawei.com> 
      fc143182
    • O
      !1297 iommu/iova: move IOVA_MAX_GLOBAL_MAGS outside of IOMMU_SUPPORT · 6b915ed3
      openeuler-ci-bot 提交于
      Merge Pull Request from: @ci-robot 
       
      PR sync from: Zhang Zekun <zhangzekun11@huawei.com>
      https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/62KOPQGPH57KOUCLU3BZ6ECRRXYWU4HB/ 
       
       
      Link:https://gitee.com/openeuler/kernel/pulls/1297 
      
      Reviewed-by: Weilong Chen <chenweilong@huawei.com> 
      Reviewed-by: Zheng Zengkai <zhengzengkai@huawei.com> 
      Signed-off-by: Zheng Zengkai <zhengzengkai@huawei.com> 
      6b915ed3
  2. 04 7月, 2023 3 次提交
  3. 30 6月, 2023 3 次提交
  4. 29 6月, 2023 3 次提交
  5. 28 6月, 2023 6 次提交
  6. 27 6月, 2023 5 次提交
  7. 26 6月, 2023 11 次提交
  8. 25 6月, 2023 6 次提交