• Icon: Technical task Technical task
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      Summary

      Open OBJECT-scope direct pwrite for the prefix hole only, so the next component's object can be filled in place.

      Description

      A PFL object's prefix hole [0, obj(e_start)) does not contribute to the parent i_size, and that component's file-offset path cannot reach it. LU-13612 needs those bytes: copy the DoM / previous component into the next object's prefix hole and leave that object in place. Whole-file DoM→OST migration (LU-10177 / LU-11421) already covers the product goal, at the cost of rewriting the file. P2 opened OBJECT for pread and lseek only; pwrite is still -EOPNOTSUPP.

      Extend that same entry path — one sub-I/O, identity mapping, ios_fid as the only identity — to direct pwrite, including the object's data-version update and fsync. File-offset helpers stay unchanged. In LOV, the OBJECT iterator range-checks the write and still does not walk components. In VVP, the write start must not apply an object offset to the parent inode size.

      Object-offset write ranges:

      • [0, obj(e_start)): accepted. This is the prefix hole.
      • [obj(e_start), obj(e_end)): rejected. The visible range stays file offset + STRIPE (P1b).
      • [obj(e_end), ∞): -EINVAL. Nothing consumes this range.

      Prefix bytes map below e_start, so the existing composite size merge does not raise i_size. The OBJECT write path must not update it either.  stat stays unchanged; the object size and quota do change.

      This is not a designated resync:

      • Do not set LU_LAYOUT_RESYNC.
      • Non-FLR does not send OBD_MD_LAYOUT_VERSION to the OST, so filter_fid.ff_layout_version stays 0.
      • FLR does not set the RESYNC bit.

      A mutating op requires a non-zero ios_layout_version. A mismatch with lsm_layout_gen returns -ESTALE. The UAPI header documents the caller contract: LL_LEASE_WRLCK, a non-zero FID, and a non-zero layout version.

      Acceptance

      • Prefix-hole write: stat / i_size unchanged; object size and quota change.
      • Visible-range write, and a write past obj(e_end), return -EINVAL.
      • Layout change returns -ESTALE.
      • Non-FLR: OST filter_fid.ff_layout_version stays 0. FLR: no RESYNC bit.

            wc-triage WC Triage
            kxu Keguang Xu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: