[LTP] [PATCH] commands/mkfs: Added new testcase to test mkfs(8) command.

Guangwen Feng fenggw-fnst@cn.fujitsu.com
Tue Nov 3 12:55:30 CET 2015


On 2015/11/03 19:39, Cyril Hrubis wrote:
> Hi!
>>>> +	mkfs_umount
>>>> +
>>>> +	if [ $blocknum -gt "$2" ]; then
>>>> +		return 1
>>>> +	fi
>>>
>>> So the size we get as $2 is in kB and df -T reports 1k blocks shouldn't these
>>> be equal, or are there any reserved block in play?
>>>
>>
>> Indeed, "$blocknum" here is equal to struct statfs'f_blocks, which denotes total
>> data blocks in filesystem(df uses statfs(2) to get this info) and does not contain
>> some metadata in filesytem, e.g. ext3's journal space size. 
> 
> Ok, then we should check for lower bound as well. Something as blocknum
> is greater than 90% of size or similar.
> 

OK, I see, thanks!
Please ignore the v2 I just sent, I will email a v3 with lower bound check.

Best Regards,
Guangwen Feng


More information about the Ltp mailing list