代码拉取完成,页面将自动刷新
【标题描述】能够简要描述问题:说明什么场景下,做了什么操作,出现什么问题(尽量使用正向表达方式)
执行下面脚本大概率复现UBI创建卷失败,报没有空间
#!/bin/bash
# exit on error
set -e
ubidetach -p /dev/mtd0 2>/dev/null || true
modprobe -r ubi 2>/dev/null || true
modprobe -r nandsim 2>/dev/null || true
mtd=/dev/mtd0
ubi=/dev/ubi0
# 2GB, 8-bits, page size 4KB, OOB 128B, block 128KB
ID="0x20,0xa5,0x00,0x16"
TSIZE=400MiB
modprobe nandsim id_bytes=$ID
flash_erase -q -j $mtd 0 0
modprobe ubi
ubiattach -p $mtd
ubimkvol $ubi -N test -s $TSIZE
exit 0
[ 32.228248] ubi0 error: ubi_wl_get_peb [ubi]: Unable to get a free PEB from user WL pool
[ 32.229321] ubi0 warning: ubi_eba_atomic_leb_change [ubi]: switch to read-only mode
[ 32.230341] CPU: 0 PID: 7439 Comm: ubimkvol Not tainted 5.10.0-14014-g00455bffe746-dirty #345
[ 32.231444] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-buildvm-ppc64le-16.ppc.fedoraproject.org-3.fc314
[ 32.233152] Call Trace:
[ 32.233494] ? dump_stack+0xa6/0xd5
[ 32.233958] ? ubi_eba_atomic_leb_change+0x45e/0x470 [ubi]
[ 32.234678] ? ubi_update_layout_vol+0x48/0x70 [ubi]
[ 32.235327] ? ubi_change_vtbl_record+0x9e/0x140 [ubi]
[ 32.235995] ? ubi_create_volume+0x63c/0x830 [ubi]
[ 32.236627] ? ubi_cdev_ioctl+0xc14/0x1170 [ubi]
[ 32.237228] ? __se_sys_ioctl+0xda/0x130
[ 32.237740] ? __x64_sys_ioctl+0x1e/0x30
[ 32.238255] ? do_syscall_64+0x45/0x70
[ 32.238741] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 32.239967] ubi0 error: ubi_create_volume [ubi]: cannot create volume 0, error -28
【环境信息】
硬件信息:
NA
软件信息:
OLK5.10
【问题复现步骤】
具体操作步骤
在内核加打印
diff --git a/drivers/mtd/ubi/fastmap-wl.c b/drivers/mtd/ubi/fastmap-wl.c
index 0ee452275578..b4f095e1dc09 100644
--- a/drivers/mtd/ubi/fastmap-wl.c
+++ b/drivers/mtd/ubi/fastmap-wl.c
@@ -187,6 +187,7 @@ void ubi_refill_pools(struct ubi_device *ubi)
break;
}
+ pr_err("pool->size %d\n", pool->size);
wl_pool->used = 0;
pool->used = 0;
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c
index 55bae06cf408..479b1b16f34d 100644
--- a/drivers/mtd/ubi/wl.c
+++ b/drivers/mtd/ubi/wl.c
@@ -185,12 +185,15 @@ static void wl_entry_destroy(struct ubi_device *ubi, struct ubi_wl_entry *e)
* This function returns zero in case of success and a negative error code in
* case of failure.
*/
+#include <linux/delay.h>
static int do_work(struct ubi_device *ubi)
{
int err;
struct ubi_work *wrk;
cond_resched();
+ if (ubi->free.rb_node)
+ msleep(2000);
/*
* @ubi->work_sem is used to synchronize with the workers. Workers take
执行上述复现脚本
出现概率(是否必现,概率性错误)大
【预期结果】
用户态ubimkvol失败,内核打印"ubi_wl_get_peb [ubi]: Unable to get a free PEB from user WL pool"
【实际结果】
ubimkvol: error!: cannot UBI create volume
error 28 (No space left on device)
setup ubifs failed
[ 32.228248] ubi0 error: ubi_wl_get_peb [ubi]: Unable to get a free PEB from user WL pool
[ 32.229321] ubi0 warning: ubi_eba_atomic_leb_change [ubi]: switch to read-only mode
[ 32.230341] CPU: 0 PID: 7439 Comm: ubimkvol Not tainted 5.10.0-14014-g00455bffe746-dirty #345
[ 32.231444] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20190727_073836-buildvm-ppc64le-16.ppc.fedoraproject.org-3.fc314
[ 32.233152] Call Trace:
[ 32.233494] ? dump_stack+0xa6/0xd5
[ 32.233958] ? ubi_eba_atomic_leb_change+0x45e/0x470 [ubi]
[ 32.234678] ? ubi_update_layout_vol+0x48/0x70 [ubi]
[ 32.235327] ? ubi_change_vtbl_record+0x9e/0x140 [ubi]
[ 32.235995] ? ubi_create_volume+0x63c/0x830 [ubi]
[ 32.236627] ? ubi_cdev_ioctl+0xc14/0x1170 [ubi]
[ 32.237228] ? __se_sys_ioctl+0xda/0x130
[ 32.237740] ? __x64_sys_ioctl+0x1e/0x30
[ 32.238255] ? do_syscall_64+0x45/0x70
[ 32.238741] ? entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 32.239967] ubi0 error: ubi_create_volume [ubi]: cannot create volume 0, error -28
【附件信息】
无
Hi czh549642238, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: Kernel, and any of the maintainers: @YangYingliang , @pi3orama , @成坚 (CHENG Jian) , @jiaoff , @Xie XiuQi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
登录 后才可以发表评论