From: Bryan Wu It should pass "newsize" to vmtruncate function to modify the inode->i_size, while the old size is passed to vmtruncate. This bug was caught by LTP truncate test case on Blackfin platform. After it was fixed, the LTP truncate test case passed. Signed-off-by: Bryan Wu Cc: David Howells Signed-off-by: Andrew Morton --- fs/ramfs/file-nommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN fs/ramfs/file-nommu.c~ramfs-nommu-a-bug-in-ramfs_nommu_resize-function-passing-old-size-to-vmtruncate fs/ramfs/file-nommu.c --- a/fs/ramfs/file-nommu.c~ramfs-nommu-a-bug-in-ramfs_nommu_resize-function-passing-old-size-to-vmtruncate +++ a/fs/ramfs/file-nommu.c @@ -179,7 +179,7 @@ static int ramfs_nommu_resize(struct ino return ret; } - ret = vmtruncate(inode, size); + ret = vmtruncate(inode, newsize); return ret; } _