aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ceph/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r--fs/ceph/inode.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index bb68c799074d..2c6944473366 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -842,11 +842,13 @@ static void ceph_set_dentry_offset(struct dentry *dn)
842 spin_unlock(&inode->i_lock); 842 spin_unlock(&inode->i_lock);
843 843
844 spin_lock(&dcache_lock); 844 spin_lock(&dcache_lock);
845 spin_lock(&dn->d_lock); 845 spin_lock(&dir->d_lock);
846 spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
846 list_move(&dn->d_u.d_child, &dir->d_subdirs); 847 list_move(&dn->d_u.d_child, &dir->d_subdirs);
847 dout("set_dentry_offset %p %lld (%p %p)\n", dn, di->offset, 848 dout("set_dentry_offset %p %lld (%p %p)\n", dn, di->offset,
848 dn->d_u.d_child.prev, dn->d_u.d_child.next); 849 dn->d_u.d_child.prev, dn->d_u.d_child.next);
849 spin_unlock(&dn->d_lock); 850 spin_unlock(&dn->d_lock);
851 spin_unlock(&dir->d_lock);
850 spin_unlock(&dcache_lock); 852 spin_unlock(&dcache_lock);
851} 853}
852 854
@@ -1232,9 +1234,11 @@ retry_lookup:
1232 } else { 1234 } else {
1233 /* reorder parent's d_subdirs */ 1235 /* reorder parent's d_subdirs */
1234 spin_lock(&dcache_lock); 1236 spin_lock(&dcache_lock);
1235 spin_lock(&dn->d_lock); 1237 spin_lock(&parent->d_lock);
1238 spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
1236 list_move(&dn->d_u.d_child, &parent->d_subdirs); 1239 list_move(&dn->d_u.d_child, &parent->d_subdirs);
1237 spin_unlock(&dn->d_lock); 1240 spin_unlock(&dn->d_lock);
1241 spin_unlock(&parent->d_lock);
1238 spin_unlock(&dcache_lock); 1242 spin_unlock(&dcache_lock);
1239 } 1243 }
1240 1244