Whamcloud - gitweb
LU-11752 osc: pass client page size during reconnect too 85/34485/2
authorMikhail Pershin <mpershin@whamcloud.com>
Thu, 13 Dec 2018 10:11:05 +0000 (13:11 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 1 Apr 2019 06:19:21 +0000 (06:19 +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.

Lustre-change: https://review.whamcloud.com/33847
Lustre-commit: 5bec8f95cc1028d207e55e659a27d80081864a83

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: I14bba1d025e4e9fb99fd4bae4002463439ac265c
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34485
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
lustre/osc/osc_request.c

index 4e44819..72d0e65 100644 (file)
@@ -2985,10 +2985,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;