From: Dmitry Zogin Date: Tue, 21 Sep 2010 13:51:47 +0000 (+0400) Subject: b=23174 Lustre inode size is not coherent across nodes. X-Git-Tag: 2.0.53.0~48 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=f10cebc5729e3e03ed4770037a13dfe950595da3;p=fs%2Flustre-release.git b=23174 Lustre inode size is not coherent across nodes. Update lvbo from disk when AST fails with EINVAL. i=vitaly.fertman i=andrew.perepechko --- diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 81075ee..9000c5b 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -606,19 +606,29 @@ static int ldlm_handle_ast_error(struct ldlm_lock *lock, ldlm_failed_ast(lock, rc, ast_type); } } else if (rc) { - if (rc == -EINVAL) + if (rc == -EINVAL) { + struct ldlm_resource *res = lock->l_resource; LDLM_DEBUG(lock, "client (nid %s) returned %d" " from %s AST - normal race", libcfs_nid2str(peer.nid), req->rq_repmsg ? lustre_msg_get_status(req->rq_repmsg) : -1, ast_type); - else + if (res) { + /* update lvbo to return proper attributes. + * see bug 23174 */ + ldlm_resource_getref(res); + ldlm_res_lvbo_update(res, NULL, 1); + ldlm_resource_putref(res); + } + + } else { LDLM_ERROR(lock, "client (nid %s) returned %d " "from %s AST", libcfs_nid2str(peer.nid), (req->rq_repmsg != NULL) ? lustre_msg_get_status(req->rq_repmsg) : 0, ast_type); + } ldlm_lock_cancel(lock); /* Server-side AST functions are called from ldlm_reprocess_all, * which needs to be told to please restart its reprocessing. */ @@ -641,11 +651,6 @@ static int ldlm_cb_interpret(const struct lu_env *env, lock = req->rq_async_args.pointer_arg[1]; LASSERT(lock != NULL); if (rc != 0) { - /* If client canceled the lock but the cancel has not - * been received yet, we need to update lvbo to have the - * proper attributes cached. */ - if (rc == -EINVAL && arg->type == LDLM_BL_CALLBACK) - ldlm_res_lvbo_update(lock->l_resource, NULL, 1); rc = ldlm_handle_ast_error(lock, req, rc, arg->type == LDLM_BL_CALLBACK ? "blocking" : "completion"); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 3570a30..6f55d0e 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1797,13 +1797,6 @@ static int filter_intent_policy(struct ldlm_namespace *ns, LASSERTF(l->l_glimpse_ast != NULL, "l == %p", l); rc = l->l_glimpse_ast(l, NULL); /* this will update the LVB */ - /* Update the LVB from disk if the AST failed (this is a legal race) */ - /* - * XXX nikita: situation when ldlm_server_glimpse_ast() failed before - * sending ast is not handled. This can result in lost client writes. - */ - if (rc != 0) - ldlm_res_lvbo_update(res, NULL, 1); lock_res(res); *reply_lvb = *res_lvb;