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

OSP: zero lov_objid makes OSP adopt sequence 0

XMLWordPrintable

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

      An OSP that reads a zero "last used object id" with a valid normal sequence silently switches to sequence 0. Objects it allocates from that space collide with the ones MDT0000 allocates, and once its start id falls behind the OST's sequence 0 counter its precreates are rejected with -EINVAL.

      Sequence 0 is the object id space MDT0000 allocates from. Once another MDT's OSP also sits on sequence 0, both take ids from the same per-OST sequence 0 counter, and each OSP hands out ids from its own precreated pool, so once the two pools are out of step the same id is given to two different files. The OST object is then referenced by two files, and it is left dangling for one MDT after the other MDT deletes its file.

      The reason is that fid_is_sane() does not check the object id, so {normal seq, oid 0} passes the check and osp_init_pre_fid() also accepts it; then osp_precreate_cleanup_orphans() sends KEY_LAST_FID. Since the object id and the sequence share one field in struct ost_id, ostid_seq() reads {seq, 0} as sequence 0, so the OST returns sequence 0's last id and the OSP adopts it.

            hongchao.zhang Hongchao Zhang
            hongchao.zhang Hongchao Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: