diff options
author | Evgeniy Dushistov <dushistov@mail.ru> | 2006-07-01 07:36:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-01 12:56:03 -0400 |
commit | 10e5dce07e6f8f9cea1b54161a888bb099484f88 (patch) | |
tree | 9c7949cf82763344d86ae302748f8e1d278b565a /fs/ufs/util.h | |
parent | eb28931e4a2c89e53d2b0c1a02a843240bff0806 (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/util.h')
-rw-r--r-- | fs/ufs/util.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/ufs/util.h b/fs/ufs/util.h index 406981fff5e7..28fce6c239b5 100644 --- a/fs/ufs/util.h +++ b/fs/ufs/util.h | |||
@@ -251,6 +251,14 @@ extern void _ubh_ubhcpymem_(struct ufs_sb_private_info *, unsigned char *, struc | |||
251 | #define ubh_memcpyubh(ubh,mem,size) _ubh_memcpyubh_(uspi,ubh,mem,size) | 251 | #define ubh_memcpyubh(ubh,mem,size) _ubh_memcpyubh_(uspi,ubh,mem,size) |
252 | extern void _ubh_memcpyubh_(struct ufs_sb_private_info *, struct ufs_buffer_head *, unsigned char *, unsigned); | 252 | extern void _ubh_memcpyubh_(struct ufs_sb_private_info *, struct ufs_buffer_head *, unsigned char *, unsigned); |
253 | 253 | ||
254 | /* This functions works with cache pages*/ | ||
255 | extern struct page *ufs_get_locked_page(struct address_space *mapping, | ||
256 | pgoff_t index); | ||
257 | static inline void ufs_put_locked_page(struct page *page) | ||
258 | { | ||
259 | unlock_page(page); | ||
260 | page_cache_release(page); | ||
261 | } | ||
254 | 262 | ||
255 | 263 | ||
256 | /* | 264 | /* |