diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 88c3df1e6da5c3777ad779ff861f6afb34493a0f..9be0f36fe22a1bb4b59520a13460068669c7cd1f 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -132,6 +132,17 @@ Details : When osc reconnect ost, OST(filter) should check whether it of "new granted" space, because client will call osc_init_grant 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 diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 31a54adedb74bb6041d64dc5042c8d8d0797d7b6..31e7e398327de085e5bddbd2545a88afb6614d54 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);