[Devel] [PATCH RHEL7 COMMIT] Revert "ms/nfsd: don't put blocked locks on LRU until after vfs_lock_file returns"

Vasily Averin vvs at virtuozzo.com
Thu Dec 30 16:58:00 MSK 2021


The commit is pushed to "branch-rh7-3.10.0-1160.42.2.vz7.184.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1160.42.2.vz7.184.7
------>
commit c2ff5a147f597f1327c3e4d74e1d3799c753432d
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Thu Dec 30 16:58:00 2021 +0300

    Revert "ms/nfsd: don't put blocked locks on LRU until after vfs_lock_file returns"
    
    This reverts commit 13a6bf2169ce64ef70474b93de335c93be8b41af.
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 fs/nfsd/nfs4state.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index ff64be3..4a57b40 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -5991,8 +5991,10 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 	}
 
 	if (fl_flags & FL_SLEEP) {
+		nbl->nbl_time = get_seconds();
 		spin_lock(&nn->blocked_locks_lock);
 		list_add_tail(&nbl->nbl_list, &lock_sop->lo_blocked);
+		list_add_tail(&nbl->nbl_lru, &nn->blocked_locks_lru);
 		spin_unlock(&nn->blocked_locks_lock);
 	}
 
@@ -6003,10 +6005,6 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
 		status = 0;
 		break;
 	case FILE_LOCK_DEFERRED:
-		nbl->nbl_time = get_seconds();
-		spin_lock(&nn->blocked_locks_lock);
-		list_add_tail(&nbl->nbl_lru, &nn->blocked_locks_lru);
-		spin_unlock(&nn->blocked_locks_lock);
 		nbl = NULL;
 		/* Fallthrough */
 	case -EAGAIN:		/* conflock holds conflicting lock */


More information about the Devel mailing list