Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Lustre 2.3.0
    • # cat /proc/fs/lustre/version
      lustre: 2.2.57
      kernel: patchless_client
      build: 2.2.57-ge827449-CHANGED-2.6.32-220.23.1.el6.l2.2.55
    • 3
    • 6376

    Description

      root can create files in the .lustre directory which are inaccessible. The definition of mdo_create() is such that the function called belongs to the child not the parent:

      static inline int mdo_create(env, p, lchild_name, c, spc, at)
      {
              LASSERT(c->mo_dir_ops->mdo_create);
              return c->mo_dir_ops->mdo_create(env, p, lchild_name, c, spc, at);
      }
      

      This means that dot_lustre_mdd_object_create() can never be called to prevent creation in .lustre. (Some of the other wrappers, including mdo_unlink(), are also defined way.)

      [root]# sys_stat -x .lustre
      dev              2c54f966
      ino                  61ac
      mode                 41ed
      nlink                   2
      uid                     0
      gid                     0
      rdev                    0
      size                 1000
      blksize              1000
      blocks                  8
      atime            4fe386ed
      mtime            4fe386ed
      ctime            4fe386ed
      [root]# sys_getdents -x .lustre
      d  200000002000001 `.'
      d             61ab `..'
      [root]# sys_creat .lustre/RABBIT
      [root]# sys_getdents -x .lustre
      r  200000400000001 `RABBIT'
      d  200000002000001 `.'
      d             61ab `..'
      

      Since lookup is special for .lustre, these objects cannot be accessed once created.

      [root]# sys_stat -x .lustre/RABBIT
      cannot stat `.lustre/RABBIT': No such file or directory
      [root]# sys_open .lustre/RABBIT r
      cannot open `.lustre/RABBIT' with flags 0, mode 0666: No such file or directory
      

      As with LU-1550, if the .lustre directory is accessed by FID, then it behaves differently.

      [root]# sys_stat -x .lustre/fid/[0x200000002:0x1:0x0]/RABBIT
      dev              2c54f966
      ino       200000400000001
      mode                 81a4
      nlink                   1
      uid                     0
      gid                     0
      rdev                    0
      size                    0
      blksize            200000
      blocks                  0
      atime            4fe38760
      mtime            4fe38760
      ctime            4fe38760
      [root]# sys_open .lustre/fid/[0x200000002:0x1:0x0]/RABBIT r
      [root]# sys_unlink .lustre/fid/[0x200000002:0x1:0x0]/RABBIT
      [root]# sys_getdents -x .lustre/fid/[0x200000002:0x1:0x0]
      d  200000002000001 `.'
      d             61ab `..'
      [root]# sys_getdents -x .lustre
      r  200000400000001 `RABBIT'
      d  200000002000001 `.'
      d             61ab `..'
      

      Note that path2fid on .lustre does not return LU_DOT_LUSTRE_FID, and hence that the md_object created in create_dot_lustre_dir() and the dt_object() accessed in mdd_dot_lustre_setup() are connected only by their backing inode:

      root]# lfs path2fid .lustre
      [0x61ac:0x2e5cf44d:0x0]
      [root]# sys_stat -x .lustre/fid
      dev              2c54f966
      ino       200000002000002
      mode                 41ed
      nlink                   2
      uid                     0
      gid                     0
      rdev                    0
      size                 1000
      blksize              1000
      blocks                  8
      atime            4fe387b3
      mtime            4fe38760
      ctime            4fe38760
      [root]# sys_stat -x .lustre/fid/[0x200000002:0x1:0x0]/fid
      cannot stat `.lustre/fid/[0x200000002:0x1:0x0]/fid': No such file or directory
      

      Attachments

        Issue Links

          Activity

            [LU-1553] inaccessible files in .lustre

            On current master, I could not create complete the sys_creat within .lustre/

            [root@lmaster-124 lustre]# sys_stat -x .lustre
            dev              2c54f966
            ino                  c37a
            mode                 41ed
            nlink                   2
            uid                     0
            gid                     0
            rdev                    0
            size                 1000
            blksize              1000
            blocks                  8
            atime            50a12bab
            mtime            50a12bab
            ctime            50a12bab
            [root@lmaster-124 lustre]# sys_getdents -x .lustre
            d  200000002000001 `.'
            d             c378 `..'
            [root@lmaster-124 lustre]# sys_creat .lustre/RABBIT
            sys_creat: cannot create `.lustre/RABBIT' with mode 0666: Operation not permitted
            [root@lmaster-124 lustre]# sys_getdents -x .lustre
            d  200000002000001 `.'
            d             c378 `..'
            [root@lmaster-124 lustre]#
            

            Assuming this issue has been resolved by the resolution of LU-1518.

            rhenwood Richard Henwood (Inactive) added a comment - On current master, I could not create complete the sys_creat within .lustre/ [root@lmaster-124 lustre]# sys_stat -x .lustre dev 2c54f966 ino c37a mode 41ed nlink 2 uid 0 gid 0 rdev 0 size 1000 blksize 1000 blocks 8 atime 50a12bab mtime 50a12bab ctime 50a12bab [root@lmaster-124 lustre]# sys_getdents -x .lustre d 200000002000001 `.' d c378 `..' [root@lmaster-124 lustre]# sys_creat .lustre/RABBIT sys_creat: cannot create `.lustre/RABBIT' with mode 0666: Operation not permitted [root@lmaster-124 lustre]# sys_getdents -x .lustre d 200000002000001 `.' d c378 `..' [root@lmaster-124 lustre]# Assuming this issue has been resolved by the resolution of LU-1518 .

            These bugs are symptoms that internal files should not be accessible through .lustre.

            adilger Andreas Dilger added a comment - These bugs are symptoms that internal files should not be accessible through .lustre.

            Users shouldn't be allowed to create files in the .lustre directory. This is intended for files with "special meanings" (snapshots, etc).

            adilger Andreas Dilger added a comment - Users shouldn't be allowed to create files in the .lustre directory. This is intended for files with "special meanings" (snapshots, etc).

            People

              wc-triage WC Triage
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: