aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ufs/file.c
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2006-07-01 07:36:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-01 12:56:03 -0400
commit10e5dce07e6f8f9cea1b54161a888bb099484f88 (patch)
tree9c7949cf82763344d86ae302748f8e1d278b565a /fs/ufs/file.c
parenteb28931e4a2c89e53d2b0c1a02a843240bff0806 (diff)
[PATCH] ufs: truncate should allocate block for last byte
This patch fixes buggy behaviour of UFS in such kind of scenario: open(, O_TRUNC...) ftruncate(, 1024) ftruncate(, 0) Such a scenario causes ufs_panic and remount read-only. This happen because of according to specification UFS should always allocate block for last byte, and many parts of our implementation rely on this, but `ufs_truncate' doesn't care about this. To make possible return error code and to know about old size, this patch removes `truncate' from ufs inode_operations and uses `setattr' method to call ufs_truncate. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ufs/file.c')
-rw-r--r--fs/ufs/file.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/fs/ufs/file.c b/fs/ufs/file.c
index 0e5001512a9d..a9c6e5f04fae 100644
--- a/fs/ufs/file.c
+++ b/fs/ufs/file.c
@@ -60,7 +60,3 @@ const struct file_operations ufs_file_operations = {
60 .fsync = ufs_sync_file, 60 .fsync = ufs_sync_file,
61 .sendfile = generic_file_sendfile, 61 .sendfile = generic_file_sendfile,
62}; 62};
63
64struct inode_operations ufs_file_inode_operations = {
65 .truncate = ufs_truncate,
66};