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

cp with FIEMAP support creates completely sparse file

Details

    • Bug
    • Resolution: Fixed
    • Blocker
    • None
    • Lustre 2.3.0, Lustre 2.4.0
    • SLES 11 SP2 (client), Lustre 2.1.2 RHEL6 (server)
    • 2
    • 6020

    Description

      We are seeing an issue at KIT where cp will occasionally use the FIEMAP extension to create a completely sparse file instead of actually copying the file. It seems to occur under a workload involving creating and deleting many files at once. It only involves a single client though, it's not a parallel workload.

      Relevant strace from 'bad' cp:
      ioctl(3, 0xc020660b, 0x7fff392c0950) = 0
      ftruncate(4, 12853) = 0

      strace from 'good' cp:
      read(3, "#!/bin/bash -u\n\n#localisation\nex"..., 2097152) = 12853
      write(4, "#!/bin/bash -u\n\n#localisation\nex"..., 12853) = 12853
      read(3, "", 2097152) = 0

      The strace didn't print the stat block information, but I'm assuming the st_blocks == 0 in the bad one. I will ask the customer to get a full strace -v to confirm, but it appears to be something similar to LU-417?

      Attachments

        Issue Links

          Activity

            [LU-2580] cp with FIEMAP support creates completely sparse file
            spitzcor Cory Spitz added a comment -

            This bug is still applicable to 2.1 when using cp built from coreutils 8.12, right? [I can't confirm that, but I think we're seeing this on 2.2] If so and since b2_1 is still the current maintenance branch, do we want to land a fix there?

            spitzcor Cory Spitz added a comment - This bug is still applicable to 2.1 when using cp built from coreutils 8.12, right? [I can't confirm that, but I think we're seeing this on 2.2] If so and since b2_1 is still the current maintenance branch, do we want to land a fix there?
            pjones Peter Jones added a comment -

            ok thanks for the update. That explains why we have been unable to reproduce this issue on the latest 2.4 code. I will close out this ticket.

            pjones Peter Jones added a comment - ok thanks for the update. That explains why we have been unable to reproduce this issue on the latest 2.4 code. I will close out this ticket.

            Update from KIT: With Lustre 2.3.0 on the client and patches 4477 and 4659 from LU-2367 and LU-2286, the issue cannot be reproduced.

            LU-2367 fixes a race in unplugging the IO queue which can affect flush and fsync - and "cp" always calls FIEMAP with the SYNC flag set causing the cached extents to be flushed. LU-2286 fixes a bug where an extent does not get flushed to disk until the next write to the file occurs. So it does seem logical that the issue is not being reproduced with these 2 patches applied.

            kalpak Kalpak Shah (Inactive) added a comment - Update from KIT: With Lustre 2.3.0 on the client and patches 4477 and 4659 from LU-2367 and LU-2286 , the issue cannot be reproduced. LU-2367 fixes a race in unplugging the IO queue which can affect flush and fsync - and "cp" always calls FIEMAP with the SYNC flag set causing the cached extents to be flushed. LU-2286 fixes a bug where an extent does not get flushed to disk until the next write to the file occurs. So it does seem logical that the issue is not being reproduced with these 2 patches applied.
            pjones Peter Jones added a comment -

            Thanks Kalpak. With any patches applied?

            pjones Peter Jones added a comment - Thanks Kalpak. With any patches applied?

            Peter, the clients are running Lustre 2.3 on SLES11 SP2.

            kalpak Kalpak Shah (Inactive) added a comment - Peter, the clients are running Lustre 2.3 on SLES11 SP2.
            pjones Peter Jones added a comment -

            Could you please clarify as to what versions of Lustre (and any patches running) that are being used here? You mention that it is Lustre 2.1.2 servers but what version of Lustre is being used on the client?

            pjones Peter Jones added a comment - Could you please clarify as to what versions of Lustre (and any patches running) that are being used here? You mention that it is Lustre 2.1.2 servers but what version of Lustre is being used on the client?

            People

              pjones Peter Jones
              kitwestneat Kit Westneat (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: