--- zzzz-none-000/linux-4.4.271/drivers/mtd/ubi/cdev.c 2021-06-03 06:22:09.000000000 +0000 +++ hawkeye-5590-750/linux-4.4.271/drivers/mtd/ubi/cdev.c 2023-04-19 10:22:29.000000000 +0000 @@ -975,7 +975,7 @@ static long ctrl_cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - int err = 0; + int err = 0, force = 0; void __user *argp = (void __user *)arg; if (!capable(CAP_SYS_RESOURCE)) @@ -1025,6 +1025,10 @@ } /* Detach an MTD device command */ + case UBI_IOCFDET: + force = 1; + /* fallthrough */ + case UBI_IOCDET: { int ubi_num; @@ -1037,7 +1041,7 @@ } mutex_lock(&ubi_devices_mutex); - err = ubi_detach_mtd_dev(ubi_num, 0); + err = ubi_detach_mtd_dev(ubi_num, force); mutex_unlock(&ubi_devices_mutex); break; }