From 5bec8f95cc1028d207e55e659a27d80081864a83 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Thu, 13 Dec 2018 13:11:05 +0300 Subject: [PATCH] LU-11752 osc: pass client page size during reconnect too Client page size is reported to the server in ocd_grant_blkbits and server returns back device blocksize. During reconnect that ocd_grant_blkbits contains server device blocksize which is used by server as client page size wrongly. Patch sets ocd_grant_blkbits to the client page size again during reconnect so server will get expected information. Signed-off-by: Mikhail Pershin Change-Id: I14bba1d025e4e9fb99fd4bae4002463439ac265c Reviewed-on: https://review.whamcloud.com/33847 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- lustre/osc/osc_request.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index a5b1e2a..f3a9f38 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -2997,10 +2997,13 @@ int osc_reconnect(const struct lu_env *env, struct obd_export *exp, spin_lock(&cli->cl_loi_list_lock); grant = cli->cl_avail_grant + cli->cl_reserved_grant; - if (data->ocd_connect_flags & OBD_CONNECT_GRANT_PARAM) + if (data->ocd_connect_flags & OBD_CONNECT_GRANT_PARAM) { + /* restore ocd_grant_blkbits as client page bits */ + data->ocd_grant_blkbits = PAGE_SHIFT; grant += cli->cl_dirty_grant; - else + } else { grant += cli->cl_dirty_pages << PAGE_SHIFT; + } data->ocd_grant = grant ? : 2 * cli_brw_size(obd); lost_grant = cli->cl_lost_grant; cli->cl_lost_grant = 0; -- 1.8.3.1