forked from pool/ocfs2-tools
Accepting request 825208 from network:ha-clustering:Factory
OBS-URL: https://build.opensuse.org/request/show/825208 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/ocfs2-tools?expand=0&rev=77
This commit is contained in:
commit
10395a0e64
106
mount.ocfs2-add-nocluster-mount-option-support.patch
Normal file
106
mount.ocfs2-add-nocluster-mount-option-support.patch
Normal file
@ -0,0 +1,106 @@
|
||||
From 9b661d197aa634229919364d6cc07e58ed4cc01f Mon Sep 17 00:00:00 2001
|
||||
From: Gang He <ghe@suse.com>
|
||||
Date: Mon, 27 Jul 2020 19:32:26 +0800
|
||||
Subject: [PATCH] mount.ocfs2: add nocluster mount option support
|
||||
|
||||
Now, ocfs2 kernel modules have accepted nocluster mount option, to
|
||||
support mounting a shared volume without the cluster stack.
|
||||
For mount.ocfs2 tool, we need to add the corresponding support, e.g.
|
||||
add the prompt message, option description in man page.
|
||||
---
|
||||
mount.ocfs2/mount.ocfs2.8.in | 6 ++++++
|
||||
mount.ocfs2/mount.ocfs2.c | 17 +++++++++++++++--
|
||||
mount.ocfs2/opts.c | 5 +++++
|
||||
mount.ocfs2/sundries.h | 1 +
|
||||
4 files changed, 27 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/mount.ocfs2/mount.ocfs2.8.in b/mount.ocfs2/mount.ocfs2.8.in
|
||||
index 053244d6..a36bdc8c 100644
|
||||
--- a/mount.ocfs2/mount.ocfs2.8.in
|
||||
+++ b/mount.ocfs2/mount.ocfs2.8.in
|
||||
@@ -126,6 +126,12 @@ will have no effect. This mount option works with Linux kernel \fB2.6.35\fR and
|
||||
Indicates that the file system can create inodes at any location in the volume, including
|
||||
those which will result in inode numbers greater than 4 billion.
|
||||
|
||||
+.TP
|
||||
+\fBnocluster\fR
|
||||
+This option allows users to mount a clustered volume without configuring the cluster stack.
|
||||
+However, you must be aware that you can only mount the file system from one node at the
|
||||
+same time, otherwise, the file system may be damaged. Please use it with caution.
|
||||
+
|
||||
.TP
|
||||
\fB[no]intr\fR
|
||||
Specifies whether a signal can interrupt IOs. It is disabled by default.
|
||||
diff --git a/mount.ocfs2/mount.ocfs2.c b/mount.ocfs2/mount.ocfs2.c
|
||||
index 5481ae9a..27049996 100644
|
||||
--- a/mount.ocfs2/mount.ocfs2.c
|
||||
+++ b/mount.ocfs2/mount.ocfs2.c
|
||||
@@ -28,6 +28,7 @@
|
||||
|
||||
int verbose = 0;
|
||||
int mount_quiet = 0;
|
||||
+int nocluster_opt = 0;
|
||||
char *progname = NULL;
|
||||
|
||||
static int nomtab = 0;
|
||||
@@ -112,7 +113,7 @@ static errcode_t add_mount_options(ocfs2_filesys *fs,
|
||||
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) || ocfs2_is_hard_readonly(fs)) {
|
||||
+ if (ocfs2_mount_local(fs) || nocluster_opt || ocfs2_is_hard_readonly(fs)) {
|
||||
add = OCFS2_HB_NONE;
|
||||
goto addit;
|
||||
}
|
||||
@@ -345,7 +346,19 @@ int main(int argc, char **argv)
|
||||
goto bail;
|
||||
}
|
||||
|
||||
- clustered = (0 == ocfs2_mount_local(fs));
|
||||
+ clustered = ((0 == ocfs2_mount_local(fs)) && (0 == nocluster_opt));
|
||||
+
|
||||
+ if ((0 == ocfs2_mount_local(fs)) && nocluster_opt) {
|
||||
+ fprintf(stdout, "Warning: to mount a clustered volume without the cluster stack.\n"
|
||||
+ "Please make sure you only mount the file system from one node.\n"
|
||||
+ "Otherwise, the file system may be damaged.\n"
|
||||
+ "Proceed (y/N): ");
|
||||
+ if (toupper(getchar()) != 'Y') {
|
||||
+ printf("Aborting operation.\n");
|
||||
+ ret = 1;
|
||||
+ goto bail;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if (ocfs2_is_hard_readonly(fs) && (clustered ||
|
||||
!(mo.flags & MS_RDONLY))) {
|
||||
diff --git a/mount.ocfs2/opts.c b/mount.ocfs2/opts.c
|
||||
index ae8129a4..cd03390c 100644
|
||||
--- a/mount.ocfs2/opts.c
|
||||
+++ b/mount.ocfs2/opts.c
|
||||
@@ -120,6 +120,11 @@ static int parse_string_opt(char *s)
|
||||
struct string_opt_map *m;
|
||||
int lth;
|
||||
|
||||
+ if (!strncmp(s, "nocluster", 9)) {
|
||||
+ nocluster_opt = 1;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
for (m = &string_opt_map[0]; m->tag; m++) {
|
||||
lth = strlen(m->tag);
|
||||
if (!strncmp(s, m->tag, lth)) {
|
||||
diff --git a/mount.ocfs2/sundries.h b/mount.ocfs2/sundries.h
|
||||
index af0df4e2..52b1267d 100644
|
||||
--- a/mount.ocfs2/sundries.h
|
||||
+++ b/mount.ocfs2/sundries.h
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <rpc/types.h>
|
||||
#endif
|
||||
|
||||
+extern int nocluster_opt;
|
||||
extern int mount_quiet;
|
||||
extern int verbose;
|
||||
extern int sloppy;
|
||||
--
|
||||
2.21.0
|
||||
|
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Aug 10 10:50:30 UTC 2020 - ghe@suse.com
|
||||
|
||||
- Add nocluster mount option support (bsc#1174943)
|
||||
+ mount.ocfs2-add-nocluster-mount-option-support.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 6 11:30:20 UTC 2020 - ghe@suse.com
|
||||
|
||||
|
@ -61,6 +61,7 @@ Patch502: fsck.ocfs2-fix-compile-error-when-glibc-upgrade.patch
|
||||
Patch503: mounted.ocfs2-use-sys-sysmacros.h-include-for-makede.patch
|
||||
Patch504: fix-build-failure-with-glibc-2.28.patch
|
||||
Patch505: debugfs.ocfs2-Fix-the-error-on-devices-with-sector-s.patch
|
||||
Patch506: mount.ocfs2-add-nocluster-mount-option-support.patch
|
||||
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: e2fsprogs-devel
|
||||
@ -174,6 +175,7 @@ OCFS2 filesystem.
|
||||
%patch503 -p1
|
||||
%patch504 -p1
|
||||
%patch505 -p1
|
||||
%patch506 -p1
|
||||
|
||||
%build
|
||||
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
|
||||
|
Loading…
Reference in New Issue
Block a user