[Ocfs2-tools-devel] [PATCH 1/1] ocfs2-tools: add heartbeat=none for hard readonly mount
Tiger Yang
tiger.yang at oracle.com
Thu May 26 19:29:02 PDT 2011
There is no heartbeat on hard readonly mount, so add option
heartbeat=none for it.
Signed-off-by: Tiger Yang <tiger.yang at oracle.com>
---
mount.ocfs2/mount.ocfs2.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/mount.ocfs2/mount.ocfs2.c b/mount.ocfs2/mount.ocfs2.c
index 4925f20..455c7a4 100644
--- a/mount.ocfs2/mount.ocfs2.c
+++ b/mount.ocfs2/mount.ocfs2.c
@@ -99,20 +99,21 @@ static void read_options(int argc, char **argv, struct mount_options *mo)
}
/*
- * For local mounts, add heartbeat=none.
+ * For local mounts or hard readonly mount, add heartbeat=none.
* For userspace clusterstack, add cluster_stack=xxxx.
* For o2cb with local heartbeat, add heartbeat=local.
* For o2cb with global heartbeat, add heartbeat=global.
*/
static errcode_t add_mount_options(ocfs2_filesys *fs,
struct o2cb_cluster_desc *cluster,
- char **optstr)
+ char **optstr,
+ int dev_ro)
{
char *add, *extra = NULL;
char stackstr[strlen(OCFS2_CLUSTER_STACK_ARG) + OCFS2_STACK_LABEL_LEN + 1];
struct ocfs2_super_block *sb = OCFS2_RAW_SB(fs->fs_super);
- if (ocfs2_mount_local(fs)) {
+ if (ocfs2_mount_local(fs) || dev_ro) {
add = OCFS2_HB_NONE;
goto addit;
}
@@ -399,7 +400,7 @@ int main(int argc, char **argv)
}
}
- ret = add_mount_options(fs, &cluster, &mo.xtra_opts);
+ ret = add_mount_options(fs, &cluster, &mo.xtra_opts, dev_ro);
if (ret) {
com_err(progname, ret, "while adding mount options");
goto bail;
--
1.7.2.1
More information about the Ocfs2-tools-devel
mailing list