mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [RAMFS NOMMU]: a bug in ramfs_nommu_resize function, passing old size to vmtruncate
@ 2007-05-31  3:31 Bryan Wu
  2007-05-31  3:35 ` Bryan Wu
  0 siblings, 1 reply; 6+ messages in thread
From: Bryan Wu @ 2007-05-31  3:31 UTC (permalink / raw)
  To: Linus Torvalds, akpm, Linux Kernel Mailing List, David Howells

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 <bryan.wu@analog.com>
Cc: David Howells <dhowells@redhat.com>
---
 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

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

end of thread, other threads:[~2007-05-31  4:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-31  3:31 [PATCH] [RAMFS NOMMU]: a bug in ramfs_nommu_resize function, passing old size to vmtruncate Bryan Wu
2007-05-31  3:35 ` Bryan Wu
2007-05-31  3:55   ` Linus Torvalds
2007-05-31  4:03     ` Bryan Wu
2007-05-31  4:18       ` Andrew Morton
2007-05-31  4:27         ` Bryan Wu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®