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

osc_extent_find sometimes walks full extent list

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.12.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      osc_extent_find has an interesting little bug.

      osc_extent_find uses osc_extent_search to find a good candidate for merging the new page in to, then starts checking.  osc_extent_search either the extent containing the offset request or the greatest previous extent, or null if no such extent exists.

      If search returns null, then find uses the first extent of the object.

      Basically, there are three possibilities, assuming there are some extents in the object:

      1. The new offset lies inside and existing extent, ie, overlaps it.  Search returns this extent and find handles this case.
      2. There are no earlier extents in the object.  If there are any extents, try to merge with the first extent (which must be the next extent).  If we cannot merge with this extent, then we will not be able to merge with any further extents.  (Because they are guaranteed to be discontiguous.)
      3. There is an earlier extent.  Try to merge with it.  If that fails, try to merge with the next extent in the file.  If we cannot merge with it, then we can't merge with any further extents (because they are guaranteed to be discontiguous).

      In cases 2 and 3, the current code will continue to walk the extent list until next_extent is NULL.  This is fine for small numbers of extents, but is hugely problematic for large, sparse files with small written extents, where we can get thousands and thousands of extents and most new writes will not merge with existing extents.

      This is trivial to fix - just stop walking the extent list once we've passed any extents we could match.  Patch will be forthcoming shortly.

      Attachments

        Activity

          People

            paf Patrick Farrell
            paf Patrick Farrell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: