[DRBD-cvs] r1616 - in branches/drbd-0.7: . drbd

svn at svn.drbd.org svn at svn.drbd.org
Thu Oct 28 21:41:26 CEST 2004


Author: phil
Date: 2004-10-28 21:41:23 +0200 (Thu, 28 Oct 2004)
New Revision: 1616

Modified:
   branches/drbd-0.7/INSTALL
   branches/drbd-0.7/drbd/drbd_req.c
Log:
Make it impossible to mount the device on the secondary in ro
mode, on Linux-2.4.x


Modified: branches/drbd-0.7/INSTALL
===================================================================
--- branches/drbd-0.7/INSTALL	2004-10-28 19:36:59 UTC (rev 1615)
+++ branches/drbd-0.7/INSTALL	2004-10-28 19:41:23 UTC (rev 1616)
@@ -135,7 +135,7 @@
    will only work properly with a matching kernel.
 
        all# make dep	# no longer neccessary with 2.6.x
-       all# make linux/include/version.h
+       all# make include/linux/version.h
           # and since kernel 2.6.6 (some distros 2.6.5-something):
        all# make modules_prepare
 

Modified: branches/drbd-0.7/drbd/drbd_req.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_req.c	2004-10-28 19:36:59 UTC (rev 1615)
+++ branches/drbd-0.7/drbd/drbd_req.c	2004-10-28 19:41:23 UTC (rev 1616)
@@ -179,11 +179,27 @@
 		return 0;
 	}
 
-	/* FIXME
-	 * not always true, e.g. someone trying to mount on Secondary
-	 * maybe error out immediately here?
+	/*
+	 * If someone tries to mount on Secondary, and this is a 2.4 kernel,
+	 * it would lead to a readonly mounted, but not cache-coherent,
+	 * therefore dangerous, filesystem.
+	 * On 2.6 this is prevented by bd_claiming the device.
+	 * It is not that easy in 2.4.
+	 *
+	 * Because people continue to report they mount readonly, it does not
+	 * do what they expect, and their logs fill with messages and stuff.
+	 *
+	 * Since it just won't work, we just fail IO here.
+	 * [ ... until we implement some shared mode, and our users confirm by
+	 * configuration, that they handle cache coherency themselves ... ]
 	 */
-	D_ASSERT(mdev->state == Primary);
+	if (mdev->state != Primary) {
+		if (DRBD_ratelimit(5*HZ,5)) {
+			ERR("Not in Primary state, no IO requests allowed\n");
+		}
+		drbd_bio_IO_error(bio);
+		return 0;
+	}
 
 	/*
 	 * Paranoia: we might have been primary, but sync target, or



More information about the drbd-cvs mailing list