X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=fs%2Fdcache.c;h=9ae808fba517bc3cb54080874317ddba2acf0d30;hb=refs%2Fheads%2Fsandbox%2Fklewandowski%2Frpi5;hp=25ac74d30bff3b39e6763c4717cee2b403d80139;hpb=5c5e0e81202667f9c052edb99699818363b19129;p=platform%2Fkernel%2Flinux-rpi.git diff --git a/fs/dcache.c b/fs/dcache.c index 25ac74d..9ae808f 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -787,12 +787,12 @@ static inline bool fast_dput(struct dentry *dentry) */ if (unlikely(ret < 0)) { spin_lock(&dentry->d_lock); - if (dentry->d_lockref.count > 1) { - dentry->d_lockref.count--; + if (WARN_ON_ONCE(dentry->d_lockref.count <= 0)) { spin_unlock(&dentry->d_lock); return true; } - return false; + dentry->d_lockref.count--; + goto locked; } /* @@ -850,6 +850,7 @@ static inline bool fast_dput(struct dentry *dentry) * else could have killed it and marked it dead. Either way, we * don't need to do anything else. */ +locked: if (dentry->d_lockref.count) { spin_unlock(&dentry->d_lock); return true;