未验证 提交 8121bcb0 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!1400 [openEuler-1.0-LTS] block: Try to handle busy underlying device on discard

Merge Pull Request from: @zh-hhhhh 
 

If you run qemu-img convert -t none when iscsi back-end storage is used (mounted using multipath), an error message is displayed indicating Device or resource busy. The error message is resolved after patch is added

bugzilla: https://gitee.com/openeuler/kernel/issues/I7GDLI
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/fs/block_dev.c?h=v5.10.180&id=d44c9780ed40db88626c9354868eab72159c7a7f

     
 
Link:https://gitee.com/openeuler/kernel/pulls/1400 

Reviewed-by: Zhang Changzhong <zhangchangzhong@huawei.com> 
Reviewed-by: Yu Kuai <yukuai3@huawei.com> 
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> 
......@@ -1149,12 +1149,21 @@ int truncate_bdev_range(struct block_device *bdev, fmode_t mode,
err = bd_prepare_to_claim(bdev, claimed_bdev,
truncate_bdev_range);
if (err)
return err;
goto invalidate;
}
truncate_inode_pages_range(bdev->bd_inode->i_mapping, lstart, lend);
if (claimed_bdev)
bd_abort_claiming(bdev, claimed_bdev, truncate_bdev_range);
return 0;
invalidate:
/*
* Someone else has handle exclusively open. Try invalidating instead.
* The 'end' argument is inclusive so the rounding is safe.
*/
return invalidate_inode_pages2_range(bdev->bd_inode->i_mapping,
lstart >> PAGE_SHIFT,
lend >> PAGE_SHIFT);
}
EXPORT_SYMBOL(truncate_bdev_range);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册