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

osc: lock cancel discards pages still covered by another lock

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      When a lock is cancelled, pages still covered by another lock on the client should stay cached. Since LU-11290 ("ldlm: page discard speedup"), the lookup for this uses LDLM_MATCH_RIGHT, which returns the nearest lock at or after a page, and a lock starting past the page is taken to mean nothing covers it. search_itree() returns the first match in lock mode order (PW before PR), not the lowest start, so a PW lock further along the object hides a PR lock covering the page. That page, and every page up to the PW lock's start, is discarded.

      Today this costs only cache, since the discard holds invalidate_lock. Discarding without it (LU-20157) relies on these pages being kept, and there the result is the LU-16651 -EIO or short read.

      LDLM_MATCH_RIGHT is also the only match flag that can return a lock not covering the requested extent. Negative-result caching needs an offset, not a lock.

      Reproducer, one client, one object: take PR [0, 1M), PR [512K, 2M) and PW [4M, 5M), then revoke the first; [512K, 1M) is dropped from cache.

            wc-triage WC Triage
            paf0186 Patrick Farrell
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: