[LTP] [PATCH] fallocate05: increase FALLOCATE_SIZE

Martin Doucha mdoucha@suse.cz
Tue Nov 19 10:47:14 CET 2019


On 11/19/19 9:13 AM, Jan Stancek wrote:
> 
> 
> ----- Original Message -----
>> Another patch I was thinking is to enhance the tst_fill_fs routine, which
>> as Eric suggested, makes more reliably to get to a full filesystem.
>> Something like what xfstest does to cut the trial write size in half and
>> try again until the size is less than the filesystem block size.
>>
>> Comments?
> 
> fallocate05 seems to be the only test using it, but in general I think we
> can do that too. Assuming this alone would be reliable, is there any
> advantage of running test with small FALLOCATE_SIZE?

Note that simply increasing FALLOCATE_SIZE will not fix an incorrect
pass when the file system wasn't completely full. Here's the code that
checks whether some blocks were properly fallocate()d:

tst_fill_fs(MNTPOINT, 1);
ret = write(fd, buf, sizeof(buf));
if (ret < 0)
	tst_res(TFAIL | TERRNO, "write() failed unexpectedly");
else
	tst_res(TPASS, "write() wrote %zu bytes", ret);

If the file system somehow finds a few free blocks after tst_fill_fs()
returns, short write() will still count as a pass.

-- 
Martin Doucha   mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic


More information about the ltp mailing list