[Ocfs2-commits] mfasheh commits r3056 - branches/ocfs2-1.2/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Aug 27 15:08:21 PDT 2007


Author: mfasheh
Date: 2007-08-27 15:08:19 -0700 (Mon, 27 Aug 2007)
New Revision: 3056

Modified:
   branches/ocfs2-1.2/fs/ocfs2/aops.c
   branches/ocfs2-1.2/fs/ocfs2/dlmglue.c
   branches/ocfs2-1.2/fs/ocfs2/heartbeat.c
   branches/ocfs2-1.2/fs/ocfs2/journal.c
   branches/ocfs2-1.2/fs/ocfs2/journal.h
   branches/ocfs2-1.2/fs/ocfs2/mmap.c
   branches/ocfs2-1.2/fs/ocfs2/namei.c
   branches/ocfs2-1.2/fs/ocfs2/ocfs2.h
   branches/ocfs2-1.2/fs/ocfs2/ocfs2_fs.h
   branches/ocfs2-1.2/fs/ocfs2/super.c
   branches/ocfs2-1.2/fs/ocfs2/vote.c
Log:
ocfs2: Backport mount local feature to 1.2 branch

The mainline version of this is pretty well tested, and a backport is
relatively straightforward as the changes are generally confined to cluster
code which hasn't changed as much as the rest of the file system.

Signed-off-by: smushran



Modified: branches/ocfs2-1.2/fs/ocfs2/aops.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/aops.c	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/aops.c	2007-08-27 22:08:19 UTC (rev 3056)
@@ -238,12 +238,14 @@
 		unsigned from, unsigned to)
 {
 	struct inode *inode = page->mapping->host;
+	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 	int ret;
 
 	mlog_entry("(0x%p, 0x%p, %u, %u)\n", file, page, from, to);
 
 	/* we can't bring in pages without holding the data lock */
-	mlog_bug_on_msg(OCFS2_I(inode)->ip_data_lockres.l_ex_holders == 0,
+	mlog_bug_on_msg(!ocfs2_mount_local(osb) &&
+			OCFS2_I(inode)->ip_data_lockres.l_ex_holders == 0,
 			"inode %llu holders %u\n",
 			(unsigned long long)OCFS2_I(inode)->ip_blkno,
 			OCFS2_I(inode)->ip_data_lockres.l_ex_holders);

Modified: branches/ocfs2-1.2/fs/ocfs2/dlmglue.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlmglue.c	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/dlmglue.c	2007-08-27 22:08:19 UTC (rev 3056)
@@ -1135,6 +1135,7 @@
 {
 	int status = 0, level;
 	struct ocfs2_lock_res *lockres;
+	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
 	BUG_ON(!inode);
 
@@ -1154,6 +1155,9 @@
 		goto out;
 	}
 
+	if (ocfs2_mount_local(osb))
+		goto out;
+
 	lockres = &OCFS2_I(inode)->ip_data_lockres;
 
 	level = write ? LKM_EXMODE : LKM_PRMODE;
@@ -1204,6 +1208,7 @@
 {
 	int level = write ? LKM_EXMODE : LKM_PRMODE;
 	struct ocfs2_lock_res *lockres = &OCFS2_I(inode)->ip_data_lockres;
+	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
 	mlog_entry_void();
 
@@ -1211,7 +1216,7 @@
 	     OCFS2_I(inode)->ip_blkno,
 	     write ? "EXMODE" : "PRMODE");
 
-	if (!ocfs2_is_hard_readonly(OCFS2_SB(inode->i_sb)))
+	if (!ocfs2_is_hard_readonly(osb) && !ocfs2_mount_local(osb))
 		ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level);
 
 	mlog_exit_void();
@@ -1396,9 +1401,13 @@
 	struct ocfs2_inode_info *oi = OCFS2_I(inode);
 	struct ocfs2_lock_res *lockres;
 	struct ocfs2_dinode *fe;
+	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
 	mlog_entry_void();
 
+	if (ocfs2_mount_local(osb))
+		goto bail;
+
 	spin_lock(&oi->ip_lock);
 	if (oi->ip_flags & OCFS2_INODE_DELETED) {
 		mlog(0, "Orphaned inode %"MLFu64" was deleted while we "
@@ -1529,7 +1538,7 @@
 			 unsigned long cb_data)
 {
 	int status, level, dlm_flags, acquired;
-	struct ocfs2_lock_res *lockres;
+	struct ocfs2_lock_res *lockres = NULL;
 	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 	struct buffer_head *local_bh = NULL;
 
@@ -1551,11 +1560,13 @@
 		goto bail;
 	}
 
+	if (ocfs2_mount_local(osb))
+		goto local;
+
 	if (!(flags & OCFS2_META_LOCK_RECOVERY))
 		wait_event(osb->recovery_event,
 			   ocfs2_node_map_is_empty(osb, &osb->recovery_map));
 
-	acquired = 0;
 	lockres = &OCFS2_I(inode)->ip_meta_lockres;
 	level = ex ? LKM_EXMODE : LKM_PRMODE;
 	dlm_flags = 0;
@@ -1581,6 +1592,7 @@
 		wait_event(osb->recovery_event,
 			   ocfs2_node_map_is_empty(osb, &osb->recovery_map));
 
+local:
 	/* This is fun. The caller may want a bh back, or it may
 	 * not. ocfs2_meta_lock_update definitely wants one in, but
 	 * may or may not read one, depending on what's in the
@@ -1629,6 +1641,7 @@
 {
 	int level = ex ? LKM_EXMODE : LKM_PRMODE;
 	struct ocfs2_lock_res *lockres = &OCFS2_I(inode)->ip_meta_lockres;
+	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
 	mlog_entry_void();
 
@@ -1636,7 +1649,7 @@
 	     OCFS2_I(inode)->ip_blkno,
 	     ex ? "EXMODE" : "PRMODE");
 
-	if (!ocfs2_is_hard_readonly(OCFS2_SB(inode->i_sb)))
+	if (!ocfs2_is_hard_readonly(osb) && !ocfs2_mount_local(osb))
 		ocfs2_cluster_unlock(OCFS2_SB(inode->i_sb), lockres, level);
 
 	mlog_exit_void();
@@ -1656,6 +1669,9 @@
 	if (ocfs2_is_hard_readonly(osb))
 		return -EROFS;
 
+	if (ocfs2_mount_local(osb))
+		return 0;
+
 	status = ocfs2_cluster_lock(osb, lockres, level, 0, NULL, 0);
 	if (status < 0) {
 		mlog_errno(status);
@@ -1694,7 +1710,8 @@
 	int level = ex ? LKM_EXMODE : LKM_PRMODE;
 	struct ocfs2_lock_res *lockres = &osb->osb_super_lockres;
 
-	ocfs2_cluster_unlock(osb, lockres, level);
+	if (!ocfs2_mount_local(osb))
+		ocfs2_cluster_unlock(osb, lockres, level);
 }
 
 int ocfs2_rename_lock(struct ocfs2_super *osb)
@@ -1705,6 +1722,9 @@
 	if (ocfs2_is_hard_readonly(osb))
 		return -EROFS;
 
+	if (ocfs2_mount_local(osb))
+		return 0;
+
 	status = ocfs2_cluster_lock(osb, lockres, LKM_EXMODE, 0, NULL, 0);
 	if (status < 0)
 		mlog_errno(status);
@@ -1716,7 +1736,8 @@
 {
 	struct ocfs2_lock_res *lockres = &osb->osb_rename_lockres;
 
-	ocfs2_cluster_unlock(osb, lockres, LKM_EXMODE);
+	if (!ocfs2_mount_local(osb))
+		ocfs2_cluster_unlock(osb, lockres, LKM_EXMODE);
 }
 
 /* Reference counting of the dlm debug structure. We want this because
@@ -1980,10 +2001,13 @@
 {
 	int status;
 	u32 dlm_key;
-	struct dlm_ctxt *dlm;
+	struct dlm_ctxt *dlm = NULL;
 
 	mlog_entry_void();
 
+	if (ocfs2_mount_local(osb))
+		goto local;
+
 	status = ocfs2_dlm_init_debug(osb);
 	if (status < 0) {
 		mlog_errno(status);
@@ -2012,11 +2036,12 @@
 		goto bail;
 	}
 
+	dlm_register_eviction_cb(dlm, &osb->osb_eviction_cb);
+
+local:
 	ocfs2_super_lock_res_init(&osb->osb_super_lockres, osb);
 	ocfs2_rename_lock_res_init(&osb->osb_rename_lockres, osb);
 
-	dlm_register_eviction_cb(dlm, &osb->osb_eviction_cb);
-
 	osb->dlm = dlm;
 
 	status = 0;

Modified: branches/ocfs2-1.2/fs/ocfs2/heartbeat.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/heartbeat.c	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/heartbeat.c	2007-08-27 22:08:19 UTC (rev 3056)
@@ -154,6 +154,9 @@
 {
 	int status;
 
+	if (ocfs2_mount_local(osb))
+		return 0;
+
 	status = o2hb_register_callback(&osb->osb_hb_down);
 	if (status < 0) {
 		mlog_errno(status);
@@ -172,6 +175,9 @@
 {
 	int status;
 
+	if (ocfs2_mount_local(osb))
+		return;
+
 	status = o2hb_unregister_callback(&osb->osb_hb_down);
 	if (status < 0)
 		mlog_errno(status);
@@ -186,6 +192,9 @@
 	int ret;
 	char *argv[5], *envp[3];
 
+	if (ocfs2_mount_local(osb))
+		return;
+
 	if (!osb->uuid_str) {
 		/* This can happen if we don't get far enough in mount... */
 		mlog(0, "No UUID with which to stop heartbeat!\n\n");

Modified: branches/ocfs2-1.2/fs/ocfs2/journal.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/journal.c	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/journal.c	2007-08-27 22:08:19 UTC (rev 3056)
@@ -193,7 +193,8 @@
 		goto done_free;
 	}
 
-	atomic_inc(&(osb->journal->j_num_trans));
+	if (!ocfs2_mount_local(osb))
+		atomic_inc(&(osb->journal->j_num_trans));
 	handle->flags |= OCFS2_HANDLE_STARTED;
 
 	mlog_exit_ptr(handle);
@@ -697,10 +698,24 @@
 
 	BUG_ON(atomic_read(&(osb->journal->j_num_trans)) != 0);
 
-	status = ocfs2_journal_toggle_dirty(osb, 0);
-	if (status < 0)
-		mlog_errno(status);
+	if (ocfs2_mount_local(osb)) {
+		journal_lock_updates(journal->j_journal);
+		status = journal_flush(journal->j_journal);
+		journal_unlock_updates(journal->j_journal);
+		if (status < 0)
+			mlog_errno(status);
+	}
 
+	if (status == 0) {
+		/*
+		 * Do not toggle if flush was unsuccessful otherwise
+		 * will leave dirty metadata in a "clean" journal
+		 */
+		status = ocfs2_journal_toggle_dirty(osb, 0);
+		if (status < 0)
+			mlog_errno(status);
+	}
+
 	/* Shutdown the kernel journal system */
 	journal_destroy(journal->j_journal);
 
@@ -739,7 +754,7 @@
 	}
 }
 
-int ocfs2_journal_load(struct ocfs2_journal *journal)
+int ocfs2_journal_load(struct ocfs2_journal *journal, int local)
 {
 	int status = 0;
 	struct ocfs2_super *osb;
@@ -766,15 +781,18 @@
 	}
 
 	/* Launch the commit thread */
-	osb->commit_task = kthread_run(ocfs2_commit_thread, osb, "ocfs2cmt-%d",
-				       osb->osb_id);
-	if (IS_ERR(osb->commit_task)) {
-		status = PTR_ERR(osb->commit_task);
+	if (!local) {
+		osb->commit_task = kthread_run(ocfs2_commit_thread, osb,
+					       "ocfs2cmt-%d", osb->osb_id);
+		if (IS_ERR(osb->commit_task)) {
+			status = PTR_ERR(osb->commit_task);
+			osb->commit_task = NULL;
+			mlog(ML_ERROR, "unable to launch ocfs2commit thread, "
+			     "error=%d", status);
+			goto done;
+		}
+	} else
 		osb->commit_task = NULL;
-		mlog(ML_ERROR, "unable to launch ocfs2commit thread, error=%d",
-		     status);
-		goto done;
-	}
 
 done:
 	mlog_exit(status);

Modified: branches/ocfs2-1.2/fs/ocfs2/journal.h
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/journal.h	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/journal.h	2007-08-27 22:08:19 UTC (rev 3056)
@@ -196,7 +196,7 @@
 void   ocfs2_journal_shutdown(struct ocfs2_super *osb);
 int    ocfs2_journal_wipe(struct ocfs2_journal *journal,
 			  int full);
-int    ocfs2_journal_load(struct ocfs2_journal *journal);
+int    ocfs2_journal_load(struct ocfs2_journal *journal, int local);
 int    ocfs2_check_journals_nolocks(struct ocfs2_super *osb);
 void   ocfs2_recovery_thread(struct ocfs2_super *osb,
 			     int node_num);
@@ -213,6 +213,9 @@
 {
 	struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
 
+	if (ocfs2_mount_local(osb))
+		return;
+
 	if (!ocfs2_inode_fully_checkpointed(inode)) {
 		/* WARNING: This only kicks off a single
 		 * checkpoint. If someone races you and adds more

Modified: branches/ocfs2-1.2/fs/ocfs2/mmap.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/mmap.c	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/mmap.c	2007-08-27 22:08:19 UTC (rev 3056)
@@ -152,8 +152,11 @@
 int ocfs2_mmap(struct file *file,
 	       struct vm_area_struct *vma)
 {
+	struct ocfs2_super *osb = OCFS2_SB(file->f_dentry->d_inode->i_sb);
+
 	/* We don't want to support shared writable mappings yet. */
-	if (((vma->vm_flags & VM_SHARED) || (vma->vm_flags & VM_MAYSHARE))
+	if (!ocfs2_mount_local(osb) &&
+	    ((vma->vm_flags & VM_SHARED) || (vma->vm_flags & VM_MAYSHARE))
 	    && ((vma->vm_flags & VM_WRITE) || (vma->vm_flags & VM_MAYWRITE))) {
 		mlog(0, "disallow shared writable mmaps %lx\n", vma->vm_flags);
 		/* This is -EINVAL because generic_file_readonly_mmap

Modified: branches/ocfs2-1.2/fs/ocfs2/namei.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/namei.c	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/namei.c	2007-08-27 22:08:19 UTC (rev 3056)
@@ -570,9 +570,11 @@
 	}
 
 	ocfs2_inode_set_new(osb, inode);
-	status = ocfs2_create_new_inode_locks(inode);
-	if (status < 0)
-		mlog_errno(status);
+	if (!ocfs2_mount_local(osb)) {
+		status = ocfs2_create_new_inode_locks(inode);
+		if (status < 0)
+			mlog_errno(status);
+	}
 
 	status = 0; /* error in ocfs2_create_new_inode_locks is not
 		     * critical */

Modified: branches/ocfs2-1.2/fs/ocfs2/ocfs2.h
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/ocfs2.h	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/ocfs2.h	2007-08-27 22:08:19 UTC (rev 3056)
@@ -360,6 +360,11 @@
 	return ret;
 }
 
+static inline int ocfs2_mount_local(struct ocfs2_super *osb)
+{
+	return (osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT);
+}
+
 #define OCFS2_IS_VALID_DINODE(ptr)					\
 	(!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE))
 

Modified: branches/ocfs2-1.2/fs/ocfs2/ocfs2_fs.h
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/ocfs2_fs.h	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/ocfs2_fs.h	2007-08-27 22:08:19 UTC (rev 3056)
@@ -86,7 +86,7 @@
 	OCFS2_SB(sb)->s_feature_incompat &= ~(mask)
 
 #define OCFS2_FEATURE_COMPAT_SUPP	0
-#define OCFS2_FEATURE_INCOMPAT_SUPP	0
+#define OCFS2_FEATURE_INCOMPAT_SUPP	OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT
 #define OCFS2_FEATURE_RO_COMPAT_SUPP	0
 
 /*
@@ -96,6 +96,10 @@
  */
 #define OCFS2_FEATURE_INCOMPAT_HEARTBEAT_DEV	0x0002
 
+
+/* Used to denote a non-clustered volume */
+#define OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT	0x0008
+
 /*
  * tunefs sets this incompat flag before starting the resize and clears it
  * at the end. This flag protects users from inadvertently mounting the fs

Modified: branches/ocfs2-1.2/fs/ocfs2/super.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/super.c	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/super.c	2007-08-27 22:08:19 UTC (rev 3056)
@@ -517,6 +517,27 @@
 	return status;
 }
 
+static int ocfs2_verify_heartbeat(struct ocfs2_super *osb)
+{
+	if (ocfs2_mount_local(osb)) {
+		if (osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL) {
+			mlog(ML_ERROR, "Cannot heartbeat on a locally "
+			     "mounted device.\n");
+			return -EINVAL;
+		}
+	}
+
+	if (!(osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL)) {
+		if (!ocfs2_mount_local(osb) && !ocfs2_is_hard_readonly(osb)) {
+			mlog(ML_ERROR, "Heartbeat has to be started to mount "
+			     "a read-write clustered device.\n");
+			return -EINVAL;
+		}
+	}
+
+	return 0;
+}
+
 static int ocfs2_fill_super(struct super_block *sb, void *data, int silent)
 {
 	struct dentry *root;
@@ -526,16 +547,24 @@
 	struct inode *inode = NULL;
 	struct ocfs2_super *osb = NULL;
 	struct buffer_head *bh = NULL;
+	char nodestr[8];
 
 	mlog_entry("%p, %p, %i", sb, data, silent);
 
-	/* for now we only have one cluster/node, make sure we see it
-	 * in the heartbeat universe */
-	if (!o2hb_check_local_node_heartbeating()) {
+	if (!ocfs2_parse_options(sb, data, &parsed_opt, &slot, 0)) {
 		status = -EINVAL;
 		goto read_super_error;
 	}
 
+	/* for now we only have one cluster/node, make sure we see it
+	 * in the heartbeat universe */
+	if (parsed_opt & OCFS2_MOUNT_HB_LOCAL) {
+		if (!o2hb_check_local_node_heartbeating()) {
+			status = -EINVAL;
+			goto read_super_error;
+		}
+	}
+
 	/* probe for superblock */
 	status = ocfs2_sb_probe(sb, &bh, &sector_size);
 	if (status < 0) {
@@ -552,10 +581,6 @@
 	brelse(bh);
 	bh = NULL;
 
-	if (!ocfs2_parse_options(sb, data, &parsed_opt, &slot, 0)) {
-		status = -EINVAL;
-		goto read_super_error;
-	}
 	osb->s_mount_opt = parsed_opt;
 	osb->preferred_slot = slot;
 
@@ -604,21 +629,16 @@
 	}
 
 	if (!ocfs2_is_hard_readonly(osb)) {
-		/* If this isn't a hard readonly mount, then we need
-		 * to make sure that heartbeat is in a valid state,
-		 * and that we mark ourselves soft readonly is -oro
-		 * was specified. */
-		if (!(osb->s_mount_opt & OCFS2_MOUNT_HB_LOCAL)) {
-			mlog(ML_ERROR, "No heartbeat for device (%s)\n",
-			     sb->s_id);
-			status = -EINVAL;
-			goto read_super_error;
-		}
-
 		if (sb->s_flags & MS_RDONLY)
 			ocfs2_set_ro_flag(osb, 0);
 	}
 
+	status = ocfs2_verify_heartbeat(osb);
+	if (status < 0) {
+		mlog_errno(status);
+		goto read_super_error;
+	}
+
 	osb->osb_debug_root = debugfs_create_dir(osb->uuid_str,
 						 ocfs2_debugfs_root);
 	if (!osb->osb_debug_root) {
@@ -651,9 +671,14 @@
 
 	ocfs2_complete_mount_recovery(osb);
 
-	printk(KERN_INFO "ocfs2: Mounting device (%s) on (node %d, slot %d)\n",
-	       osb->dev_str, osb->node_num, osb->slot_num);
+	if (ocfs2_mount_local(osb))
+		snprintf(nodestr, sizeof(nodestr), "local");
+	else
+		snprintf(nodestr, sizeof(nodestr), "%d", osb->node_num);
 
+	printk(KERN_INFO "ocfs2: Mounting device (%s) on (node %s, slot %d)\n",
+	       osb->dev_str, nodestr, osb->slot_num);
+
 	atomic_set(&osb->vol_state, VOLUME_MOUNTED);
 	wake_up(&osb->osb_mount_event);
 
@@ -1062,7 +1087,11 @@
 
 	/* XXX hold a ref on the node while mounte?  easy enough, if
 	 * desirable. */
-	osb->node_num = o2nm_this_node();
+	if (ocfs2_mount_local(osb))
+		osb->node_num = 0;
+	else
+		osb->node_num = o2nm_this_node();
+
 	if (osb->node_num == O2NM_MAX_NODES) {
 		mlog(ML_ERROR, "could not find this host's node number\n");
 		status = -ENOENT;
@@ -1147,6 +1176,9 @@
 		goto leave;
 	}
 
+	if (ocfs2_mount_local(osb))
+		goto out_add_proc;
+
 	/* This should be sent *after* we recovered our journal as it
 	 * will cause other nodes to unmark us as needing
 	 * recovery. However, we need to send it *before* dropping the
@@ -1181,6 +1213,7 @@
 {
 	int tmp;
 	struct ocfs2_super *osb = NULL;
+	char nodestr[8];
 
 	mlog_entry("(0x%p)\n", sb);
 
@@ -1249,9 +1282,14 @@
 
 	atomic_set(&osb->vol_state, VOLUME_DISMOUNTED);
 
-	printk(KERN_INFO "ocfs2: Unmounting device (%s) on (node %d)\n",
-	       osb->dev_str, osb->node_num);
+	if (ocfs2_mount_local(osb))
+		snprintf(nodestr, sizeof(nodestr), "local");
+	else
+		snprintf(nodestr, sizeof(nodestr), "%d", osb->node_num);
 
+	printk(KERN_INFO "ocfs2: Unmounting device (%s) on (node %s)\n",
+	       osb->dev_str, nodestr);
+
 	ocfs2_delete_osb(osb);
 	kfree(osb);
 	sb->s_dev = 0;
@@ -1631,7 +1669,7 @@
 static int ocfs2_check_volume(struct ocfs2_super *osb)
 {
 	int status = 0;
-	int dirty;
+	int dirty, local;
 	struct ocfs2_dinode *local_alloc = NULL; /* only used if we
 						  * recover
 						  * ourselves. */
@@ -1659,8 +1697,10 @@
 		     "recovering volume.\n");
 	}
 
+	local = ocfs2_mount_local(osb);
+
 	/* will play back anything left in the journal. */
-	ocfs2_journal_load(osb->journal);
+	ocfs2_journal_load(osb->journal, local);
 
 	if (dirty) {
 		/* recover my local alloc if we didn't unmount cleanly. */

Modified: branches/ocfs2-1.2/fs/ocfs2/vote.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/vote.c	2007-08-27 22:07:16 UTC (rev 3055)
+++ branches/ocfs2-1.2/fs/ocfs2/vote.c	2007-08-27 22:08:19 UTC (rev 3056)
@@ -1196,6 +1196,9 @@
 {
 	int status = 0;
 
+	if (ocfs2_mount_local(osb))
+		return 0;
+
 	status = o2net_register_handler(OCFS2_MESSAGE_TYPE_RESPONSE,
 					osb->net_key,
 					sizeof(struct ocfs2_response_msg),




More information about the Ocfs2-commits mailing list