Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38401
b: refs/heads/master
c: 21c0d8f
h: refs/heads/master
i:
  38399: b590829
v: v3
  • Loading branch information
NeilBrown authored and Linus Torvalds committed Oct 4, 2006
1 parent 4074517 commit f753c4a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 44c556000a31e8079cfbb9a42a7edb93ca6b589a
refs/heads/master: 21c0d8fdd95024ffa708a938099148b8f1078d46
9 changes: 5 additions & 4 deletions trunk/fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ struct dentry * dget_locked(struct dentry *dentry)
* it can be unhashed only if it has no children, or if it is the root
* of a filesystem.
*
* If the inode has a DCACHE_DISCONNECTED alias, then prefer
* If the inode has an IS_ROOT, DCACHE_DISCONNECTED alias, then prefer
* any other hashed alias over that one unless @want_discon is set,
* in which case only return a DCACHE_DISCONNECTED alias.
* in which case only return an IS_ROOT, DCACHE_DISCONNECTED alias.
*/

static struct dentry * __d_find_alias(struct inode *inode, int want_discon)
Expand All @@ -309,7 +309,8 @@ static struct dentry * __d_find_alias(struct inode *inode, int want_discon)
prefetch(next);
alias = list_entry(tmp, struct dentry, d_alias);
if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
if (alias->d_flags & DCACHE_DISCONNECTED)
if (IS_ROOT(alias) &&
(alias->d_flags & DCACHE_DISCONNECTED))
discon_alias = alias;
else if (!want_discon) {
__dget_locked(alias);
Expand Down Expand Up @@ -1004,7 +1005,7 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
{
struct dentry *new = NULL;

if (inode) {
if (inode && S_ISDIR(inode->i_mode)) {
spin_lock(&dcache_lock);
new = __d_find_alias(inode, 1);
if (new) {
Expand Down

0 comments on commit f753c4a

Please sign in to comment.