From: wangdi Date: Thu, 24 May 2007 06:30:41 +0000 (+0000) Subject: Branch:b1_6 X-Git-Tag: v1_8_0_110~1598 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b3debac67f82e116667af35a60bbfb686abf48e4;p=fs%2Flustre-release.git Branch:b1_6 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 --- diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 88c3df1..9be0f36 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -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 diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 31a54ad..31e7e39 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -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);