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

fiemap FIEMAP_FLAG_SYNC flag expects filemap_write_and_wait() or similar

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • Lustre 2.16.0
    • None
    • None
    • 3
    • 9223372036854775807

      fiemap FIEMAP_FLAG_SYNC can race while client is writing data to disk

      In such a case fiemap() call returns that the data is not on disk (no data for the range) and cp can just truncates (or sparse fill) based on the size of the file/extent.

      strace shows that FIEMAP_FLAG_SYNC was sent. Further and the user reports that a 'sync; cp <blah>' does not fail and a newer cp that uses copy_file_range() also does not fail.

      Looking further FIEMAP_FLAG_SYNC expects the data to be on disk aka filemap_write_and_wait() not just filemap_fdatawrite()

        1. SHOT02_09010.exr.trace.bad
          13 kB
          Lukasz Flis
        2. SHOT02_09010.exr.trace.good
          13 kB
          Lukasz Flis

            stancheff Shaun Tancheff
            stancheff Shaun Tancheff
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: