[Devel] [PATCH RH7 1/2] fixed lockref check in lock_parent()

Vasily Averin vvs at virtuozzo.com
Wed Feb 17 14:48:24 MSK 2021


lockref.count is unsigned int on vz7 kernels
so backport of upstream commit c2338f2dc7c1e9
"lock_parent: don't step on stale->d_parent of all-but-freed one"
requires correction.

Fixes vz7 commit "ms/lock_parent() needs to recheck if dentry got
__dentry_kill'ed under it"

Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 fs/dcache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/dcache.c b/fs/dcache.c
index a9a3bb52f1b7..41e8f55bd364 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -722,7 +722,7 @@ again:
 	}
 	if (parent != dentry) {
 		spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
-		if (unlikely(dentry->d_lockref.count < 0)) {
+		if (unlikely((int)dentry->d_lockref.count < 0)) {
 			spin_unlock(&parent->d_lock);
 			parent = NULL;
 		}
-- 
2.17.1



More information about the Devel mailing list