On Thu, 2013-05-30 at 06:17 +0800, Asias He wrote: > On Wed, May 29, 2013 at 08:10:44AM -0700, Badari Pulavarty wrote: > > On 05/29/2013 02:05 AM, Wenchao Xia wrote: > > >于 2013-5-28 17:00, Wenchao Xia 写道: <SNIP> > > > I have done a basic test of vhost-scsi, following is the result I'd > > >like to post, generally it seems fine: > > > > > >Result: > > > fdisk/mkfs: fdisk can find it, mke2fs works fine. > > > mount: can mount it. > > > file I/O: dd 90M zero to a file in that disk succeed. > > > > > > > > I tried without nested kvm. > > > > > > > >Issues: > > > 1) in fdisk -l, sometime timeout with dmesg "end_request: I/O error, > > >dev fd0, sector 0", I guess it is caused by nested KVM that failed > > >to kick host kernel? > > > > > > I don't see this issue. Are you sure "fd0" is actually the scsi device ? > > what is "fd0" ? > > > > > 2) in fdisk -l, it shows 512 bytes larger than the parameter I > > >specified in fd_dev_size parameter in configfs on host.(shows > > >104858112 bytes, see the invocation script below) > > > > > > > I see the same. For some reason "fdisk -l" in the VM shows > > 512-bytes more than the actual size for the file (on the host). > > Hmm, interesting. Will look into it. > > Nick, Any ideas here? > Mmm, fd_get_blocks() is not returning the expected minus one logical blocks with a !S_ISBLK() setup. This is happening for every other backend ->get_blocks() call already, and should be happening for the fd_dev_size case as well. Applying the following to target-pending.git now. diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 1b1d544..8a2ac90 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c @@ -694,11 +694,12 @@ static sector_t fd_get_blocks(struct se_device *dev) * to handle underlying block_device resize operations. */ if (S_ISBLK(i->i_mode)) - dev_size = (i_size_read(i) - fd_dev->fd_block_size); + dev_size = i_size_read(i); else dev_size = fd_dev->fd_dev_size; - return div_u64(dev_size, dev->dev_attrib.block_size); + return div_u64(dev_size - fd_dev->fd_block_size, + dev->dev_attrib.block_size); } static struct sbc_ops fd_sbc_ops = { -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html