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

behavior of cp changed while copying sparse files on XFS

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Normal Normal
    • None
    • rhel-9.5
    • coreutils
    • None
    • Yes
    • Moderate
    • rhel-base-utils-core
    • ssg_core_services
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • x86_64
    • None

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

      The following reproducer has been raised by our customer, it is inspired from the failed test while trying to rebuild the latest coreutils package on RHEL 9 on top of an XFS filesystem (tests/cp/fiemap-2.sh).

      When using the `cp --sparse=always` option to copy a data file filled with zeros, on RHEL8, the zero data is treated as sparse and does not consume disk space. However, on RHEL9, the zero data is not treated as sparse and is copied as is. This issue occurs only on XFS in RHEL9, while on EXT4, the result is the same as RHEL8.

      What is the impact of this issue to you?

      Impacting the copy of VM images, reported as a significant impact on customers.

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

      coreutils-8.32-36.el9.x86_64

      How reproducible is this bug?:

      Always

      Steps to reproduce

      #!/bin/sh
      printf x > k
      dd bs=1k seek=1 of=k count=255 < /dev/zero
      cp --sparse=always k k2
      dd if=k of=k2.dd bs=4096 conv=sparse
      stat -c %b k k2 k2.dd 

      Expected results

      512
      8
      8
      

      Actual results

      512
      512
      8
      

      Additional notes

      We can also confirm that rebuilding the 8.30 version from RHEL 8.10 does not show the problem on RHEL 9, the test PASSES, and while executing the above script, the holes are preserved. We do note significant changes in sparse_copy() from coreutils-8.32/src/copy.c.

              rh-ee-lzaoral Lukáš Zaoral
              rhn-support-cbesson Christophe Besson
              Lukáš Zaoral Lukáš Zaoral
              Radka Brychtova Radka Brychtova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: