* [patch 1/2] vfs: fix overflow in direct-io subsystem
@ 2010-10-13 20:45 Edward Shishkin
2010-10-14 11:17 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Edward Shishkin @ 2010-10-13 20:45 UTC (permalink / raw)
To: Andrew Morton, linux-fsdevel; +Cc: Eric Sandeen, lmcilroy, LKML
Fix up overflow (ssize_t->int) in the direct-io subsystem.
Signed-off-by: Edward Shishkin <edward@redhat.com>
---
fs/direct-io.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-2.6.36-rc7.orig/fs/direct-io.c
+++ linux-2.6.36-rc7/fs/direct-io.c
@@ -218,7 +218,7 @@ static struct page *dio_get_page(struct
* filesystems can use it to hold additional state between get_block calls and
* dio_complete.
*/
-static int dio_complete(struct dio *dio, loff_t offset, int ret, bool is_async)
+static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, bool is_async)
{
ssize_t transferred = 0;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/2] vfs: fix overflow in direct-io subsystem
2010-10-13 20:45 [patch 1/2] vfs: fix overflow in direct-io subsystem Edward Shishkin
@ 2010-10-14 11:17 ` Christoph Hellwig
2010-10-14 18:20 ` Jeff Moyer
2010-10-14 23:20 ` Andrew Morton
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2010-10-14 11:17 UTC (permalink / raw)
To: Edward Shishkin
Cc: Andrew Morton, linux-fsdevel, Eric Sandeen, lmcilroy, LKML
On Wed, Oct 13, 2010 at 10:45:57PM +0200, Edward Shishkin wrote:
> Fix up overflow (ssize_t->int) in the direct-io subsystem.
>
> Signed-off-by: Edward Shishkin <edward@redhat.com>
Looks good,
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/2] vfs: fix overflow in direct-io subsystem
2010-10-13 20:45 [patch 1/2] vfs: fix overflow in direct-io subsystem Edward Shishkin
2010-10-14 11:17 ` Christoph Hellwig
@ 2010-10-14 18:20 ` Jeff Moyer
2010-10-14 23:20 ` Andrew Morton
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Moyer @ 2010-10-14 18:20 UTC (permalink / raw)
To: Edward Shishkin
Cc: Andrew Morton, linux-fsdevel, Eric Sandeen, lmcilroy, LKML
Edward Shishkin <edward.shishkin@gmail.com> writes:
> Fix up overflow (ssize_t->int) in the direct-io subsystem.
>
> Signed-off-by: Edward Shishkin <edward@redhat.com>
> ---
> fs/direct-io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-2.6.36-rc7.orig/fs/direct-io.c
> +++ linux-2.6.36-rc7/fs/direct-io.c
> @@ -218,7 +218,7 @@ static struct page *dio_get_page(struct
> * filesystems can use it to hold additional state between get_block calls and
> * dio_complete.
> */
> -static int dio_complete(struct dio *dio, loff_t offset, int ret, bool is_async)
> +static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, bool is_async)
> {
> ssize_t transferred = 0;
Acked-by: Jeff Moyer <jmoyer@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 1/2] vfs: fix overflow in direct-io subsystem
2010-10-13 20:45 [patch 1/2] vfs: fix overflow in direct-io subsystem Edward Shishkin
2010-10-14 11:17 ` Christoph Hellwig
2010-10-14 18:20 ` Jeff Moyer
@ 2010-10-14 23:20 ` Andrew Morton
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2010-10-14 23:20 UTC (permalink / raw)
To: Edward Shishkin; +Cc: linux-fsdevel, Eric Sandeen, lmcilroy, LKML
On Wed, 13 Oct 2010 22:45:57 +0200
Edward Shishkin <edward.shishkin@gmail.com> wrote:
> Fix up overflow (ssize_t->int) in the direct-io subsystem.
>
> Signed-off-by: Edward Shishkin <edward@redhat.com>
> ---
> fs/direct-io.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-2.6.36-rc7.orig/fs/direct-io.c
> +++ linux-2.6.36-rc7/fs/direct-io.c
> @@ -218,7 +218,7 @@ static struct page *dio_get_page(struct
> * filesystems can use it to hold additional state between get_block calls and
> * dio_complete.
> */
> -static int dio_complete(struct dio *dio, loff_t offset, int ret, bool is_async)
> +static ssize_t dio_complete(struct dio *dio, loff_t offset, ssize_t ret, bool is_async)
> {
> ssize_t transferred = 0;
>
I'd call this a truncation error, not an overflow. Semantics.
So what's the runtime effect? The subsystem will go stupid when doing
a single transfer of over 2G on a 64-bit machine?
Can this actually happen in practice? Has nobody ever done this before
now?
<goes to test it>
<discovers that ubuntu 8.04's dd doesn't support conv=direct>
<stupid thing>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-14 23:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-13 20:45 [patch 1/2] vfs: fix overflow in direct-io subsystem Edward Shishkin
2010-10-14 11:17 ` Christoph Hellwig
2010-10-14 18:20 ` Jeff Moyer
2010-10-14 23:20 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).