Uploaded image for project: 'Facter'
  1. Facter
  2. FACT-1406

mountpoints size and used values can be corrupt on 32-bit linux or bsd

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: FACT 3.1.6
    • Fix Version/s: FACT 3.4.0
    • Component/s: None
    • Environment:
    • Template:
    • Story Points:
      1
    • Sprint:
      Client 2016-07-13 (HA, 1.5.3)
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      On 32-bit linux or bsd, several individual fields within the mountpoints fact could be corrupt. This fixes that problem.

      Description

      Hello,

      facter reports

      • negative filesystem usage (used_bytes => -39751680)
      • usage of Exabytes on a 1TB filesystem (used => "16.00 EiB",)

      $ used_bytes => -39751680
      mountpoints => {
      ...
        /var/spool/k => {
          available => "226.66 MiB",
          available_bytes => 237670400,
          capacity => "100%",
          device => "/dev/mapper/VGspool-lv_spool",
          filesystem => "ext4",
          options => [
            "rw",
            "relatime",
            "data=ordered"
          ],
          size => "188.75 MiB",
          size_bytes => 197918720,
          used => "16.00 EiB",
          used_bytes => -39751680
        }
      }
      

      but df reports:

      Filesystem                          Size  Used Avail Use% Mounted on
      /dev/mapper/VGspool-lv_spool        985G  8.0G  927G   1% /var/spool/k
      

      Filesystem                          1K-blocks    Used Available Use% Mounted on
      /dev/mapper/VGspool-lv_spool       1031992064 8351860 971195020   1% /var/spool/k
      

      BTW: up the way through puppetmaster, puppetdb (with Postgres DB backend),
      and pdb query more data become negativ:

      $ curl -X GET  http://localhost:8080/pdb/query/v4/nodes/k.test/facts | jq '.'
        {
          "certname": "k.test",
          "environment": "production",
          "name": "partitions",
          "value": {
            "/dev/mapper/k--vg-lv_root": {
              "filesystem": "ext4",
              "size": "2.79 GiB",
              "size_bytes": -1296039936,
              "uuid": "e9c05fdc-19a8-421f-a24f-cb9ebf252e0b"
            },
            "/dev/mapper/k--vg-swap_1": {
              "filesystem": "swap",
              "size": "3.72 GiB",
              "size_bytes": -297795584,
              "uuid": "34d3d5c7-9d18-4c0e-a101-525f287d6716"
            }
          }
        },
        {
          "certname": "k.test",
          "environment": "production",
          "name": "mountpoints",
          "value": {
            "/": {
              "filesystem": "ext4",
              "device": "/dev/dm-0",
              "used_bytes": 619831296,
              "available_bytes": -2030133248,
              "used": "591.12 MiB",
              "size": "2.69 GiB",
              "options": [
                "rw",
                "relatime",
                "errors=remount-ro",
                "data=ordered"
              ],
              "size_bytes": -1410301952,
              "available": "2.11 GiB",
              "capacity": "21.49%"
            },
            "/var/spool/k": {
              "filesystem": "ext4",
              "device": "/dev/mapper/VGspool-lv_spool",
              "used_bytes": -76840960,
              "available_bytes": 274759680,
              "used": "16.00 EiB",
              "size": "188.75 MiB",
              "options": [
                "rw",
                "relatime",
                "data=ordered"
              ],
              "size_bytes": 197918720,
              "available": "262.03 MiB",
              "capacity": "100%"
            }
          }
        },
        {
          "certname": "k.test",
          "environment": "production",
          "name": "memory",
          "value": {
            "swap": {
              "available": "3.57 GiB",
              "available_bytes": -465199104,
              "capacity": "4.19%",
              "total": "3.72 GiB",
              "total_bytes": -297799680,
              "used": "159.64 MiB",
              "used_bytes": 167399424
            },
            "system": {
              "available": "2.86 GiB",
              "available_bytes": -1219309568,
              "capacity": "27.53%",
              "total": "3.95 GiB",
              "total_bytes": -50905088,
              "used": "1.09 GiB",
              "used_bytes": 1168404480
            }
          }
        },
      
      

      Thank you

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                andreas.papst@univie.ac.at Andreas Papst
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: