Whamcloud - gitweb
b=23139 give the required grant for reconnection
authorhongchao.zhang <Hongchao.Zhang@sun.com>
Thu, 22 Jul 2010 04:25:27 +0000 (12:25 +0800)
committerJohann Lombardi <johann.lombardi@oracle.com>
Fri, 30 Jul 2010 13:50:27 +0000 (15:50 +0200)
if a client is reconnecting to the filter, the grant
required by the client should be honored

i=oleg.drokin
i=eric.mei

lustre/obdfilter/filter_io.c

index 7b5332b..28c828e 100644 (file)
@@ -226,7 +226,8 @@ long filter_grant(struct obd_export *exp, obd_size current_grant,
                        obd->obd_name, exp->exp_client_uuid.uuid, exp, want);
         } else if (current_grant < want &&
                    current_grant < fed->fed_grant + FILTER_GRANT_CHUNK) {
-                grant = min(want + (1 << blockbits) - 1, fs_space_left / 8);
+                grant = min(want + (1 << blockbits) - 1, 
+                            fs_space_left / (conservative ? 8 : 1));
                 grant &= ~((1ULL << blockbits) - 1);
 
                 if (grant) {
@@ -244,6 +245,11 @@ long filter_grant(struct obd_export *exp, obd_size current_grant,
                                 LBUG();
                         }
                 }
+
+                LASSERTF(conservative || (fed->fed_grant >= want), "can't get "
+                         "enough grant (want = "LPU64", fs_space_left = "LPU64
+                         ", gotten = %ld)\n", 
+                         want, fs_space_left, fed->fed_grant);
         }
 
         CDEBUG(D_CACHE,