Whamcloud - gitweb
Branch:b1_6
authorwangdi <wangdi>
Thu, 24 May 2007 06:30:41 +0000 (06:30 +0000)
committerwangdi <wangdi>
Thu, 24 May 2007 06:30:41 +0000 (06:30 +0000)
Clear the grant when disconnect the import to prevent the grant being erased
wrongly when the import is evicted.
b=12371
i=green
i=adilger

lustre/ChangeLog
lustre/osc/osc_request.c

index 88c3df1..9be0f36 100644 (file)
@@ -133,6 +133,17 @@ Details    : When osc reconnect ost, OST(filter) should check whether it
             to update the client grant space info.
 
 Severity   : normal
+Frequency  : when client is evicted 
+Bugzilla   : 11662
+Description: Grant might be wrongly erased when osc is evicted by OST
+Details    : when the import is evicted by server, it will fork another 
+            thread ptlrpc_invalidate_import_thread to invalidate the 
+            import, where the grant will be set to 0.  While the original 
+            thread will update the grant it got when connecting. So if 
+            the former happened latter, the grant will be wrongly errased 
+            because of this race.
+
+Severity   : normal
 Frequency  : rare 
 Bugzilla   : 12401
 Description: Checking Stale with correct fid 
index 31a54ad..31e7e39 100644 (file)
@@ -3435,6 +3435,11 @@ static int osc_import_event(struct obd_device *obd,
                         oscc->oscc_flags |= OSCC_FLAG_RECOVERING;
                         spin_unlock(&oscc->oscc_lock);
                 }
+                cli = &obd->u.cli;
+                client_obd_list_lock(&cli->cl_loi_list_lock);
+                cli->cl_avail_grant = 0;
+                cli->cl_lost_grant = 0;
+                client_obd_list_unlock(&cli->cl_loi_list_lock);
 
                 break;
         }
@@ -3448,8 +3453,6 @@ static int osc_import_event(struct obd_device *obd,
                 /* Reset grants */
                 cli = &obd->u.cli;
                 client_obd_list_lock(&cli->cl_loi_list_lock);
-                cli->cl_avail_grant = 0;
-                cli->cl_lost_grant = 0;
                 /* all pages go to failing rpcs due to the invalid import */
                 osc_check_rpcs(cli);
                 client_obd_list_unlock(&cli->cl_loi_list_lock);