Hello community,

here is the log from the commit of package ocfs2-tools for openSUSE:Factory 
checked in at 2020-08-10 15:00:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ocfs2-tools (Old)
 and      /work/SRC/openSUSE:Factory/.ocfs2-tools.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ocfs2-tools"

Mon Aug 10 15:00:30 2020 rev:77 rq:825208 version:1.8.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/ocfs2-tools/ocfs2-tools.changes  2020-05-07 
14:57:07.638577657 +0200
+++ /work/SRC/openSUSE:Factory/.ocfs2-tools.new.3399/ocfs2-tools.changes        
2020-08-10 15:01:55.848125067 +0200
@@ -1,0 +2,6 @@
+Mon Aug 10 10:50:30 UTC 2020 - [email protected]
+
+- Add nocluster mount option support (bsc#1174943)
+  + mount.ocfs2-add-nocluster-mount-option-support.patch
+
+-------------------------------------------------------------------

New:
----
  mount.ocfs2-add-nocluster-mount-option-support.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ocfs2-tools.spec ++++++
--- /var/tmp/diff_new_pack.Qu92Pc/_old  2020-08-10 15:01:57.940126171 +0200
+++ /var/tmp/diff_new_pack.Qu92Pc/_new  2020-08-10 15:01:57.944126174 +0200
@@ -61,6 +61,7 @@
 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 @@
 %patch503 -p1
 %patch504 -p1
 %patch505 -p1
+%patch506 -p1
 
 %build
 %global _lto_cflags %{_lto_cflags} -ffat-lto-objects

++++++ mount.ocfs2-add-nocluster-mount-option-support.patch ++++++
>From 9b661d197aa634229919364d6cc07e58ed4cc01f Mon Sep 17 00:00:00 2001
From: Gang He <[email protected]>
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


Reply via email to