From: Mikhail Pershin Date: Mon, 11 Nov 2019 21:24:39 +0000 (+0300) Subject: LU-12781 ptlrpc: fix inline reply buffer grow X-Git-Tag: 2.13.51~29 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;ds=sidebyside;h=02c23a2e851fdebc3e2bde45a51fb043559504ab;p=fs%2Flustre-release.git LU-12781 ptlrpc: fix inline reply buffer grow In req_capsule_server_grow() reply buffer can be increased without re-allocation if has enough size already, don't do that though if rs->rs_repbuf is a wrapper, e.g. with security enabled. In that case re-allocation is still needed. Re-enable test 272a in sanity.sh with SHARED_KEY Test-Parameters: mdscount=2 mdtcount=4 envdefinitions=SHARED_KEY=true testlist=sanity,sanity-pfl Signed-off-by: Mikhail Pershin Change-Id: I0632b9513f877bea989b7a61a729e2db488dcfcc Reviewed-on: https://review.whamcloud.com/36732 Tested-by: jenkins Reviewed-by: Sebastien Buisson Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdt/mdt_io.c b/lustre/mdt/mdt_io.c index 7a55ba2..e18d6f1 100644 --- a/lustre/mdt/mdt_io.c +++ b/lustre/mdt/mdt_io.c @@ -211,7 +211,7 @@ static int mdt_rw_hpreq_check(struct ptlrpc_request *req) if (pa.lpa_blocks_cnt > 0) { CDEBUG(D_DLMTRACE, - "%s: refreshed %u locks timeout for req %p", + "%s: refreshed %u locks timeout for req %p\n", tgt_name(tsi->tsi_tgt), pa.lpa_blocks_cnt, req); RETURN(1); } diff --git a/lustre/ptlrpc/layout.c b/lustre/ptlrpc/layout.c index 18f2e72..3fb3099 100644 --- a/lustre/ptlrpc/layout.c +++ b/lustre/ptlrpc/layout.c @@ -2539,8 +2539,13 @@ int req_capsule_server_grow(struct req_capsule *pill, len, newlen); req_capsule_set_size(pill, field, RCL_SERVER, newlen); - /* there can be enough space in current reply buffer */ - if (rs->rs_repbuf_len >= + /** + * There can be enough space in current reply buffer, make sure + * that rs_repbuf is not a wrapper but real reply msg, otherwise + * re-packing is still needed. + */ + if (rs->rs_msg == rs->rs_repbuf && + rs->rs_repbuf_len >= lustre_packed_msg_size(rs->rs_msg) - len + newlen) { pill->rc_req->rq_replen = lustre_grow_msg(rs->rs_msg, offset, newlen); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 2afc8ef..ab86f14 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -45,8 +45,8 @@ ALWAYS_EXCEPT+=" 42a 42b 42c " ALWAYS_EXCEPT+=" 407 312 " if $SHARED_KEY; then - # bug number: LU-9795 LU-9795 LU-9795 LU-9795 LU-12781 - ALWAYS_EXCEPT+=" 17n 60a 133g 300f 272a" + # bug number: LU-9795 LU-9795 LU-9795 LU-9795 + ALWAYS_EXCEPT+=" 17n 60a 133g 300f" fi selinux_status=$(getenforce) @@ -18988,7 +18988,7 @@ test_272a() { error "md5sum differ: $old_md5, $new_md5" [ $($LFS getstripe -c $dom) -eq 2 ] || - error "migrate stripe count bad: $(LFS getstripe -c $dom) != 2" + error "bad final stripe count: $($LFS getstripe -c $dom) != 2" } run_test 272a "DoM migration: new layout with the same DOM component"