[DRBD-cvs] svn commit by phil - r2537 - trunk/drbd - Dissalow open() on secondary devices. (Possible since w

drbd-cvs at lists.linbit.com drbd-cvs at lists.linbit.com
Mon Oct 16 22:07:04 CEST 2006


Author: phil
Date: 2006-10-16 22:07:02 +0200 (Mon, 16 Oct 2006)
New Revision: 2537

Modified:
   trunk/drbd/drbd_main.c
Log:
Dissalow open() on secondary devices. (Possible since we do the
configurations stuff via netlink)


Modified: trunk/drbd/drbd_main.c
===================================================================
--- trunk/drbd/drbd_main.c	2006-10-16 16:30:03 UTC (rev 2536)
+++ trunk/drbd/drbd_main.c	2006-10-16 20:07:02 UTC (rev 2537)
@@ -1870,6 +1870,9 @@
 	mdev = minor_to_mdev(MINOR(inode->i_rdev));
 	if(!mdev) return -ENODEV;
 
+	if( mdev->state.role == Secondary && !disable_bd_claim) {
+		return -ETXTBSY;
+	}
 	if (file->f_mode & FMODE_WRITE) {
 		if( mdev->state.role == Secondary) {
 			return -EROFS;



More information about the drbd-cvs mailing list