From 39badf495a846b14b713183f6d427eac690f434a Mon Sep 17 00:00:00 2001 From: wangdi Date: Thu, 19 Apr 2007 09:33:17 +0000 Subject: [PATCH] Branch:HEAD b:11662 Fix grant leak that caused OST crashes. r:adilger r:green --- lustre/osc/osc_request.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 1.8.3.1