[LU-3484] Incorrect identification of anonymous dentry as root under SLES11SP2 Created: 20/Jun/13 Updated: 27/Mar/14 Resolved: 16/Jul/13 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.4.0 |
| Fix Version/s: | Lustre 2.5.0 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Patrick Farrell (Inactive) | Assignee: | Bob Glossman (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | mn4, patch | ||
| Severity: | 3 |
| Rank (Obsolete): | 8761 |
| Description |
|
When attempting to export Lustre 2.4 via NFS with SLES11SP2, we ran in to an issue (See Here's the code in question (from ll_invalidate_aliases in lustre/llite/dcache.c): if (dentry->d_name.len == 1 && dentry->d_name.name[0] == '/') { CERROR("called on root (?) dentry=%p, inode=%p " "ino=%lu\n", dentry, inode, inode->i_ino); lustre_dump_dentry(dentry, 1); libcfs_debug_dumpstack(NULL); } The problem is a change in d_obtain_alias that's been made in SLES11SP2. Here's where anonymous dentries are named, this is from d_obtain_alias in CentOS6.4 or SLES11SP1: static const struct qstr anonstring = { .name = "" }; : : tmp = d_alloc(NULL, &anonstring); In SLES11SP2, it's this: static const struct qstr anonstring = { .name = "/", .len = 1 }; tmp = d_alloc(NULL, &anonstring); As you can see, that looks like a root dentry to the check being done by Lustre. There's a comment just above saying this was the intention: * This alias can sometimes be seen by prepend_path, so make it look * the same as a d_alloc_root alias. */ [The commit is recorded here: http://kernel.opensuse.org/cgit/kernel-source/commit/?id=f9a956fc1dc4b5271662736b5016324d43b1b99f Ideally, Lustre would find another way to identify the root dentry here. I have simply commented out this check while doing further testing, but I'd like to understand: #define IS_ROOT(x) ((x) == (x)->d_parent) If so, I'd suggest that. |
| Comments |
| Comment by Patrick Farrell (Inactive) [ 20/Jun/13 ] |
|
Looks like there's a problem with that idea - Anonymous dentries are their own parents, just like root dentries. From d_obtain_alias again: If no other alias is found, tmp is returned with the parent set as above. Suggestions? |
| Comment by Andreas Dilger [ 20/Jun/13 ] |
|
I think in modern kernels there is a flag in the dentry DCACHE_DISCONNECTED, that can be used instead of checking the name. |
| Comment by Patrick Farrell (Inactive) [ 20/Jun/13 ] |
|
Andreas, There is such a flag, here's what the header file has to say in SLES11SP2:
However, it's set on anonymous dentries (from d_obtain_alias): return tmp; According to what I'm reading here, it can be unset later, but I don't know when that would be: I'll do a bit more reading. |
| Comment by Patrick Farrell (Inactive) [ 20/Jun/13 ] |
|
Couldn't we compare the value of the dentry pointer to the value of the root dentry as given in the super block? IE: Is there a reason that might be unsafe or incorrect in some cases? |
| Comment by Andreas Dilger [ 20/Jun/13 ] |
|
It looks like comparing against d_sb->s_root should be correct. |
| Comment by Patrick Farrell (Inactive) [ 20/Jun/13 ] |
|
Patch is up: |
| Comment by Peter Jones [ 25/Jun/13 ] |
|
Thanks Patrick! Bob Could you please take care of this patch? Thanks Peter |
| Comment by Patrick Farrell (Inactive) [ 26/Jun/13 ] |
|
Quick note on this: |
| Comment by Bob Glossman (Inactive) [ 16/Jul/13 ] |
|
fix landed before 2.4.52 tag. closing. |