Re: [PATCH 08/31] libext2fs: Fix off-by-one error in file truncation

Theodore Ts'o
2013-10-08T15:52:39Z

On Mon, Sep 30, 2013 at 06:27:34PM -0700, Darrick J. Wong wrote:
> When told to truncate a file, ext2fs_file_set_size2 should start with the first
> block past the end of the file. The current calculation jumps one more block
> ahead, with the result that it fails to hack off the last block. Adding
> blocksize-1 and dividing is sufficient to find the last block.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Applied, thanks.

- Ted