staging: lustre: ldlm: dont always check max_pages_per_rpc alignement
authorSebastien Buisson <[email protected]>
Thu, 28 Apr 2016 16:07:35 +0000 (12:07 -0400)
committerGreg Kroah-Hartman <[email protected]>
Fri, 29 Apr 2016 04:55:26 +0000 (21:55 -0700)
If connection is not established yet, cli->cl_chunkbits is
uninitilized so we cannot use it to check max_pages_per_rpc
alignment.

Signed-off-by: Sebastien Buisson <[email protected]>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4379
Reviewed-on: http://review.whamcloud.com/8558
Reviewed-by: Andreas Dilger <[email protected]>
Reviewed-by: Bob Glossman <[email protected]>
Reviewed-by: Emoly Liu <[email protected]>
Signed-off-by: James Simmons <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/staging/lustre/lustre/ldlm/ldlm_lib.c

index 47911361e236566f95280e2afdfd15d629d13f1c..b4ffbe2fc4eda02032ae4baafc799a173dd180ab 100644 (file)
@@ -356,6 +356,12 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
        cli->cl_max_pages_per_rpc = min_t(int, PTLRPC_MAX_BRW_PAGES,
                                          LNET_MTU >> PAGE_SHIFT);
 
+       /*
+        * set cl_chunkbits default value to PAGE_CACHE_SHIFT,
+        * it will be updated at OSC connection time.
+        */
+       cli->cl_chunkbits = PAGE_SHIFT;
+
        if (!strcmp(name, LUSTRE_MDC_NAME)) {
                cli->cl_max_rpcs_in_flight = MDC_MAX_RIF_DEFAULT;
        } else if (totalram_pages >> (20 - PAGE_SHIFT) <= 128 /* MB */) {