All of lore.kernel.org
 help / color / mirror / Atom feed
* xenbus_dev_write and failed writes
@ 2007-03-02 16:06 John Levon
  2007-03-02 16:26 ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: John Levon @ 2007-03-02 16:06 UTC (permalink / raw)
  To: xen-devel


In several places after setting u->len we return directly on error.
Apart from the partial write case, it seems all of these should be
resetting u->len to 0 as happens in the success case?

regards
john

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: xenbus_dev_write and failed writes
  2007-03-02 16:06 xenbus_dev_write and failed writes John Levon
@ 2007-03-02 16:26 ` Keir Fraser
  2007-03-02 16:35   ` John Levon
  0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2007-03-02 16:26 UTC (permalink / raw)
  To: John Levon, xen-devel

On 2/3/07 16:06, "John Levon" <levon@movementarian.org> wrote:

> In several places after setting u->len we return directly on error.
> Apart from the partial write case, it seems all of these should be
> resetting u->len to 0 as happens in the success case?

Indeed. Now fixed (along with a couple of other bugs in that function).

 -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: xenbus_dev_write and failed writes
  2007-03-02 16:26 ` Keir Fraser
@ 2007-03-02 16:35   ` John Levon
  2007-03-02 16:46     ` Keir Fraser
  0 siblings, 1 reply; 5+ messages in thread
From: John Levon @ 2007-03-02 16:35 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

On Fri, Mar 02, 2007 at 04:26:22PM +0000, Keir Fraser wrote:

> On 2/3/07 16:06, "John Levon" <levon@movementarian.org> wrote:
> 
> > In several places after setting u->len we return directly on error.
> > Apart from the partial write case, it seems all of these should be
> > resetting u->len to 0 as happens in the success case?
> 
> Indeed. Now fixed (along with a couple of other bugs in that function).

Also, the BUG_ON in xenbusdrv_queue_reply() looks odd to me (in fact the
whole function does). Are we really guaranteed that a reply message will
be less than a page size? And it doesn't seem right to just stomp on the
buffer contents if we wrap right past the consumer value.

We've seen both the BUG_ON (well, the ASSERT) and "xenstore-ls /" hang.
Looking into exactly why now...

regards
john

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: xenbus_dev_write and failed writes
  2007-03-02 16:35   ` John Levon
@ 2007-03-02 16:46     ` Keir Fraser
  2007-03-02 16:58       ` John Levon
  0 siblings, 1 reply; 5+ messages in thread
From: Keir Fraser @ 2007-03-02 16:46 UTC (permalink / raw)
  To: John Levon; +Cc: xen-devel

On 2/3/07 16:35, "John Levon" <levon@movementarian.org> wrote:

> Also, the BUG_ON in xenbusdrv_queue_reply() looks odd to me (in fact the
> whole function does). Are we really guaranteed that a reply message will
> be less than a page size? And it doesn't seem right to just stomp on the
> buffer contents if we wrap right past the consumer value.

Yes, it at least makes sense to discard the data rather than BUG. Actually
we should dynamically allocate up to some rather larger threshold than 4kB.
Will you fix this?

 -- Keir

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: xenbus_dev_write and failed writes
  2007-03-02 16:46     ` Keir Fraser
@ 2007-03-02 16:58       ` John Levon
  0 siblings, 0 replies; 5+ messages in thread
From: John Levon @ 2007-03-02 16:58 UTC (permalink / raw)
  To: Keir Fraser; +Cc: xen-devel

On Fri, Mar 02, 2007 at 04:46:50PM +0000, Keir Fraser wrote:

> > Also, the BUG_ON in xenbusdrv_queue_reply() looks odd to me (in fact the
> > whole function does). Are we really guaranteed that a reply message will
> > be less than a page size? And it doesn't seem right to just stomp on the
> > buffer contents if we wrap right past the consumer value.
> 
> Yes, it at least makes sense to discard the data rather than BUG. Actually
> we should dynamically allocate up to some rather larger threshold than 4kB.
> Will you fix this?

I doubt I'll have time to fix /both/ kernels, sorry...

regards
john

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-02 16:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-02 16:06 xenbus_dev_write and failed writes John Levon
2007-03-02 16:26 ` Keir Fraser
2007-03-02 16:35   ` John Levon
2007-03-02 16:46     ` Keir Fraser
2007-03-02 16:58       ` John Levon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.