[Devel] [PATCH RHEL7 COMMIT] fixed lockref check in lock_parent()

Vasily Averin vvs at virtuozzo.com
Wed Feb 17 15:36:01 MSK 2021


The commit is pushed to "branch-rh7-3.10.0-1160.11.1.vz7.172.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.11.1.vz7.172.13
------>
commit ed9c78a33af740bc39393458fb2edba6ad6ac8ab
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Wed Feb 17 15:36:00 2021 +0300

    fixed lockref check in lock_parent()
    
    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 a9a3bb5..41e8f55 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;
 		}


More information about the Devel mailing list