fsx: allow zero range operations to cross eof
authorFilipe Manana <fdmanana@suse.com>
Mon, 20 Apr 2020 17:07:38 +0000 (18:07 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 May 2020 12:27:18 +0000 (20:27 +0800)
commit15898a13d6d290740329455e6248722f5c5c6288
treef5770ca6c1cace7c8d45490b55ab30020c46803f
parentd9f75cdc8ffc0cc9b82d061bc21981c34a31de68
fsx: allow zero range operations to cross eof

Currently we are limiting the range for zero range operations to stay
within the i_size boundary. This is not optimal because like this we lose
coverage of the filesystem's zero range implementation, since zero range
operations are allowed to cross the i_size. Fix this by limiting the range
to 'maxfilelen' and not 'file_size', and update the 'file_size' after each
zero range operation if needed.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
ltp/fsx.c