truncate() can fail
Hans-Joachim Widmaier (hjwidmai@foxboro.com)
Wed, 3 Dec 1997 09:20:11 +0100
While testing the new affs code, I stumbled upon a
deficiency in the VFS: truncate() is not allowed to
fail. This might be a fair assumption for ext2 (but
even that needs inderection blocks), but certainly
is wrong with affs: If truncate is used to enlarge
a file, it can well happen that the disk gets full.
inode->i_size will happily reflect the new and
wrong size.
If I'm not totally wrong here, I'd like to change
the VFS and filesystems so that truncate() can
return an error, too.
What's your opinion?
--
Hans-Joachim Widmaier