Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-58253

mkfs.xfs aborts with "Metadata corruption detected" for certain agcount/agsize values

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Normal Normal
    • rhel-9.2.0.z
    • rhel-9.2.0.z
    • xfsprogs
    • None
    • xfsprogs-5.14.2-2.el9_2
    • No
    • Moderate
    • rhel-sst-filesystems
    • ssg_filesystems_storage_and_HA
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      Creating a filesystem with certain parameters, the parameters are taken from an existing filesystem, the goal is to reproduce the settings of the original filesystem. The original filesystem was originally created very small and then grown.

      What is the impact of this issue to you?

      It causes RHEL-56018. Customer is requesting RCA and Errata.

      Please provide the package NVR for which the bug is seen:

      xfsprogs-5.14.2-1.el9

      How reproducible is this bug?:

      well reproducible under specific conditions.

      Steps to reproduce

      Assuming an unused disk /dev/vdb available for tests:

      1. dnf -y install lvm2
      2. pvcreate -f /dev/vdb
      3. vgcreate vg /dev/vdb
      4. lvcreate --type thin-pool -l 95%FREE -n lvol1 vg
      5. lvcreate --type thin -V 90248839168b --thinpool lvol1 vg -n lv_log
      6. mkfs.xfs -f -i size=512 -d agcount=2869 -s size=512 -i attr=2 -i projid32bit=1 -m crc=1 -m finobt=1 -b size=4096 -i maxpct=25 -d sunit=128 -d swidth=128 -l version=2 -l sunit=128 -l lazy-count=1 -n size=4096 -n version=2 -r extsize=4096 /dev/mapper/vg-lv_log
      7. mkfs.xfs -f -i size=512 -d agsize=7680b -s size=512 -i attr=2 -i projid32bit=1 -m crc=1 -m finobt=1 -b size=4096 -i maxpct=25 -d sunit=128 -d swidth=128 -l version=2 -l sunit=128 -l lazy-count=1 -n size=4096 -n version=2 -r extsize=4096 /dev/mapper/vg-lv_log

      Expected results

      Filesystem is created.

      Actual results

      First mkfs:

      meta-data=/dev/mapper/vg-lv_log  isize=512    agcount=2869, agsize=7680 blks
               =                       sectsz=512   attr=2, projid32bit=1
               =                       crc=1        finobt=1, sparse=1, rmapbt=0
               =                       reflink=1    bigtime=1 inobtcount=1
      data     =                       bsize=4096   blocks=22033408, imaxpct=25
               =                       sunit=16     swidth=16 blks
      naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
      log      =internal log           bsize=4096   blocks=7680, version=2
               =                       sectsz=512   sunit=16 blks, lazy-count=1
      realtime =none                   extsz=4096   blocks=0, rtextents=0
      Discarding blocks...Done.
      Metadata corruption detected at 0x563679976175, xfs_agf block 0x5406001/0x200
      libxfs_bwrite: write verifier failed on xfs_agf bno 0x5406001/0x1
      mkfs.xfs: writing AG headers failed, err=117
      

      Second mkfs:

      meta-data=/dev/mapper/vg-lv_log  isize=512    agcount=2869, agsize=7680 blks
               =                       sectsz=512   attr=2, projid32bit=1
               =                       crc=1        finobt=1, sparse=1, rmapbt=0
               =                       reflink=1    bigtime=1 inobtcount=1
      data     =                       bsize=4096   blocks=22033408, imaxpct=25
               =                       sunit=16     swidth=16 blks
      naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
      log      =internal log           bsize=4096   blocks=7680, version=2
               =                       sectsz=512   sunit=16 blks, lazy-count=1
      realtime =none                   extsz=4096   blocks=0, rtextents=0
      Discarding blocks...Done.
      Metadata corruption detected at 0x55616092b175, xfs_agf block 0x5406001/0x200
      libxfs_bwrite: write verifier failed on xfs_agf bno 0x5406001/0x1
      mkfs.xfs: writing AG headers failed, err=117
      

      If the size of the lv_log LV is varied a bit, one can get the error reported in https://bugzilla.redhat.com/show_bug.cgi?id=2211095 / RHEL-7960 instead.

      With the LV size of -V 86128 one gets a variation of the error:

      meta-data=/dev/mapper/vg-lv_log  isize=512    agcount=2869, agsize=7696 blks
               =                       sectsz=512   attr=2, projid32bit=1
               =                       crc=1        finobt=1, sparse=1, rmapbt=0
               =                       reflink=1    bigtime=1 inobtcount=1
      data     =                       bsize=4096   blocks=22048768, imaxpct=25
               =                       sunit=16     swidth=16 blks
      naming   =version 2              bsize=4096   ascii-ci=0, ftype=1
      log      =internal log           bsize=4096   blocks=7696, version=2
               =                       sectsz=512   sunit=16 blks, lazy-count=1
      realtime =none                   extsz=4096   blocks=0, rtextents=0
      Discarding blocks...Done.
      SB sanity check failed
      Metadata corruption detected at 0x558725a1f02a, xfs_sb block 0x0/0x200
      libxfs_bwrite: write verifier failed on xfs_sb bno 0x0/0x1
      mkfs.xfs: Releasing dirty buffer to free list!
      found dirty buffer (bulk) on free list!
      SB sanity check failed
      Metadata corruption detected at 0x558725a1f02a, xfs_sb block 0x0/0x200
      libxfs_bwrite: write verifier failed on xfs_sb bno 0x0/0x1
      mkfs.xfs: writing AG headers failed, err=117
      

              bodonnel Bill O'Donnell
              rhn-support-pcahyna Pavel Cahyna
              Bill O'Donnell Bill O'Donnell
              Zirong Lang Zirong Lang
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: