a bug in ramfs_nommu_resize function, passing old size to vmtruncate
authorBryan Wu <bryan.wu@analog.com>
Thu, 31 May 2007 03:31:55 +0000 (11:31 +0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 31 May 2007 03:54:07 +0000 (20:54 -0700)
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 caught 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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ramfs/file-nommu.c

index 3b481d5..9345a46 100644 (file)
@@ -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;
 }