Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-18456 TCU: Trash Can/Undelete for Lustre
  3. LU-21137

TCU: rm fails with ENAMETOOLONG for names >~225 bytes deleted repeatedly (timestamp suffix)

XMLWordPrintable

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

      Problem

      mdd_trash_repeated_name_append() (mdd_trash.c:623-667) appends .YYYY-MM-DDTHH:MM:SS[.nnnnnnnnn] (20–30 bytes) to the full name. When the result exceeds mtp_tsname/NAME_MAX it returns -ENAMETOOLONG, and that error fails the user's unlink or rename.

      As a result, a user cannot delete a long-named file once a version of it is already in the trash.

       

      mdd_finish_unlink(): Failed to insert object [0x20000afe1:0x22:0x0] into trash ... rc = -36
      LustreError: osd_handler.c:2531:osd_object_release() ASSERTION( !(o->oo_destroyed == 0 && o->oo_inode && o->oo_inode->i_nlink == 0) ) failed
      LBUG -> kernel panic (panic_on_oops=1), vm00 rebooted 

      Analysis: by the time the trash insert fails with -ENAMETOOLONG (the name plus the timestamp suffix is longer than NAME_MAX), the unlink transaction has already dropped the object to nlink 0. No destroy is declared on the error path, so the next osd_object_release() hits the assertion. Any unprivileged user who can create a file with a long name can crash the MDS, so this is a DoS.

      Suggested fix

      Truncate the base name so the suffix fits, or fall back to the oldest behavior for that object. The unlink must never fail because of the trash name.

            qian_wc Qian Yingjin
            qian_wc Qian Yingjin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: