[prev in list] [next in list] [prev in thread] [next in thread]
List: drbd-cvs
Subject: [DRBD-cvs] svn commit by phil - r2916 - branches/drbd-8.0/drbd -
From: drbd-cvs () linbit ! com
Date: 2007-06-12 14:39:07
Message-ID: 20070612143907.B40382E03725 () mail ! linbit ! com
[Download RAW message or body]
Author: phil
Date: 2007-06-12 16:39:06 +0200 (Tue, 12 Jun 2007)
New Revision: 2916
Modified:
branches/drbd-8.0/drbd/drbd_nl.c
Log:
Patch suggested by Ernest. I changed it to Linux coding style,
and shortened it a bit.
Modified: branches/drbd-8.0/drbd/drbd_nl.c
===================================================================
--- branches/drbd-8.0/drbd/drbd_nl.c 2007-06-08 09:48:01 UTC (rev 2915)
+++ branches/drbd-8.0/drbd/drbd_nl.c 2007-06-12 14:39:06 UTC (rev 2916)
@@ -676,7 +676,7 @@
struct inode *inode, *inode2;
struct lru_cache* resync_lru = NULL;
drbd_state_t ns,os;
- int rv;
+ int rv,ntries=0;
/* if you want to reconfigure, please tear down first */
if (mdev->state.disk > Diskless) {
@@ -684,6 +684,20 @@
goto fail;
}
+ /*
+ * We may have gotten here very quickly from a detach. Wait for a bit
+ * then fail.
+ */
+ while(mdev->bc != NULL) {
+ if(ntries++ >= 5) {
+ WARN("drbd_nl_disk_conf: mdev->bc not NULL.\n");
+ retcode=HaveDiskConfig;
+ goto fail;
+ }
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(HZ/10);
+ }
+
nbc = kmalloc(sizeof(struct drbd_backing_dev),GFP_KERNEL);
if(!nbc) {
retcode=KMallocFailed;
_______________________________________________
drbd-cvs mailing list
drbd-cvs@lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic