Skip to content

Commit

Permalink
a bug in ramfs_nommu_resize function, passing old size to vmtruncate
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bryan Wu authored and Linus Torvalds committed May 31, 2007
1 parent b4946ff commit 3f0a676
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ramfs/file-nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3f0a676

Please sign in to comment.