From e7a705fcd8c6ab434a105b3b3241e14061bb0856 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 14 May 2021 04:54:39 +0000 Subject: [PATCH] scst_vdisk, vdisk_blockio: Fix the resync_size functionality Fixes: https://github.com/bvanassche/scst/issues/36 Fixes: df4c250b8db5 ("scst_vdisk: Port to Linux kernel v5.11") git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9386 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index aa01fea1b..406fe9a25 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -6712,7 +6712,7 @@ static int vdisk_resync_size(struct scst_vdisk_dev *virt_dev) sBUG_ON(virt_dev->nullio); sBUG_ON(!virt_dev->filename); - if ((virt_dev->fd == NULL) || !virt_dev->dev_active) { + if ((!virt_dev->fd && !virt_dev->bdev) || !virt_dev->dev_active) { res = -EMEDIUMTYPE; goto out; }