diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 415896eb6..dfc41304b 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -838,6 +838,8 @@ static int vdisk_attach(struct scst_device *dev) goto out; } + virt_dev->dev = dev; + dev->block_shift = virt_dev->blk_shift; dev->block_size = 1 << dev->block_shift; @@ -848,8 +850,6 @@ static int vdisk_attach(struct scst_device *dev) goto out; } - virt_dev->dev = dev; - dev->dev_rd_only = virt_dev->rd_only; if (!virt_dev->cdrom_empty) { @@ -3741,7 +3741,6 @@ static enum compl_status_e fileio_exec_read(struct vdisk_cmd_params *p) if (finished) break; - loff += full_len; length = scst_get_buf_next(cmd, (uint8_t __force **)&address); }; @@ -3896,7 +3895,6 @@ restart: if (finished) break; - loff += saved_full_len; length = scst_get_buf_next(cmd, (uint8_t __force **)&address); }