Commit 7f045822 authored by Neil Brown's avatar Neil Brown Committed by Linus Torvalds

[PATCH] PATCH - kNFSd in 2.5.14 - Add a kernel_lock in d_splice_alias

d_move wants the kernel to be locked, so
d_splice_alias now takes that lock.
parent e563665e
...@@ -812,6 +812,7 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry) ...@@ -812,6 +812,7 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
struct dentry *new = NULL; struct dentry *new = NULL;
if (inode && S_ISDIR(inode->i_mode)) { if (inode && S_ISDIR(inode->i_mode)) {
lock_kernel(); /* for d_move */
spin_lock(&dcache_lock); spin_lock(&dcache_lock);
if (!list_empty(&inode->i_dentry)) { if (!list_empty(&inode->i_dentry)) {
new = list_entry(inode->i_dentry.next, struct dentry, d_alias); new = list_entry(inode->i_dentry.next, struct dentry, d_alias);
...@@ -827,6 +828,7 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry) ...@@ -827,6 +828,7 @@ struct dentry *d_splice_alias(struct inode *inode, struct dentry *dentry)
spin_unlock(&dcache_lock); spin_unlock(&dcache_lock);
d_rehash(dentry); d_rehash(dentry);
} }
unlock_kernel();
} else } else
d_add(dentry, inode); d_add(dentry, inode);
return new; return new;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment