X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fdcache.c;h=06f65857a855725247c1190d243c0e19cccd8570;hb=aecd6f44266c13b8709245b21ded2d19291ab070;hp=be2bea834bf459563e2d03e1e0fa8dec97b49c70;hpb=f01387d2693813eb5271a3448e6a082322c7d75d;p=karo-tx-linux.git diff --git a/fs/dcache.c b/fs/dcache.c index be2bea834bf4..06f65857a855 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -150,7 +150,7 @@ static long get_nr_dentry_unused(void) return sum < 0 ? 0 : sum; } -int proc_nr_dentry(ctl_table *table, int write, void __user *buffer, +int proc_nr_dentry(struct ctl_table *table, int write, void __user *buffer, size_t *lenp, loff_t *ppos) { dentry_stat.nr_dentry = get_nr_dentry(); @@ -532,10 +532,12 @@ static inline struct dentry *lock_parent(struct dentry *dentry) struct dentry *parent = dentry->d_parent; if (IS_ROOT(dentry)) return NULL; + if (unlikely((int)dentry->d_lockref.count < 0)) + return NULL; if (likely(spin_trylock(&parent->d_lock))) return parent; - spin_unlock(&dentry->d_lock); rcu_read_lock(); + spin_unlock(&dentry->d_lock); again: parent = ACCESS_ONCE(dentry->d_parent); spin_lock(&parent->d_lock);