All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: will_schmidt@vnet.ibm.com
Cc: linuxppc-dev@ozlabs.org, Pekka Enberg <penberg@cs.helsinki.fi>,
	Paul Mackerras <paulus@samba.org>,
	cbe-oss-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read
Date: Tue, 24 Oct 2006 21:58:32 +0200	[thread overview]
Message-ID: <200610242158.33069.arnd@arndb.de> (raw)
In-Reply-To: <1161719603.8946.84.camel@farscape>

On Tuesday 24 October 2006 21:53, Will Schmidt wrote:
> Hey Arnd,
> =C2=A0 =C2=A0just curiosity.. =C2=A0 What was the behavior before this pa=
tch? =C2=A0 just
> leaving a few (0 - 3) characters behind?

It transfers more bytes than requested on a read. If you asked for
four bytes, you got eight.

Note: one nasty property of this file in spufs is that you can only
read multiples of four bytes in the first place, there is no way to
atomically put back a few bytes into the hardware register, so reading
less than four bytes returns -EINVAL. Asking for more than four
should return the largest possible multiple of four.

	Arnd <><

WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: will_schmidt@vnet.ibm.com
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
	linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,
	cbe-oss-dev@ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read
Date: Tue, 24 Oct 2006 21:58:32 +0200	[thread overview]
Message-ID: <200610242158.33069.arnd@arndb.de> (raw)
In-Reply-To: <1161719603.8946.84.camel@farscape>

On Tuesday 24 October 2006 21:53, Will Schmidt wrote:
> Hey Arnd,
>    just curiosity..   What was the behavior before this patch?   just
> leaving a few (0 - 3) characters behind?

It transfers more bytes than requested on a read. If you asked for
four bytes, you got eight.

Note: one nasty property of this file in spufs is that you can only
read multiples of four bytes in the first place, there is no way to
atomically put back a few bytes into the hardware register, so reading
less than four bytes returns -EINVAL. Asking for more than four
should return the largest possible multiple of four.

	Arnd <><

  reply	other threads:[~2006-10-24 19:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-24 16:01 [PATCH 0/3] cell fixes 2.6.19 Arnd Bergmann
2006-10-24 16:01 ` [PATCH 2/3] spufs: fix another off-by-one bug in mbox_read Arnd Bergmann
2006-10-24 16:01   ` Arnd Bergmann
2006-10-24 18:42   ` Pekka Enberg
2006-10-24 18:42     ` Pekka Enberg
2006-10-24 19:07     ` Arnd Bergmann
2006-10-24 19:07       ` Arnd Bergmann
2006-10-24 19:53       ` Will Schmidt
2006-10-24 19:53         ` Will Schmidt
2006-10-24 19:58         ` Arnd Bergmann [this message]
2006-10-24 19:58           ` Arnd Bergmann
2006-10-24 16:01 ` [PATCH 3/3] cell: update defconfig Arnd Bergmann
2006-10-24 16:01   ` Arnd Bergmann
2006-10-24 16:27 ` [PATCH 1/3] spufs: fix signal2 file to report signal2 Arnd Bergmann
2006-10-24 16:27   ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200610242158.33069.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=will_schmidt@vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.