@@ -638,13 +638,14 @@ static inline struct dentry *lock_parent(struct dentry *dentry)
* Must be called at dput of negative dentry.
*/
static void sweep_negative(struct dentry *dentry)
+ __releases(dentry->d_lock)
{
struct dentry *parent;
if (!d_is_tail_negative(dentry)) {
parent = lock_parent(dentry);
if (!parent)
- return;
+ goto out;
if (!d_count(dentry) && d_is_negative(dentry) &&
!d_is_tail_negative(dentry)) {
@@ -654,6 +655,8 @@ static void sweep_negative(struct dentry *dentry)
spin_unlock(&parent->d_lock);
}
+out:
+ spin_unlock(&dentry->d_lock);
}
/*
@@ -922,7 +925,8 @@ void dput(struct dentry *dentry)
if (likely(retain_dentry(dentry))) {
if (d_is_negative(dentry))
sweep_negative(dentry);
- spin_unlock(&dentry->d_lock);
+ else
+ spin_unlock(&dentry->d_lock);
return;
}