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

"lfs setstripe -E" doesn't validate component end

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.15.0
    • Lustre 2.10.8, Lustre 2.14.0, Lustre 2.12.5
    • None
    • 3
    • 9223372036854775807

    Description

      The "lfs setstripe -E" option does not validate the component_end value, allowing files with invalid layouts to be created. For example:

      $ lfs setstripe -E 128 -c 1 /mnt/testfs/badfile
      lfs setstripe: cannot create composite file '/mnt/testfs/badfile': Invalid argument
      $ ls -l /mnt/testfs
      ls: cannot access /mnt/testfs/badfile: Invalid argument
      ? -?????????? ? ?            ?             ?     badfile
      

      This also generates errors on the console reporting the invalid stripe count:

      LustreError: 23302:0:(lov_ea.c:115:lsm_lmm_verify_v1v3()) lov: bad stripe size 128: rc = -22
      Lustre: 23303:0:(lov_pack.c:58:lov_dump_lmm_common()) objid 0xc:5025, magic 0x0bd30bd0, pattern 0x1
      Lustre: 23303:0:(lov_pack.c:62:lov_dump_lmm_common()) stripe_size 128, stripe_count 1, layout_gen 0
      LustreError: 23303:0:(lcommon_cl.c:194:cl_file_inode_init()) testfs: failed to initialize cl_object [0x4000013a1:0xc:0x0]: rc = -22
      LustreError: 23303:0:(llite_lib.c:2491:ll_prep_inode()) new_inode -fatal: rc -22
      

      The setstripe command reported an error, but the file was actually created and is inaccessible and unremovable by normal unlink() operations. Using "lfs rmfid" allows the file to be unlinked from the filesystem:

      $ rm /mnt/testfs/badfile
      rm: cannot remove '/mnt/testfs/badfile': Invalid argument
      $ unlink /mnt/testfs/badfile
      unlink: cannot remove '/mnt/testfs/badfile': Invalid argument
      $ lfs rmfid /mnt/testfs $(lfs getstripe -F /mnt/testfs/badfile)
      $
      

      Attachments

        Activity

          People

            yujian Jian Yu
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: