Skip to content

df: env var with a zero block size should be ignored #8918

@cakebaker

Description

@cakebaker

If one of the block size environment variables (DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE) is zero, our numerical output consists of inf and NaN:

$ DF_BLOCK_SIZE=0 cargo run -q df --output=size,used
0B-blocks  Used
      inf   NaN
      inf   inf
      inf   inf
      inf   inf
      inf   inf
      inf   inf
      inf   NaN
      inf   inf
      inf   inf

GNU df, on the other hand, uses the default block size in such a case:

$ DF_BLOCK_SIZE=0 df --output=size,used
1K-blocks      Used
  3941200         0
  4007640      1544
       88        53
458020024 190675612
  4007640    562952
  4007640     28380
     1024         0
   262144    262144
   801528       228

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions