From: hongchao.zhang Date: Wed, 30 Jun 2010 15:57:49 +0000 (+0800) Subject: b=23139 workaround to avoid assertion in osc_init_grant X-Git-Tag: v1_8_3_58~3 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=2dfc63659cd30ecb8a33b7b8f9d139b7477303d6;p=fs%2Flustre-release.git b=23139 workaround to avoid assertion in osc_init_grant workaround for 1.6 servers which don't have the patch from bug20278 applied i=oleg.drokin i=eric.mei --- diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 72ce8f8..8ed40e5 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1034,11 +1034,20 @@ static void osc_init_grant(struct client_obd *cli, struct obd_connect_data *ocd) cli->cl_avail_grant = ocd->ocd_grant; else cli->cl_avail_grant = ocd->ocd_grant - cli->cl_dirty; + + if (cli->cl_avail_grant < 0) { + CWARN("%s: available grant < 0, the OSS is probaly not running" + " with patch from bug 20278 (%ld)\n", + cli->cl_import->imp_obd->obd_name, cli->cl_avail_grant); + /* workaround for 1.6 servers which do not have + * the patch from bug 20278 */ + cli->cl_avail_grant = ocd->ocd_grant; + } client_obd_list_unlock(&cli->cl_loi_list_lock); - CDEBUG(D_CACHE, "setting cl_avail_grant: %ld cl_lost_grant: %ld \n", + CDEBUG(D_CACHE, "%s: setting cl_avail_grant: %ld cl_lost_grant: %ld \n", + cli->cl_import->imp_obd->obd_name, cli->cl_avail_grant, cli->cl_lost_grant); - LASSERT(cli->cl_avail_grant >= 0); if (ocd->ocd_connect_flags & OBD_CONNECT_GRANT_SHRINK && list_empty(&cli->cl_grant_shrink_list))