Loading fs/dcache.c +12 −9 Original line number Diff line number Diff line Loading @@ -174,9 +174,12 @@ static struct dentry *d_kill(struct dentry *dentry) dentry_stat.nr_dentry--; /* For d_free, below */ /*drops the locks, at that point nobody can reach this dentry */ dentry_iput(dentry); if (IS_ROOT(dentry)) parent = NULL; else parent = dentry->d_parent; d_free(dentry); return dentry == parent ? NULL : parent; return parent; } /* Loading Loading @@ -666,11 +669,12 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry) BUG(); } parent = dentry->d_parent; if (parent == dentry) if (IS_ROOT(dentry)) parent = NULL; else else { parent = dentry->d_parent; atomic_dec(&parent->d_count); } list_del(&dentry->d_u.d_child); detached++; Loading Loading @@ -1723,7 +1727,7 @@ static int d_isparent(struct dentry *p1, struct dentry *p2) { struct dentry *p; for (p = p2; p->d_parent != p; p = p->d_parent) { for (p = p2; !IS_ROOT(p); p = p->d_parent) { if (p->d_parent == p1) return 1; } Loading Loading @@ -2168,10 +2172,9 @@ int is_subdir(struct dentry * new_dentry, struct dentry * old_dentry) seq = read_seqbegin(&rename_lock); for (;;) { if (new_dentry != old_dentry) { struct dentry * parent = new_dentry->d_parent; if (parent == new_dentry) if (IS_ROOT(new_dentry)) break; new_dentry = parent; new_dentry = new_dentry->d_parent; continue; } result = 1; Loading fs/namei.c +2 −2 Original line number Diff line number Diff line Loading @@ -1454,7 +1454,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2) mutex_lock(&p1->d_inode->i_sb->s_vfs_rename_mutex); for (p = p1; p->d_parent != p; p = p->d_parent) { for (p = p1; !IS_ROOT(p); p = p->d_parent) { if (p->d_parent == p2) { mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_PARENT); mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_CHILD); Loading @@ -1462,7 +1462,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2) } } for (p = p2; p->d_parent != p; p = p->d_parent) { for (p = p2; !IS_ROOT(p); p = p->d_parent) { if (p->d_parent == p1) { mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_PARENT); mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_CHILD); Loading Loading
fs/dcache.c +12 −9 Original line number Diff line number Diff line Loading @@ -174,9 +174,12 @@ static struct dentry *d_kill(struct dentry *dentry) dentry_stat.nr_dentry--; /* For d_free, below */ /*drops the locks, at that point nobody can reach this dentry */ dentry_iput(dentry); if (IS_ROOT(dentry)) parent = NULL; else parent = dentry->d_parent; d_free(dentry); return dentry == parent ? NULL : parent; return parent; } /* Loading Loading @@ -666,11 +669,12 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry) BUG(); } parent = dentry->d_parent; if (parent == dentry) if (IS_ROOT(dentry)) parent = NULL; else else { parent = dentry->d_parent; atomic_dec(&parent->d_count); } list_del(&dentry->d_u.d_child); detached++; Loading Loading @@ -1723,7 +1727,7 @@ static int d_isparent(struct dentry *p1, struct dentry *p2) { struct dentry *p; for (p = p2; p->d_parent != p; p = p->d_parent) { for (p = p2; !IS_ROOT(p); p = p->d_parent) { if (p->d_parent == p1) return 1; } Loading Loading @@ -2168,10 +2172,9 @@ int is_subdir(struct dentry * new_dentry, struct dentry * old_dentry) seq = read_seqbegin(&rename_lock); for (;;) { if (new_dentry != old_dentry) { struct dentry * parent = new_dentry->d_parent; if (parent == new_dentry) if (IS_ROOT(new_dentry)) break; new_dentry = parent; new_dentry = new_dentry->d_parent; continue; } result = 1; Loading
fs/namei.c +2 −2 Original line number Diff line number Diff line Loading @@ -1454,7 +1454,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2) mutex_lock(&p1->d_inode->i_sb->s_vfs_rename_mutex); for (p = p1; p->d_parent != p; p = p->d_parent) { for (p = p1; !IS_ROOT(p); p = p->d_parent) { if (p->d_parent == p2) { mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_PARENT); mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_CHILD); Loading @@ -1462,7 +1462,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2) } } for (p = p2; p->d_parent != p; p = p->d_parent) { for (p = p2; !IS_ROOT(p); p = p->d_parent) { if (p->d_parent == p1) { mutex_lock_nested(&p1->d_inode->i_mutex, I_MUTEX_PARENT); mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_CHILD); Loading