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

Encrypted buffered write fails with -EINVAL when another thread unlocks the folio during encryption

XMLWordPrintable

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

      With client encryption, a buffered write to an encrypted file can fail on the client due to a failed lock check in osc_encrypt_pagecache_blocks(). osc_brw_prep_request() then returns -EINVAL, and the whole write RPC fails. A file small enough to be written by a single RPC ends up empty (0 bytes), and rewriting it usually succeeds.

      osc_brw_prep_request() checks for a lock on the folio (and takes it if not already locked). But other threads can take the folio lock for a short time while the folio is under writeback, and release it before the check in osc_encrypt_pagecache_blocks(), e.g. a page fault through mmap, memory management related tasks such as reclaim, migration and compaction in async mode, invalidate_mapping_pages()/mapping_evict_folio() (e.g. drop_caches), and the readahead/filemap_read helpers.

            sebastien Sebastien Buisson
            sebastien Sebastien Buisson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: