diff options
author | Evgeniy Dushistov <dushistov@mail.ru> | 2006-08-27 01:23:45 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-08-27 11:01:31 -0700 |
commit | c37336b078ba9d2ff38c535b194996a7ad6e69f8 (patch) | |
tree | 36bb05432893a6db7620e283ea90e6be2c483363 /fs/ufs/truncate.c | |
parent | 08fb306fe63d98eb86e3b16f4cc21816fa47f18e (diff) | |
download | linux-c37336b078ba9d2ff38c535b194996a7ad6e69f8.tar.bz2 |
[PATCH] ufs: write to hole in big file
On UFS, this scenario:
open(O_TRUNC)
lseek(1024 * 1024 * 80)
write("A")
lseek(1024 * 2)
write("A")
may cause access to invalid address.
This happened because of "goal" is calculated in wrong way in block
allocation path, as I see this problem exists also in 2.4.
We use construction like this i_data[lastfrag], i_data array of pointers to
direct blocks, indirect and so on, it has ceratain size ~20 elements, and
lastfrag may have value for example 40000.
Also this patch fixes related to handling such scenario issues, wrong
zeroing metadata, in case of block(not fragment) allocation, and wrong goal
calculation, when we allocate block
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/truncate.c')
0 files changed, 0 insertions, 0 deletions