Whamcloud - gitweb
Branch:HEAD
authorwangdi <wangdi>
Thu, 19 Apr 2007 09:33:17 +0000 (09:33 +0000)
committerwangdi <wangdi>
Thu, 19 Apr 2007 09:33:17 +0000 (09:33 +0000)
b:11662
Fix grant leak that caused OST crashes.
r:adilger
r:green

lustre/osc/osc_request.c

index dca0fd9..dacd3f3 100644 (file)
@@ -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);