Whamcloud - gitweb
LU-11752 osc: pass client page size during reconnect too 47/33847/8
authorMikhail Pershin <mpershin@whamcloud.com>
Thu, 13 Dec 2018 10:11:05 +0000 (13:11 +0300)
committerOleg Drokin <green@whamcloud.com>
Thu, 21 Mar 2019 03:43:15 +0000 (03:43 +0000)
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 <mpershin@whamcloud.com>
Change-Id: I14bba1d025e4e9fb99fd4bae4002463439ac265c
Reviewed-on: https://review.whamcloud.com/33847
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/osc_request.c

index a5b1e2a..f3a9f38 100644 (file)
@@ -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;
 
                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;
                        grant += cli->cl_dirty_grant;
-               else
+               } else {
                        grant += cli->cl_dirty_pages << PAGE_SHIFT;
                        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;
                data->ocd_grant = grant ? : 2 * cli_brw_size(obd);
                lost_grant = cli->cl_lost_grant;
                cli->cl_lost_grant = 0;