Skip to contentSkip to conversation

: a bug in ramfs_nommu_resize function, passing old size to vmtruncate

PATCH In review Bryan Wu 3 participants 6 messages May 31, 2007

lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

PATCH 1/1 : 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.

Cc David Howells <[email protected]>
---
 fs/ramfs/file-nommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ramfs/file-nommu.c +1 -1
index 3b481d5..9345a46 100644
@@ -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;
 }
Signature · 1 line
1.5.2
author
#1 lore raw
Quoted 18 lines · Bryan Wu

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.

Cc David Howells <[email protected]>
---
 fs/ramfs/file-nommu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ramfs/file-nommu.c +0 -0
index 3b481d5..9345a46 100644

fs/ramfs/file-nommu.c static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size) · line 185

Quoted 8 lines
fs/ramfs/file-nommu.c +1 -1
@@ -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

#2 lore raw
Quoted 3 lines · Bryan Wu

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

author
#3 lore raw
Quoted 11 lines · Linus Torvalds
Quoted 3 lines · Bryan Wu

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

author
#5 lore raw
Quoted 6 lines · Andrew Morton
Quoted 1 line · 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

Quoted 4 lines

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/