From 6f86519b3483b4cc754b42bddc98617de14cef2b Mon Sep 17 00:00:00 2001 From: Emoly Liu Date: Wed, 20 Dec 2017 17:32:37 +0800 Subject: [PATCH] LU-10392 fid: improve seq allocation error messages When MDTs are waiting for MDT0000 to start the master sequence server and be granted a meta sequence for the first time, in case of "-EINPROGRESS", the limited console messages would be clearer and better than many error messages. Change-Id: I64e80508cf9fb837a328b4f8228f29bfb764845d Signed-off-by: Emoly Liu Reviewed-on: https://review.whamcloud.com/30623 Tested-by: Jenkins Reviewed-by: Andreas Dilger Reviewed-by: Yang Sheng Tested-by: Maloo Reviewed-by: Giuseppe Di Natale --- lustre/fid/fid_handler.c | 13 +++++++++++-- lustre/fid/fid_request.c | 10 ++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lustre/fid/fid_handler.c b/lustre/fid/fid_handler.c index 2562f0f..a681117 100644 --- a/lustre/fid/fid_handler.c +++ b/lustre/fid/fid_handler.c @@ -325,8 +325,17 @@ static int __seq_server_alloc_meta(struct lu_server_seq *seq, rc = seq_server_check_and_alloc_super(env, seq); if (rc < 0) { - CERROR("%s: Allocated super-sequence failed: rc = %d\n", - seq->lss_name, rc); + if (rc == -EINPROGRESS) { + static int printed; + + if (printed++ % 8 == 0) + LCONSOLE_INFO("%s: Waiting to contact MDT0000 " + "to allocate super-sequence\n", + seq->lss_name); + } else { + CERROR("%s: Allocated super-sequence failed: rc = %d\n", + seq->lss_name, rc); + } RETURN(rc); } diff --git a/lustre/fid/fid_request.c b/lustre/fid/fid_request.c index 317f769..78638c1 100644 --- a/lustre/fid/fid_request.c +++ b/lustre/fid/fid_request.c @@ -223,8 +223,9 @@ static int seq_client_alloc_seq(const struct lu_env *env, if (lu_seq_range_is_exhausted(&seq->lcs_space)) { rc = seq_client_alloc_meta(env, seq); if (rc) { - CERROR("%s: Can't allocate new meta-sequence," - "rc %d\n", seq->lcs_name, rc); + if (rc != -EINPROGRESS) + CERROR("%s: Can't allocate new meta-sequence," + "rc = %d\n", seq->lcs_name, rc); RETURN(rc); } else { CDEBUG(D_INFO, "%s: New range - "DRANGE"\n", @@ -379,8 +380,9 @@ int seq_client_alloc_fid(const struct lu_env *env, /* Re-take seq::lcs_mutex via seq_fid_alloc_fini(). */ seq_fid_alloc_fini(seq, rc ? 0 : seqnr, false); if (rc) { - CERROR("%s: Can't allocate new sequence: rc = %d\n", - seq->lcs_name, rc); + if (rc != -EINPROGRESS) + CERROR("%s: Can't allocate new sequence: " + "rc = %d\n", seq->lcs_name, rc); mutex_unlock(&seq->lcs_mutex); RETURN(rc); -- 1.8.3.1