[DRBD-cvs] drbd by phil; In case we every see a single of these k...
drbd-user@lists.linbit.com
drbd-user@lists.linbit.com
Mon, 5 Jul 2004 10:01:31 +0200 (CEST)
DRBD CVS committal
Author : phil
Module : drbd
Dir : drbd/drbd
Modified Files:
Tag: rel-0_7-branch
drbd_main.c
Log Message:
In case we every see a single of these kmalloc()s fail, we have to
create an additional mempool for the barrier objects...
===================================================================
RCS file: /var/lib/cvs/drbd/drbd/drbd/drbd_main.c,v
retrieving revision 1.73.2.195
retrieving revision 1.73.2.196
diff -u -3 -r1.73.2.195 -r1.73.2.196
--- drbd_main.c 1 Jul 2004 10:11:13 -0000 1.73.2.195
+++ drbd_main.c 5 Jul 2004 08:01:26 -0000 1.73.2.196
@@ -231,6 +231,10 @@
// THINK this is called in the IO path with the send_mutex held
// and GFP_KERNEL may itself start IO. set it to GFP_NOIO.
b=kmalloc(sizeof(struct drbd_barrier),GFP_NOIO);
+ if(!b) {
+ ERR("could not kmalloc() barrier\n");
+ return 0;
+ }
INIT_LIST_HEAD(&b->requests);
b->next=0;
b->br_number=barrier_nr_issue;
@@ -302,6 +306,10 @@
unsigned int size;
new_first=kmalloc(sizeof(struct drbd_barrier),GFP_KERNEL);
+ if(!new_first) {
+ ERR("could not kmalloc() barrier\n");
+ }
+
INIT_LIST_HEAD(&new_first->requests);
new_first->next=0;
new_first->br_number=4711;