From: Liang Zhen Date: Sun, 12 Jan 2014 16:11:47 +0000 (+0800) Subject: LU-3618 ptlrpc: rq_commit_cb is called for twice X-Git-Tag: 2.5.55~40 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8c64be3fbf4206ac6aa3df2eaa078e0630fa33aa LU-3618 ptlrpc: rq_commit_cb is called for twice If a ptlrpc_request is already on imp::imp_replay_list, when it's replayed and replied, after_reply() will call req::rq_commit_cb for the request, then call it again in ptlrpc_free_committed. Signed-off-by: Liang Zhen Change-Id: I796c3351ad896aa3e1d0c2147ca7f775b7c14bfc Reviewed-on: http://review.whamcloud.com/8815 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Alex Zhuravlev Reviewed-by: Bobi Jam Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index e71dabb..970e441 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -1362,7 +1362,11 @@ static int after_reply(struct ptlrpc_request *req) /** version recovery */ ptlrpc_save_versions(req); ptlrpc_retain_replayable_request(req, imp); - } else if (req->rq_commit_cb != NULL) { + } else if (req->rq_commit_cb != NULL && + list_empty(&req->rq_replay_list)) { + /* NB: don't call rq_commit_cb if it's already on + * rq_replay_list, ptlrpc_free_committed() will call + * it later, see LU-3618 for details */ spin_unlock(&imp->imp_lock); req->rq_commit_cb(req); spin_lock(&imp->imp_lock);