2007-05-31 03:33:01

by Bryan Wu

[permalink] [raw]
Subject: [PATCH] [RAMFS NOMMU]: a bug in ramfs_nommu_resize function, passing old size to vmtruncate

It should be pass "newsize" to vmtruncate function to modify the
inode->i_size,
while the old size is passed to vmtruncate.

This bug was catched by LTP truncate test case on Blackfin platform.
After it was fixed, the LTP truncate test case passed.

Signed-off-by: Bryan Wu <[email protected]>
Cc: David Howells <[email protected]>
---
fs/ramfs/file-nommu.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index 3b481d5..9345a46 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -179,7 +179,7 @@ static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size)
return ret;
}

- ret = vmtruncate(inode, size);
+ ret = vmtruncate(inode, newsize);

return ret;
}
--
1.5.2


2007-05-31 03:36:26

by Bryan Wu

[permalink] [raw]
Subject: Re: [PATCH] [RAMFS NOMMU]: a bug in ramfs_nommu_resize function, passing old size to vmtruncate

On Thu, 2007-05-31 at 11:31 +0800, Bryan Wu wrote:
> It should be pass "newsize" to vmtruncate function to modify the
> inode->i_size,
> while the old size is passed to vmtruncate.
>
> This bug was catched by LTP truncate test case on Blackfin platform.
> After it was fixed, the LTP truncate test case passed.
>
> Signed-off-by: Bryan Wu <[email protected]>
> Cc: David Howells <[email protected]>
> ---
> fs/ramfs/file-nommu.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
> index 3b481d5..9345a46 100644
> --- a/fs/ramfs/file-nommu.c
> +++ b/fs/ramfs/file-nommu.c
> @@ -179,7 +179,7 @@ static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size)
> return ret;
> }
>
> - ret = vmtruncate(inode, size);
> + ret = vmtruncate(inode, newsize);
>
> return ret;
> }

David:

Sorry for sending this email several times , my git-send-email got some
problem.

Thanks
-Bryan Wu

2007-05-31 03:55:55

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] [RAMFS NOMMU]: a bug in ramfs_nommu_resize function, passing old size to vmtruncate



On Thu, 31 May 2007, Bryan Wu wrote:
>
> Sorry for sending this email several times , my git-send-email got some
> problem.

The patch was whitespace-damaged (tabs had been turned into spaces).

But I fixed it up and applied it.

Linus

2007-05-31 04:03:32

by Bryan Wu

[permalink] [raw]
Subject: Re: [PATCH] [RAMFS NOMMU]: a bug in ramfs_nommu_resize function, passing old size to vmtruncate

On Wed, 2007-05-30 at 20:55 -0700, Linus Torvalds wrote:
>
> On Thu, 31 May 2007, Bryan Wu wrote:
> >
> > Sorry for sending this email several times , my git-send-email got some
> > problem.
>
> The patch was whitespace-damaged (tabs had been turned into spaces).
>
> But I fixed it up and applied it.
>
> Linus

WOW, I tried git-send-email to you, Andrew and LKML. but got a warnning

--
W: unable to extract a valid address from: [email protected] [email protected] [email protected]
--

But It can send email to Signed-off-by and Cc. I tried 3 times, David
got 3 same emails, sorry for this, -:).

Then I send out this patch manually in my evolution.
Maybe Copy & Paste introduced the whitespace.
I will go back to check my git's problem.

Thanks
-Bryan Wu

2007-05-31 04:19:25

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] [RAMFS NOMMU]: a bug in ramfs_nommu_resize function, passing old size to vmtruncate

On Thu, 31 May 2007 12:03:22 +0800 Bryan Wu <[email protected]> wrote:

> W: unable to extract a valid address from: [email protected] [email protected] [email protected]

Maybe it didn't like the "fundation" typo.

2007-05-31 04:33:01

by Bryan Wu

[permalink] [raw]
Subject: Re: [PATCH] [RAMFS NOMMU]: a bug in ramfs_nommu_resize function, passing old size to vmtruncate

On Wed, 2007-05-30 at 21:18 -0700, Andrew Morton wrote:
> On Thu, 31 May 2007 12:03:22 +0800 Bryan Wu <[email protected]> wrote:
>
> > W: unable to extract a valid address from: [email protected] [email protected] [email protected]
>
> Maybe it didn't like the "fundation" typo.
> -

Oh, I input this Warning message in my Laptop Evolution. It is right on
my Desktop git-send-email. -:)))

Thanks
-Bryan

> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/