Whamcloud - gitweb
Branch b1_8
authorbobijam <bobijam>
Tue, 12 May 2009 01:37:12 +0000 (01:37 +0000)
committerbobijam <bobijam>
Tue, 12 May 2009 01:37:12 +0000 (01:37 +0000)
b=13277
i=johann
i=Hongchao.zhang (zhanghc)

proper handle of memory shortage when ptlrpc_prep_set retuns NULL.

lustre/ldlm/ldlm_lock.c

index d2face5..7370a2c 100644 (file)
@@ -1337,6 +1337,8 @@ int ldlm_run_bl_ast_work(struct list_head *rpc_list)
         ENTRY;
 
         arg.set = ptlrpc_prep_set();
+        if (NULL == arg.set)
+                RETURN(-ERESTART);
         atomic_set(&arg.restart, 0);
         arg.type = LDLM_BL_CALLBACK;
 
@@ -1394,6 +1396,8 @@ int ldlm_run_cp_ast_work(struct list_head *rpc_list)
         ENTRY;
 
         arg.set = ptlrpc_prep_set();
+        if (NULL == arg.set)
+                RETURN(-ERESTART);
         atomic_set(&arg.restart, 0);
         arg.type = LDLM_CP_CALLBACK;