From: Evgeniy Dushistov Date: Sat, 1 Jul 2006 11:36:24 +0000 (-0700) Subject: [PATCH] ufs: truncate should allocate block for last byte X-Git-Tag: v2.6.18-rc1~204 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10e5dce07e6f8f9cea1b54161a888bb099484f88;p=pandora-kernel.git [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 --- Reading git-diff-tree failed