[DRBD-cvs] r1505 - trunk/drbd

svn at svn.drbd.org svn at svn.drbd.org
Thu Aug 26 13:31:19 CEST 2004


Author: phil
Date: 2004-08-26 13:31:17 +0200 (Thu, 26 Aug 2004)
New Revision: 1505

Modified:
   trunk/drbd/drbd_fs.c
Log:
Dissallow the user to make a primary node SyncTarget via IOCTLs


Modified: trunk/drbd/drbd_fs.c
===================================================================
--- trunk/drbd/drbd_fs.c	2004-08-26 11:23:02 UTC (rev 1504)
+++ trunk/drbd/drbd_fs.c	2004-08-26 11:31:17 UTC (rev 1505)
@@ -1152,7 +1152,8 @@
 		 * differentiate between different error cases,
 		 * or report the current connection state and flags back
 		 * to userspace */
-		if( mdev->cstate < StandAlone ||
+		if( mdev->state == Primary || 
+		    mdev->cstate < StandAlone ||
 		    mdev->cstate > Connected ||
 		    test_bit(DISKLESS,&mdev->flags) || 
 		    test_bit(PARTNER_DISKLESS,&mdev->flags) ) {
@@ -1191,7 +1192,8 @@
 		break;
 
 	case DRBD_IOCTL_INVALIDATE_REM:
-		if( mdev->cstate != Connected ||
+		if( mdev->o_state == Primary || 
+		    mdev->cstate != Connected ||
 		    test_bit(DISKLESS,&mdev->flags) || 
 		    test_bit(PARTNER_DISKLESS,&mdev->flags) ) {
 			err = -EINPROGRESS;



More information about the drbd-cvs mailing list