= virtscsi_device_reset,
> + .slave_alloc = virtscsi_device_alloc,
>
> .can_queue = 1024,
> .dma_boundary = UINT_MAX,
> --
> 1.8.3.1
>
Reviewed-by: Fam Zheng <f...@redhat.com>
Some compilers don't like BLK_DEF_MAX_SECTORS being an enum (int) when
expanding min_not_zero. Cast it to sector_t so it matches the type of
the other operand, logical_to_sectors().
Signed-off-by: Fam Zheng <f...@redhat.com>
---
drivers/scsi/sd.c | 2 +-
1 file changed, 1 insertion
On Thu, 03/30 11:30, Martin K. Petersen wrote:
> Fam Zheng <f...@redhat.com> writes:
>
> >>rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
> >> BLK_DEF_MAX_SECTORS);
> >
> > Yes, it is better. Is it okay to
On Wed, 03/29 22:37, Martin K. Petersen wrote:
> Fam Zheng <f...@redhat.com> writes:
>
> Fam,
>
> > diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> > index fcfeddc..a5c7e67 100644
> > --- a/drivers/scsi/sd.c
> > +++ b/drivers/scsi/sd.c
> > @@
If device reports a small max_xfer_blocks and a zero opt_xfer_blocks, we
end up using BLK_DEF_MAX_SECTORS, which is wrong and r/w of that size
may get error.
Fixes: ca369d51b3e ("block/sd: Fix device-imposed transfer length limits")
Signed-off-by: Fam Zheng <f...@redhat.com&g
If device reports a small max_xfer_blocks and a zero opt_xfer_blocks, we
end up using BLK_DEF_MAX_SECTORS, which is wrong and r/w of that size
may get error.
Fixes: ca369d51b3e ("block/sd: Fix device-imposed transfer length limits")
Signed-off-by: Fam Zheng <f...@redhat.com>
-
On Wed, 03/01 17:11, Laurence Oberman wrote:
> This was suggested by Ewan and is the best way to know what the actual max I/O
> size for sg_io would be for the LPFC driver.
This sounds silly, why is there a "lame" max I/O size as in max_sectors_kb,
that is unusable because of a more limiting
Signed-off-by: Fam Zheng <f...@redhat.com>
---
include/uapi/linux/virtio_scsi.h | 6 ++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/virtio_scsi.h b/include/uapi/linux/virtio_scsi.h
index cc18ef8..a26fb31 100644
--- a/include/uapi/linux/virtio_scsi.h
+++ b/includ
This implements the VIRTIO_SCSI_F_FC_HOST feature by reading the config
fields and presenting them as sysfs fc_host attributes. The config
change handler is added here because primary_active will toggle during
migration.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
drivers/scsi/virtio_
v2: Fix endianness of WWNN/WWPN. [Paolo]
This series implements the proposed fc_host feature of virtio-scsi.
The first patch updates the data structure changes according to the spec
proposal; the second patch actually implements the operations.
Fam Zheng (2):
virtio_scsi: Add fc_host
On Wed, 01/18 15:28, Cathy Avery wrote:
> Enable FC lightweight host option so that the luns exposed by
> the driver may be manually scanned.
Hi Cathy, out of curiosity: how does this relate to issue_lip operation? And how
to trigger manual scan with this patch?
Fam
--
To unsubscribe from this
On Tue, 01/17 14:17, Paolo Bonzini wrote:
>
>
> On 16/01/2017 18:26, Fam Zheng wrote:
> >> Is the endianness correct for big-endian host here?
> >
> > I think so. The fc_host sysfs uses u64 to represent port_name and node_name,
> > this patch does
On Mon, 01/16 22:11, Eric Farman wrote:
> (cc'ing linux-scsi for the cover-letter; patches only to QEMU lists.)
>
> In the Linux kernel, I see two (three) places where the BLKSECTGET ioctl is
> handled:
>
> (1) block/(compat_)ioctl.c -- (compat_)blkdev_ioctl
> (2) drivers/scsi/sg.c -- sg_ioctl
>
gt; https://github.com/0day-ci/linux/commits/Fam-Zheng/virtio-scsi-Implement-FC_HOST-feature/20170117-011950
> config: i386-randconfig-r0-201703 (attached as .config)
> compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904
> reproduce:
> # save the attached .config to linux build
On Mon, 01/16 09:34, Christoph Hellwig wrote:
> On Tue, Jan 17, 2017 at 12:04:28AM +0800, Fam Zheng wrote:
> > This series implements the proposed fc_host feature of virtio-scsi.
>
> Yikes. Why?
Hi Christoph, this is mostly to "passthrough" a host NPIV vport (leavin
On Mon, 01/16 17:45, Paolo Bonzini wrote:
>
>
> On 16/01/2017 17:04, Fam Zheng wrote:
> > + node_name = virtio_cread64(vdev,
> > + offsetof(struct virtio_scsi_config, primary_wwnn));
> > + port_name = virtio_cread64(vdev,
>
Signed-off-by: Fam Zheng <f...@redhat.com>
---
include/uapi/linux/virtio_scsi.h | 6 ++
1 file changed, 6 insertions(+)
diff --git a/include/uapi/linux/virtio_scsi.h b/include/uapi/linux/virtio_scsi.h
index cc18ef8..a26fb31 100644
--- a/include/uapi/linux/virtio_scsi.h
+++ b/includ
This implements the VIRTIO_SCSI_F_FC_HOST feature by reading the config
fields and presenting them as sysfs fc_host attributes. The config
change handler is added here because primary_active will toggle during
migration.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
drivers/scsi/virtio_
This series implements the proposed fc_host feature of virtio-scsi.
The first patch updates the data structure changes according to the spec
proposal; the second patch actually implements the operations.
Fam Zheng (2):
virtio_scsi: Add fc_host definitions
virtio_scsi: Implement fc_host
gt;
> - if (virtscsi_kick_cmd(req_vq, cmd, req_size, sizeof(cmd->resp.cmd)) !=
> 0)
> + ret = virtscsi_kick_cmd(req_vq, cmd, req_size, sizeof(cmd->resp.cmd));
> + if (ret == -EIO) {
> + cmd->resp.cmd.response = VIRTIO_SCSI_S_BAD_TARGET;
> + spin_lock_irqsave(_vq->vq_
The parameter name should be wwpn instead of wwnn.
Signed-off-by: Fam Zheng <f...@redhat.com>
---
include/scsi/libfc.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index 96dd0b3..da5033d 100644
--- a/include/scsi/l
On Thu, 01/12 08:28, Eric Farman wrote:
> > > - if (virtscsi_kick_cmd(req_vq, cmd, req_size, sizeof(cmd->resp.cmd)) !=
> > > 0)
> > > + ret = virtscsi_kick_cmd(req_vq, cmd, req_size, sizeof(cmd->resp.cmd));
> > > + if (ret == -EIO) {
> > > + cmd->resp.cmd.response =
On Wed, 01/11 17:02, Eric Farman wrote:
> In the case of a graceful set of detaches, where the virtio-scsi-ccw
> disk is removed from the guest prior to the controller, the guest
> behaves quite normally. Specifically, the detach gets us into
> sd_sync_cache to issue a Synchronize Cache(10)
On Thu, 05/26 17:08, Long Li wrote:
> The block sector size should be in unit of 512 bytes, not in bytes.
>
> Signed-off-by: Long Li
>
> ---
> drivers/scsi/sd.c | 6 --
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/sd.c
On Wed, 01/20 11:01, Martin K. Petersen wrote:
> Commit ca369d51b3e1 ("block/sd: Fix device-imposed transfer length
> limits") accidentally switched optimal I/O size reporting from bytes to
> block layer sectors.
>
> Signed-off-by: Martin K. Petersen
> Reported-by:
On Tue, 04/21 19:58, James Bottomley wrote:
On Tue, 2015-03-24 at 18:16 +0800, Fam Zheng wrote:
If the disk can't read capacity, we should return an error.
I'm not sure I buy this: you need to justify why.
For instance removable media return an error in revalidate that causes
the medium
On Tue, 03/24 11:34, Paolo Bonzini wrote:
On 24/03/2015 11:16, Fam Zheng wrote:
If issued right after link down, blockdev --rereadpt will be stuck for a
while and then return normally. Although the underlying capacity and
partition
table are not correctly updated. And it means
On Tue, 03/24 11:34, Paolo Bonzini wrote:
On 24/03/2015 11:16, Fam Zheng wrote:
If issued right after link down, blockdev --rereadpt will be stuck for a
while and then return normally. Although the underlying capacity and
partition
table are not correctly updated. And it means
This improves the error code if BLKRRPART ioctl failed due to connection
issue.
Before:
$ blockdev --rereadpt /dev/sda
BLKRRPART: Invalid argument
After:
$ blockdev --rereadpt /dev/sda
BLKRRPART: Input/output error
Signed-off-by: Fam Zheng f...@redhat.com
If the disk can't read capacity, we should return an error.
Signed-off-by: Fam Zheng f...@redhat.com
---
block/partition-generic.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block/partition-generic.c b/block/partition-generic.c
index 0d9e5f9..1e60d7d 100644
command through the
stack, so that the ioctl could fail with -EIO.
Fam Zheng (3):
block: Return error in rescan_partitions if revalidating disk failed
sd: Return error in sd_revalidate_disk if read capacity failed
sd: Return -EIO if read capacity failed
block/partition-generic.c | 6
necessary.
Signed-off-by: Fam Zheng f...@redhat.com
---
drivers/scsi/sd.c | 18 +++---
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 6b78476..7e5ca3b 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -113,7 +113,7
On Fri, 01/30 00:11, Paolo Bonzini wrote:
On 29/01/2015 00:00, Christoph Hellwig wrote:
Lock the device embedded in the scsi_device to protect against
concurrent calls to -remove.
Signed-off-by: Christoph Hellwig h...@lst.de
I wonder if this makes this problem:
. I'm able to reproduce it by
repeatedly plugging and unplugging a scsi disk with the same lun number.
To fix this, a single thread workqueue (local to the module) is added,
which makes the scan work serialized. With this change, the panic goes
away.
Signed-off-by: Fam Zheng f...@redhat.com
---
v4
On Tue, 01/06 11:35, Michael S. Tsirkin wrote:
On Tue, Jan 06, 2015 at 03:33:36PM +0800, Fam Zheng wrote:
There is a race condition in virtscsi_handle_event, when many device
hotplug/unplug events flush in quickly.
The scsi_remove_device in virtscsi_handle_transport_reset may trigger
. I'm able to reproduce it by
repeatedly plugging and unplugging a scsi disk with the same lun number.
To fix this, a single thread workqueue (local to the module) is added,
which makes the scan work serialized. With this change, the panic goes
away.
Signed-off-by: Fam Zheng f...@redhat.com
---
v3
On Tue, 01/06 16:54, Michael S. Tsirkin wrote:
On Tue, Jan 06, 2015 at 09:25:05PM +0800, Fam Zheng wrote:
There is a race condition in virtscsi_handle_event, when many device
hotplug/unplug events flush in quickly.
The scsi_remove_device in virtscsi_handle_transport_reset may trigger
. I'm able to reproduce it by
repeatedly plugging and unplugging a scsi disk with the same lun number.
To make is safe, a single thread workqueue local to the module is added
which runs the scan work. With this change, the panic goes away.
Signed-off-by: Fam Zheng f...@redhat.com
---
v2: Use
On Tue, 01/06 00:10, Michael S. Tsirkin wrote:
On Mon, Jan 05, 2015 at 11:48:47AM -0800, Venkatesh Srinivas wrote:
On Sun, Jan 4, 2015 at 10:04 PM, Fam Zheng f...@redhat.com wrote:
There is a race condition in virtscsi_handle_event, when many device
hotplug/unplug events flush
-by: Fam Zheng f...@redhat.com
---
drivers/scsi/virtio_scsi.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index c52bb5d..7f194d4 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -110,6 +110,9 @@ struct
] Kernel Offset: 0x0 from 0x8100 (relocation range:
0x8000-0x9fff)
[0.475068] ---[ end Kernel panic - not syncing: Attempted to kill init!
exitcode=0x0009
Signed-off-by: Fam Zheng f...@redhat.com
Acked-by: Paolo Bonzini pbonz...@redhat.com
Cc: sta
] Kernel Offset: 0x0 from 0x8100 (relocation range:
0x8000-0x9fff)
[0.475068] ---[ end Kernel panic - not syncing: Attempted to kill init!
exitcode=0x0009
Signed-off-by: Fam Zheng f...@redhat.com
---
drivers/scsi/virtio_scsi.c | 6 +-
1 file
According to SPC-4, section 4.5.2.1, 252 is the limit of sense data. So
increase the values.
Tested by hacking QEMU to fake virtio-scsi request sense len to 252.
Without this patch the driver stops working immediately when it gets the
request.
Signed-off-by: Fam Zheng f...@redhat.com
According to SPC-4, section 4.5.2.1, 252 is the limit of sense data. So
increase the value.
Signed-off-by: Fam Zheng f...@redhat.com
---
include/linux/virtio_scsi.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/virtio_scsi.h b/include/linux/virtio_scsi.h
index
On Thu, 03/06 11:09, Paolo Bonzini wrote:
Il 06/03/2014 09:47, Fam Zheng ha scritto:
According to SPC-4, section 4.5.2.1, 252 is the limit of sense data. So
increase the value.
Signed-off-by: Fam Zheng f...@redhat.com
---
include/linux/virtio_scsi.h | 2 +-
1 file changed, 1 insertion
On Thu, 03/06 12:55, Paolo Bonzini wrote:
Il 06/03/2014 12:22, Hannes Reinecke ha scritto:
On 03/06/2014 11:09 AM, Paolo Bonzini wrote:
Il 06/03/2014 09:47, Fam Zheng ha scritto:
According to SPC-4, section 4.5.2.1, 252 is the limit of sense
data. So
increase the value.
Signed-off-by: Fam
46 matches
Mail list logo