James Bottomley writes:
> On Fri, 2015-01-23 at 05:17 -0800, Christoph Hellwig wrote:
>> On Fri, Jan 23, 2015 at 01:24:15PM +1030, Rusty Russell wrote:
>> > The correct fix is to turn try_module_get() into __module_get(), and
>> > always do the module_put().
ld code, we expected try_module_get() to fail but then used
> module_refcount() to detect the failure and not do a put.
Yep, I've put that patch in my fixes queue now.
Thanks,
Rusty.
From: Rusty Russell
Subject: scsi: always increment reference count
James reported:
> After e513cc1 module: Remov
James Bottomley writes:
> Actually, I don't think this is enough. Some Australian once came up
> with a guide to APIs, and lectured on it at length, one of which was
> that the name should be the obvious use and it is unexpected that a
> refcount would go negative. I think we could raise it from
James Bottomley writes:
> On Mon, 2015-01-19 at 16:21 +1030, Rusty Russell wrote:
>> Masami Hiramatsu writes:
>> > (2015/01/19 1:55), James Bottomley wrote:
>> >> From: James Bottomley
>> >>
>> >> After e513cc1 module: Remove stop_mac
Masami Hiramatsu writes:
> (2015/01/19 1:55), James Bottomley wrote:
>> From: James Bottomley
>>
>> After e513cc1 module: Remove stop_machine from module unloading,
>> module_refcount() is returning (unsigned long)-1 when called from within
>> a routine that runs in module_exit. This is confusi
James Bottomley writes:
> From: James Bottomley
>
> After e513cc1 module: Remove stop_machine from module unloading,
> module_refcount() is returning (unsigned long)-1 when called from within
> a routine that runs in module_exit. This is confusing the scsi device
> put code which is coded to det
"Michael S. Tsirkin" writes:
> Defer config changed notifications that arrive during
> probe/scan/freeze/restore.
>
> This will allow drivers to set DRIVER_OK earlier, without worrying about
> racing with config change interrupts.
>
> This change will also benefit old hypervisors (before 2009)
> t
"Michael S. Tsirkin" writes:
> virtio spec 0.9.X requires DRIVER_OK to be set before
> VQs are used, but some drivers use VQs before probe
> function returns.
> Since DRIVER_OK is set after probe, this violates the spec.
>
> Even though under virtio 1.0 transitional devices support this
> behaviou
> index b00142e..2b2a9dd 100644
>> --- a/kernel/params.c
>> +++ b/kernel/params.c
>> @@ -253,6 +253,7 @@ STANDARD_PARAM_DEF(int, int, "%i", kstrtoint);
>> STANDARD_PARAM_DEF(uint, unsigned int, "%u", kstrtouint);
>> STANDARD_PARAM_DEF(long, long
used for
>> signaling when protection information buffers are expected to
>> preceed the data buffers.
>
> Cc rusty.
> Rusty could you please Ack merging this through Nicholas' tree
> together with the vhost changes?
Acked-by: Rusty Russell
Thanks,
Rusty.
--
To unsubsc
mp;virtscsi_vq->vq_lock)->rlock){..}, at: []
virtscsi_kick_cmd+0x18/0x1b0
CPU: 0 PID: 6 Comm: kworker/u2:0 Not tainted 3.15.0-rc5+ #110
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
rel-1.7.5-rc1-0-gb1d4dc9-20140515_140003-nilsson.home.kraxel.org 04/01/2014
Workqueue: scsi
Jason Wang writes:
> From: Asias He
>
> vqs are freed in virtscsi_freeze but the hotcpu_notifier is not
> unregistered. We will have a use-after-free usage when the notifier
> callback is called after virtscsi_freeze.
>
> Fixes: 285e71ea6f3583a85e27cb2b9a7d8c35d4c0d558
> ("virtio-scsi: reset virt
Jason Wang writes:
> On 10/28/2013 04:01 PM, Asias He wrote:
>> vqs are freed in virtscsi_freeze but the hotcpu_notifier is not
>> unregistered. We will have a use-after-free usage when the notifier
>> callback is called after virtscsi_freeze.
>>
>> Signed-off-by: Asias He
Please include a Fixes
Asias He writes:
> vscsi->num_queues counts the number of request virtqueue which does not
> include the control and event virtqueue. It is wrong to subtract
> VIRTIO_SCSI_VQ_BASE from vscsi->num_queues.
>
> This patch fixes the following panic.
Applied.
Thanks,
Rusty.
>
> (qemu) device_del scs
Asias He writes:
> On Sat, Apr 06, 2013 at 09:40:13AM +0100, James Bottomley wrote:
>> Well, I haven't had time to look at anything other than the patch I
>> commented on. I'm happy with your fix, so you can add my acked by to
>> that one. Since it's going through the virtio tree, don't wait for
Wanlong Gao writes:
> Add hot cpu notifier to reset the request virtqueue affinity
> when doing cpu hotplug.
You need to be careful to get_online_cpus() and put_online_cpus() here,
so CPUs can't go up and down in the middle of operations.
In particular, get_online_cpus()/put_online_cpus() around
Paolo Bonzini writes:
> Il 07/01/2013 01:02, Rusty Russell ha scritto:
>> Paolo Bonzini writes:
>>> Il 02/01/2013 06:03, Rusty Russell ha scritto:
>>>> Paolo Bonzini writes:
>>>>> The virtqueue_add_buf function has two limitations:
>>>
Paolo Bonzini writes:
> Il 02/01/2013 06:03, Rusty Russell ha scritto:
>> Paolo Bonzini writes:
>>> The virtqueue_add_buf function has two limitations:
>>>
>>> 1) it requires the caller to provide all the buffers in a single call;
>>>
>>> 2)
Wanlong Gao writes:
> On 01/02/2013 01:03 PM, Rusty Russell wrote:
>> Paolo Bonzini writes:
>>> The virtqueue_add_buf function has two limitations:
>>>
>>> 1) it requires the caller to provide all the buffers in a single call;
>>>
>>> 2) it d
plementation by having another interface is pretty
nasty; I think I'd prefer the chained scatterlists, if that's optimal
for you.
Cheers,
Rusty.
From: Rusty Russell
Subject: virtio: use chained scatterlists.
Rather than handing a scatterlist[] and out and in numbers to
virtqueue_add_b
at later if we want (probably
by merging the two structures, I'll have to think harder on that).
Acked-by: Rusty Russell
Cheers,
Rusty.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
e force the affinity hint
> - if the virtqueues share MSI, make the affinity OR over all affinities
> requested
>
> Signed-off-by: Jason Wang
> Signed-off-by: Paolo Bonzini
Applied, thanks.
Acked-by: Rusty Russell
Cheers,
Rusty.
--
To unsubscribe from this list: send the line "un
On Fri, 27 Jul 2012 10:11:26 +0200, Paolo Bonzini wrote:
> Il 27/07/2012 08:27, Rusty Russell ha scritto:
> >> > +int virtqueue_add_buf_sg(struct virtqueue *_vq,
> >> > + struct scatterlist *sg_out,
> >> > +
terlist stuff is complete crack, but I lost that
debate years ago.)
Here's my variant. Networking, console and block seem OK, at least
(ie. it booted!).
From: Rusty Russell
Subject: virtio: use chained scatterlists.
Rather than handing a scatterlist[] and out and in numbers to
virtqueue_
On Thursday 10 January 2008 09:10:37 James Bottomley wrote:
> On Tue, 2008-01-08 at 11:39 +1100, Rusty Russell wrote:
> > On Tuesday 08 January 2008 02:48:23 James Bottomley wrote:
> > > We're always open to new APIs (or more powerful and expanded old ones).
> > &
On Tuesday 08 January 2008 02:48:23 James Bottomley wrote:
> We're always open to new APIs (or more powerful and expanded old ones).
> The way we've been doing the sg_chain conversion is to slide API layers
> into the drivers so sg_chain becomes a simple API flip when we turn it
> on. Unfortunatel
On Monday 07 January 2008 17:37:41 Tejun Heo wrote:
> Rusty Russell wrote:
> > Hi Tejun,
> >
> >Nice try! Even ignoring the ugliness of undoing such an operation if
> > the caller doesn't expect you to mangle their chains, consider a
> > one-element sg ar
On Monday 07 January 2008 16:01:40 Tejun Heo wrote:
> > But we hit the same problems:
> >
> > 1) sg_chain loses information. The clever chain packaging makes reading
> > easy, but manipulation is severely limited. You can append to your own
> > chains by padding, but not someone elses. This work
On Sunday 06 January 2008 02:31:12 James Bottomley wrote:
> On Wed, 2007-12-19 at 17:31 +1100, Rusty Russell wrote:
> > This patch series is the start of my attempt to simplify and make
> > explicit the chained scatterlist logic.
> >
> > It's not complete: my SAT
I realize that sg chaining is a ploy to make the rest of the kernel
devs feel the pain of the SCSI subsystem. But this was a little
unsubtle.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
diff -r b3aec596b841 include/linux/scatterlist.h
--- a/include/linux/scatterlist.h Mon Jan
On Thursday 03 January 2008 20:26:13 Boaz Harrosh wrote:
> On Thu, Jan 03 2008 at 10:50 +0200, Rusty Russell <[EMAIL PROTECTED]>
wrote:
> > This patch simply converts direct uses of ->use_sg and ->request_buffer
> > to use the wrapper macros. This removes the assumpt
fig
option (CONFIG_SCSI_SG_CHAIN).
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
drivers/scsi/Kconfig|6 +
drivers/scsi/scsi_error.c | 15 +--
drivers/scsi/scsi_lib.c | 219 +---
drivers/scsi/scsi_lib_dma.c | 27 ++---
drivers/scsi/scsi_
usb_stor_bulk_transfer_sg() assumes buf is a scatterlist array if
use_sg is non-NULL. Change it to an explicit sg arg, instead, to
allow the callers to change to scsi_sglist().
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
diff -r 09247461cfda drivers/usb/storage/freecom.c
--- a/drive
g.c's paranoid
checking, so that code had to be shuffled a little.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
drivers/scsi/NCR5380.c |6 +++---
drivers/scsi/NCR53C9x.c |6 +++---
drivers/scsi/aha1542.c | 14 +++---
drivers/scsi/atari_NCR5380.
OK, after wading through many scsi drivers, I decided to change tack and try
to provide a transition path. This is in two stages:
1) These two patches. sg_ring used underneath, but if any driver asks for
scsi_sglist() they get a 2.6.24-style chained sg. No other patches are
necessary.
2) On
On Thursday 27 December 2007 13:09:27 FUJITA Tomonori wrote:
> On Wed, 26 Dec 2007 11:27:40 +1100
>
> Rusty Russell <[EMAIL PROTECTED]> wrote:
> > There are many signs through the code that it needs a great deal of
> > work: what is the purpose of sg_break?
On Wednesday 26 December 2007 19:36:36 Tejun Heo wrote:
> It would be better to build upon sg chaining as we already have it. I
> think it can be made much easier with a bit more safe guards,
> generalization and some helpers.
Hi Tejun,
I did this work to replace sg chaining. The current ch
ew sg_ring entry; you need a separate counter
if you really want a simple increment.
Various flaws in the driver have been maintained.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
diff -r 63176a8a6ce3 drivers/scsi/ips.c
--- a/drivers/scsi/ips.cMon Dec 24 17:40:08 2007 +1100
+++ b
On Friday 21 December 2007 13:28:34 FUJITA Tomonori wrote:
> I'm not sure about chaining the headers (as your sg_ring and
> scsi_sgtable do) would simplify LLDs. Have you looked at ips or
> qla1280?
Not yet, am working my way through the drivers, but I don't expect it will be
a simplification to
On Friday 21 December 2007 11:40:00 David Miller wrote:
> From: Rusty Russell <[EMAIL PROTECTED]>
> Date: Fri, 21 Dec 2007 11:35:12 +1100
>
> > On Friday 21 December 2007 11:00:27 FUJITA Tomonori wrote:
> > > We need to pass the whole sg entries to the IOMMU
On Friday 21 December 2007 11:00:27 FUJITA Tomonori wrote:
> We need to pass the whole sg entries to the IOMMUs at a time.
Hi Fujita,
OK, it's certainly possible to have an arch override. For which
architecture is this BTW?
Thanks,
Rusty.
-
To unsubscribe from this list: send the line "u
On Thursday 20 December 2007 18:58:07 David Miller wrote:
> From: Rusty Russell <[EMAIL PROTECTED]>
> Date: Thu, 20 Dec 2007 18:53:48 +1100
>
> > Manipulating the magic chains is horrible; it looks simple to the
> > places which simply want to iterate through it, but it
On Thursday 20 December 2007 18:42:44 David Miller wrote:
> From: FUJITA Tomonori <[EMAIL PROTECTED]>
> Date: Thu, 20 Dec 2007 16:06:31 +0900
>
> > On Thu, 20 Dec 2007 16:49:30 +1100
> >
> > Rusty Russell <[EMAIL PROTECTED]> wrote:
> > > +/**
&
On Thursday 20 December 2007 18:07:41 FUJITA Tomonori wrote:
> On Thu, 20 Dec 2007 16:45:18 +1100
>
> Rusty Russell <[EMAIL PROTECTED]> wrote:
> > OK, some fixes since last time, as I wade through more SCSI drivers.
> > Some drivers use "use_sg" as a flag
Hi Alan,
Was looking through initio.c to convert it to sg_ring, and noticed this
code:
initio_build_scb() around 2616:
sg = &cblk->sglist[0];
scsi_for_each_sg(cmnd, sglist, cblk->sglen, i) {
sg->data = cpu_to_le32((u32)sg_dma_addres
levent if ->sg isn't set)
3) sg_ring_for_each is no longer required, just iterate directly over ->sg.
4) The iterator updates a struct sg_ring (sg) and an index (k), so previous
references to sg become &sg->sg[k] (the k'th element within the sg_ring sg).
Signed-off-by: Rusty
d->sg, and
scsi_bufflen should just be cmd->request_bufflen if you need it.
If nothing else, the simplification of this logic shows why I prefer
sg_ring over scatterlist chaining.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi
Obvious counterpart to blk_rq_map_sg.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -31,6 +31,7 @@
#include
#include
#include
+#include
/*
* for max sense size
@@ -1364,6 +1
Obvious counterpart to dma_map_sg. Note that this is arch-independent
code; sg_rings are backwards compatible with simple sg arrays.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
drivers/base/dma-mapping.c | 13 +
include/linux/dma-mapping.h |4
2 files c
ist' because it is easy to break down the ring into
its constituent arrays.
The sg_ring header also encodes the maximum number of entries, useful
for routines which populate an sg. We need never hand around a number
of elements any more.
Signed-off-by: Rusty Russell <[EMAIL PROTECT
OK, some fixes since last time, as I wade through more SCSI drivers. Some
drivers use "use_sg" as a flag to know whether the request_buffer is a
scatterlist: I don't need the counter, but I still need the flag, so I fixed
that in a more intuitive way (an explicit ->sg pointer in the cmd).
Also
simply append an sg_ring entry with the padding, and normal iterators
can be used.
I renamed qc->cursg to qc->cur_sg to catch all the users: they should
now be referring to 'qc->cur_sg[qc->cursg_i]' wherever they were using
'qc->cursg'.
Signed-off-by: Rusty R
flag, and buf_virt pointer, and always
initialize qc->nbytes in ata_sg_init().
It's possible that the ATA_QCFLAG_SG and ATA_QCFLAG_DMAMAP flags could
be entirely removed, and we could use whether qc->__sg is NULL or not.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
diff
If nothing else, the simplification of this logic shows why I prefer
sg_ring over scatterlist chaining.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c
--- a/drivers/block/cciss_scsi.c
+++ b/drivers/block/cciss_
Obvious counterpart to dma_map_sg. Note that this is arch-independent
code; sg_rings are backwards compatible with simple sg arrays.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
drivers/base/dma-mapping.c | 13 +
include/linux/dma-mapping.h |4
2 files c
blk_rq_map_sg_ring as a counterpart to blk_rq_map_sg.
Obvious counterpart to blk_rq_map_sg.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
block/ll_rw_blk.c | 55
include/linux/blkdev.h |1 +
2 files changed, 56 insertions
pass a scatterlist
array and two numbers indicating the number of readable and writable
elements respectively; now we can simply hand two sg_rings which is
much clearer (each sg_ring contains its own length).
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
drivers/block/virtio_blk.
um number of entries, useful
for routines which populate an sg. We need never hand around a number
of elements any more.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
---
include/linux/sg_ring.h | 74
1 files changed, 74 insertions(+), 0
This patch series is the start of my attempt to simplify and make explicit
the chained scatterlist logic.
It's not complete: my SATA box boots and seems happy, but all the other
users of SCSI need to be updated and checked. But I've gotten far enough
to believe it's worth persuing.
Cheers,
Rusty
If blk_rq_map_sg wrote more than was allocated in the scatterlist,
BUG_ON() is probably the right thing to do.
Signed-off-by: Rusty Russell <[EMAIL PROTECTED]>
Acked-by: Jens Axboe <[EMAIL PROTECTED]>
---
drivers/scsi/scsi_tgt_lib.c | 11 +++
1 files changed, 3 inse
60 matches
Mail list logo