From 10e5dce07e6f8f9cea1b54161a888bb099484f88 Mon Sep 17 00:00:00 2001 From: Evgeniy Dushistov Date: Sat, 1 Jul 2006 04:36:24 -0700 Subject: [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/ufs/file.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'fs/ufs/file.c') diff --git a/fs/ufs/file.c b/fs/ufs/file.c index 0e5001512a9..a9c6e5f04fa 100644 --- a/fs/ufs/file.c +++ b/fs/ufs/file.c @@ -60,7 +60,3 @@ const struct file_operations ufs_file_operations = { .fsync = ufs_sync_file, .sendfile = generic_file_sendfile, }; - -struct inode_operations ufs_file_inode_operations = { - .truncate = ufs_truncate, -}; -- cgit v1.2.3