From: Wang Shilong Date: Wed, 19 Feb 2020 08:29:16 +0000 (+0800) Subject: LU-13227 LDLM: update LVB if it is server lock X-Git-Tag: 2.13.53~154 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=3b5c670e65b5f3924e014ab1d030e6f45e2999d3;p=fs%2Flustre-release.git LU-13227 LDLM: update LVB if it is server lock ldlm_glimpse_ast() is registered for server lock which means when client send a glimpse request, it just return a special error for this lock, it is possible that local object has size expanding with this PW lock, so we should try update LVB upon error. Originally, ldlm_cb_interpret() has codes to handle this error, but it only try to handle case with some clients race, it doesn't cover server lock cases especially after we turn on lockless for DIO. Fixes: 6bce536725 ("LU-4198 clio: turn on lockless for some kind of IO") Change-Id: Ic84fd19d9eaf7f8245b8f7a2165ee5913849ac01 Signed-off-by: Wang Shilong Reviewed-on: https://review.whamcloud.com/37611 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin --- diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 11af749..aa2eeea 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -2204,8 +2204,11 @@ int ldlm_work_gl_ast_lock(struct ptlrpc_request_set *rqset, void *opaq) arg->gl_interpret_data = gl_work->gl_interpret_data; /* invoke the actual glimpse callback */ - if (lock->l_glimpse_ast(lock, (void*)arg) == 0) - rc = 1; + rc = lock->l_glimpse_ast(lock, (void *)arg); + if (rc == 0) + rc = 1; /* update LVB if this is server lock */ + else if (rc == -ELDLM_NO_LOCK_DATA) + ldlm_lvbo_update(lock->l_resource, lock, NULL, 1); LDLM_LOCK_RELEASE(lock); if (gl_work->gl_flags & LDLM_GL_WORK_SLAB_ALLOCATED)