Commit cc4b0bcd authored by Andrew Morton's avatar Andrew Morton Committed by Christoph Hellwig

[PATCH] d_lookup forgotten spin_unlock()

From: Nikita Danilov, Maneesh Soni

d_lookup() is forgetting to release the lock when the rename race happens.
parent 6a53edc5
...@@ -995,12 +995,12 @@ struct dentry * d_lookup(struct dentry * parent, struct qstr * name) ...@@ -995,12 +995,12 @@ struct dentry * d_lookup(struct dentry * parent, struct qstr * name)
/* /*
* If dentry is moved, fail the lookup * If dentry is moved, fail the lookup
*/ */
if (unlikely(move_count != dentry->d_move_count)) if (likely(move_count == dentry->d_move_count)) {
break; if (!d_unhashed(dentry)) {
if (!d_unhashed(dentry)) { atomic_inc(&dentry->d_count);
atomic_inc(&dentry->d_count); dentry->d_vfs_flags |= DCACHE_REFERENCED;
dentry->d_vfs_flags |= DCACHE_REFERENCED; found = dentry;
found = dentry; }
} }
spin_unlock(&dentry->d_lock); spin_unlock(&dentry->d_lock);
break; break;
......
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