Skip to content

Commit

Permalink
mkfs: relax size check
Browse files Browse the repository at this point in the history
Number of total data blocks in filesystem reported by statfs
may be less than current formula of 90%. For example ext4 will
subtract "s_first_data_block plus internal journal blocks".

With recent change to e2fsprogs, overhead calculated in user-space
increased slightly and LTP test started failing:
  tytso/e2fsprogs@59037c5

Since there's no strict rule how much the overhead will be,
as rule of thumb relax the condition to 80%.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Li Wang <liwang@redhat.com>
  • Loading branch information
jstancek authored and pevik committed Apr 26, 2021
1 parent 9ccb24e commit d443874
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testcases/commands/mkfs/mkfs01.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ mkfs_verify_size()
# 1k-block size should be devided by this argument for ntfs verification.
if [ "$1" = "ntfs" ]; then
local rate=1024/512
if [ $blocknum -lt "$(($2/$rate*9/10))" ]; then
if [ $blocknum -lt "$(($2/$rate*8/10))" ]; then
return 1
fi
else
if [ $blocknum -lt "$(($2*9/10))" ]; then
if [ $blocknum -lt "$(($2*8/10))" ]; then
return 1
fi
fi
Expand Down

0 comments on commit d443874

Please sign in to comment.