Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-6214

HSM released files archive with 'tar --xattr -c' cannot be extracted to lustre

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.8.0
    • Lustre 2.7.0
    • 3
    • 17384

    Description

      # echo XXX > f0
      # lfs hsm_archive f0
      # lfs hsm_state f0
      f0: (0x00000009) exists archived, archive_id:1
      # lfs hsm_release f0
      # lfs hsm_state f0
      f0: (0x0000000d) released exists archived, archive_id:1
      # tar --xattr -cf /tmp/f0.tar f0
      tar: f0: file changed as we read it
      # rm f0
      # tar --xattr -xf /tmp/f0.tar f0
      tar: f0: Cannot write: No data available
      tar: Exiting with failure status due to previous errors
      # echo $?
      2
      # ls
      f0
      # cat f0
      cat: f0: No data available
      

      It does not matter if --xattr is used during extraction.

      # rm f0
      # tar -xf /tmp/f0.tar f0
      tar: f0: Cannot write: No data available
      tar: Exiting with failure status due to previous errors
      # ls
      f0
      # cat f0
      cat: f0: No data available
      

      Extraction is creating the file and giving it a trusted.lov xattr which has a released pattern. From strace:

      mknod("f0", 0600)                       = 0
      setxattr("f0", "trusted.hsm", "\x00\x00\x00\x00\x0d\x00\x00\x00\x01\x00\x00\x00\x00\x00\x0
      0\x00\x15\x00\x00\x00\x01\x00\x00\x00", 24, 0) = 0
      setxattr("f0", "trusted.link", "\xdf\xf1\xea\x11\x01\x00\x00\x00,\x00\x00\x00\x00\x00\x00\
      x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x02\x00\x00\x00\x07\x00\x00\x00\x0
      1\x00\x00\x00\x00f0", 44, 0) = 0
      setxattr("f0", "trusted.lov", "\xd0\x0b\xd1\x0b\x01\x00\x00\x80\x0f\x00\x00\x00\x00\x00\x0
      0\x00\x00\x04\x00\x00\x02\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", 32, 0) = 0
      setxattr("f0", "trusted.lma", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x02\x00\x0
      0\x00\x0f\x00\x00\x00\x00\x00\x00\x00", 24, 0) = 0
      open("f0", O_WRONLY|O_CREAT, 0600)      = 4
      write(4, "XXX\n", 4)                    = -1 ENODATA (No data available)
      
      # lfs getstripe f0
      f0
      lmm_stripe_count:   1
      lmm_stripe_size:    1048576
      lmm_pattern:        80000001
      lmm_layout_gen:     0
      lmm_stripe_offset:  0
      # getfattr -d -m- f0
      # file: f0
      trusted.link=0s3/HqEQEAAAAsAAAAAAAAAAAAAAAAAAAAABQAAAACAAAABwAAAAEAAAAAZjA=
      trusted.lma=0sAAAAAAAAAAAABAAAAgAAABcAAAAAAAAA
      trusted.lov=0s0AvRCwEAAIAXAAAAAAAAAAAEAAACAAAAAAAQAAAAAAA=
      

      The same archive works fine when extracting to an ext4 filesystem.

      # cd /tmp
      # tar -xf /tmp/f0.tar f0
      # cat f0
      XXX
      

      Attachments

        Activity

          People

            bfaccini Bruno Faccini (Inactive)
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: