mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
generic/386: check the correct field from df output
The generic/386 test was checking the "Available" field when it
should have been checking the "1k-blocks" field, which represents
the project quota's hard limit. On xfs, an empty directory takes no
space, so it doesn't matter. But for ext4, an empty directory still
takes 4k (or whatever the file system's block size happens to be):
Filesystem 1K-blocks Used Available Use% Pathname
/dev/vdc 512000 4 511996 0% /vdc/test
This causes generic/386 to falsely fail.
This fix is needed to fix generic/386 from failing on ext4:
hard limit 524283904 bytes, expected 524288000
[Eryu: Used $(NF-4) instead of $2 as Eric Sandeen and Yang Xu
suggested]
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
+3
-3
@@ -58,12 +58,12 @@ _require_scratch
|
||||
# Make sure the hard limits reported are what was set.
|
||||
# It is entirely too clever...
|
||||
# It exploits the fact that we've set the soft and hard limits to
|
||||
# the same value, and as a result the value in the fourth field in
|
||||
# the same value, and as a result the value in the second field in
|
||||
# both the "df" and the "report" output. For "report", the line we're
|
||||
# interested in contains our project name in the first field. For "df"
|
||||
# it contains our project directory in the last field.
|
||||
# But if the device name is too long, the "df" output is broke into two
|
||||
# lines, the fourth field is not correct, so take $(NF-2) of "df"
|
||||
# lines, the second field is not correct, so take $(NF-4) of "df"
|
||||
_filter_quota_rpt() {
|
||||
awk '
|
||||
BEGIN {
|
||||
@@ -89,7 +89,7 @@ _filter_quota_rpt() {
|
||||
bsize = byte_size($4);
|
||||
} else if ($NF ~ proj_dir) {
|
||||
# this is the "df" output
|
||||
bsize = byte_size($(NF-2));
|
||||
bsize = byte_size($NF-4));
|
||||
} else {
|
||||
next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user