Commit 5d00e317 authored by Zhihao Cheng's avatar Zhihao Cheng Committed by Zheng Zengkai
Browse files

ubi: fastmap: Don't reserve beb_rsvd_pebs while filling fm pool

hulk inclusion
category: bugfix
bugzilla: 186690, https://gitee.com/openeuler/kernel/issues/I56U8P



--------------------------------

Following script will cause a ENOSPC error while creating ubi volume:
  ID="0x20,0xa5,0x00,0x16"  # 2G-size 128KB-PEB
  modprobe nandsim id_bytes=$ID
  modprobe ubi
  ubiattach -m0
  ubimkvol /dev/ubi0 -N test -s 400MiB # ENOSPC returned

Commit c4d51010 ("ubi: fastmap: Fix high cpu usage of ubi_bgt by
making sure wl_pool not empty") fills free PEBs into fm pool after
reserving 'beb_rsvd_pebs', which will cause that there maybe no enough
free PEBs filled into fm pool (Especially when the UBI device has just
been initialized). Then, ubimkvol could get ENOSPC after ubi attached.
Fix it by filling fm pool without reserving 'beb_rsvd_pebs'.

Fixes: c4d51010 ("ubi: fastmap: Fix high cpu ... not empty")
Signed-off-by: default avatarZhihao Cheng <chengzhihao1@huawei.com>
Reviewed-by: default avatarJason Yan <yanaijie@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent cc284ecd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment