From: wangdi Date: Thu, 19 Apr 2007 09:33:17 +0000 (+0000) Subject: Branch:HEAD X-Git-Tag: 1.6.0~34 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=39badf495a846b14b713183f6d427eac690f434a;p=fs%2Flustre-release.git Branch:HEAD b:11662 Fix grant leak that caused OST crashes. r:adilger r:green --- diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index dca0fd9..dacd3f3 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -1312,7 +1312,8 @@ static int async_internal(int cmd, struct obd_export *exp, struct obdo *oa, * otherwise we may run out of space on OST due to grant. */ spin_lock(&cli->cl_loi_list_lock); for (i = 0; i < page_count; i++) { - if (cli->cl_avail_grant >= CFS_PAGE_SIZE) + if (cli->cl_avail_grant >= CFS_PAGE_SIZE && + cmd == OBD_BRW_WRITE) osc_consume_write_grant(cli, pga[i]); } spin_unlock(&cli->cl_loi_list_lock);