[LU-1553] inaccessible files in .lustre Created: 21/Jun/12 Updated: 18/Apr/13 Resolved: 18/Apr/13 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.3.0 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | John Hammond | Assignee: | WC Triage |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | fid | ||
| Environment: |
|
||
| Issue Links: |
|
||||||||
| Severity: | 3 | ||||||||
| Rank (Obsolete): | 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 [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 |
| Comments |
| Comment by Andreas Dilger [ 21/Jun/12 ] |
|
Users shouldn't be allowed to create files in the .lustre directory. This is intended for files with "special meanings" (snapshots, etc). |
| Comment by Andreas Dilger [ 05/Jul/12 ] |
|
These bugs are symptoms that internal files should not be accessible through .lustre. |
| Comment by Richard Henwood (Inactive) [ 12/Nov/12 ] |
|
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 |