]> git.baikalelectronics.ru Git - kernel.git/commit
[PATCH] ufs: zeroize the rest of block in truncate
authorEvgeniy Dushistov <dushistov@mail.ru>
Fri, 16 Mar 2007 21:38:09 +0000 (13:38 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sat, 17 Mar 2007 02:25:03 +0000 (19:25 -0700)
commit2309dc99c17537c63df2f531e8b3163cd2e83f25
tree435db82996e6114eea94f8315c699c7c9904615b
parent0f4ebfef0b5f2b2edc3dcb31d631f0074f0a98e6
[PATCH] ufs: zeroize the rest of block in truncate

This patch fix behaviour in such test scenario:

  lseek(fd, BIG_OFFSET)
  write(fd, buf, sizeof(buf))
  truncate(BIG_OFFSET)
  truncate(BIG_OFFSET + sizeof(buf))
  read(fd, buf...)

Because of if file big enough(BIG_OFFSET) we start allocate space by block,
ordinary block size > page size, so we should zeroize the rest of block in
truncate(except last framgnet, about which VFS should care), to not get
garbage, when we extend file.

Also patch corrects conversion from pointer to block to physical block number,
this helps in case of not common used UFS types.

And add to debug output inode number.

Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/ufs/balloc.c
fs/ufs/inode.c
fs/ufs/truncate.c