#1014366 coreutils: df -P still defaults to blocksize=1024

Package:
coreutils
Source:
coreutils
Description:
GNU core utilities
Submitter:
наб
Date:
2022-07-04 23:39:03 UTC
Severity:
normal
#1014366#5
Date:
2022-07-04 23:37:55 UTC
From:
To:
Dear Maintainer,

Without -P, the output format is unspecified
(so the default blocksize of 1024 is fine!),
but POSIX created -P explicitly to reconcile various implementations:
-P has a defined format (which coreutils follows!) and blocksize=512,
and -Pk which is identical except blocksize=1024.

Currently, the only way to get /actual/ POSIX conformance is to specify
both -P /and/ POSIXLY_CORRECT: this is a flagrant violation of the
standard (made all that much worse by the fact that this is the /only/
 portable use of df:
 > Historical df implementations vary considerably in their default output.
 > It was therefore necessary to describe the default output in a loose
 > manner to accommodate all known historical implementations and to add
 > a portable option (-P) to provide information in a portable format.
)

The least intrusive solution would be to continue to default to
blocksize=1024, unless -P, when the default should be blocksize=512.
-k already works as expected.

Best,
наб