forked from pool/ocfs2-tools
Accepting request 298768 from home:ganghe:branches:network:ha-clustering:Factory
- Update ocfs2-tools.tar.bz2 to upstream v1.8.3 - Drop patches (merged upstream): - fix-indexed-dirs.patch - 0001-fswreck-Create-a-loop-in-group-chains.patch - 0002-Break-a-chain-loop-in-group-desc.patch - restore-g_list_append.patch - ocfs2console-libraries-include-aio.patch - libocfs2-needs-libaio.patch - libocfs2-Change-asserts-to-error.patch - Drop patches for ocfs2_controld - force-debug.patch - extra-debug.patch - bug-805764-ocfs2-controld.patch - bnc804707-reduce-RR-priority.patch - use-symlink-in-udev-rules.patch OBS-URL: https://build.opensuse.org/request/show/298768 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/ocfs2-tools?expand=0&rev=80
This commit is contained in:
parent
f5ba048002
commit
46561a2b65
@ -1,68 +0,0 @@
|
||||
From 57a0a528f35d2b540d4ed533b6274586056664ce Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.de>
|
||||
Date: Thu, 20 Sep 2012 19:39:17 -0500
|
||||
Subject: [PATCH 1/2] fswreck: Create a loop in group chains
|
||||
|
||||
---
|
||||
fswreck/corrupt.c | 3 +++
|
||||
fswreck/group.c | 6 ++++++
|
||||
fswreck/include/fsck_type.h | 1 +
|
||||
fswreck/main.c | 2 ++
|
||||
4 files changed, 12 insertions(+)
|
||||
|
||||
Index: ocfs2-tools/fswreck/corrupt.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/fswreck/corrupt.c 2012-08-24 10:02:19.000000000 -0500
|
||||
+++ ocfs2-tools/fswreck/corrupt.c 2012-09-25 11:12:35.000000000 -0500
|
||||
@@ -331,6 +331,9 @@ void corrupt_group_desc(ocfs2_filesys *f
|
||||
case GROUP_FREE_BITS:
|
||||
func = mess_up_group_minor;
|
||||
break;
|
||||
+ case GROUP_CHAIN_LOOP:
|
||||
+ func = mess_up_group_minor;
|
||||
+ break;
|
||||
case GROUP_GEN:
|
||||
func = mess_up_group_gen;
|
||||
break;
|
||||
Index: ocfs2-tools/fswreck/group.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/fswreck/group.c 2012-08-24 10:02:19.000000000 -0500
|
||||
+++ ocfs2-tools/fswreck/group.c 2012-09-25 11:12:35.000000000 -0500
|
||||
@@ -176,6 +176,12 @@ static void damage_group_desc(ocfs2_file
|
||||
bg->bg_chain, (bg->bg_chain + 10));
|
||||
bg->bg_chain += 10;
|
||||
break;
|
||||
+ case GROUP_CHAIN_LOOP:
|
||||
+ fprintf(stdout, "Corrput GROUP_LOOP: "
|
||||
+ "change group next from %"PRIu64" to %"PRIu64"\n",
|
||||
+ bg->bg_next_group, cr->c_blkno);
|
||||
+ bg->bg_next_group = cpu_to_le64(cr->c_blkno);
|
||||
+ break;
|
||||
case GROUP_FREE_BITS:
|
||||
fprintf(stdout, "Corrput GROUP_FREE_BITS: "
|
||||
"change group free bits from %u to %u\n",
|
||||
Index: ocfs2-tools/fswreck/include/fsck_type.h
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/fswreck/include/fsck_type.h 2012-08-24 10:02:19.000000000 -0500
|
||||
+++ ocfs2-tools/fswreck/include/fsck_type.h 2012-09-25 11:12:35.000000000 -0500
|
||||
@@ -57,6 +57,7 @@ enum fsck_type
|
||||
GROUP_BLKNO,
|
||||
GROUP_CHAIN,
|
||||
GROUP_FREE_BITS,
|
||||
+ GROUP_CHAIN_LOOP,
|
||||
CHAIN_COUNT,
|
||||
CHAIN_NEXT_FREE,
|
||||
CHAIN_EMPTY,
|
||||
Index: ocfs2-tools/fswreck/main.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/fswreck/main.c 2012-08-24 10:02:19.000000000 -0500
|
||||
+++ ocfs2-tools/fswreck/main.c 2012-09-25 11:12:35.000000000 -0500
|
||||
@@ -102,6 +102,8 @@ static struct prompt_code prompt_codes[N
|
||||
"Corrupt chain group's blkno"),
|
||||
define_prompt_code(GROUP_CHAIN, corrupt_group_desc, "", 1,
|
||||
"Corrupt chain group's chain where it was in"),
|
||||
+ define_prompt_code(GROUP_CHAIN_LOOP, corrupt_group_desc, "", 1,
|
||||
+ "Corrupt group's chain to form a loop"),
|
||||
define_prompt_code(GROUP_FREE_BITS, corrupt_group_desc, "", 1,
|
||||
"Corrupt chain group's free bits"),
|
||||
define_prompt_code(CHAIN_COUNT, corrupt_sys_file, "", 1,
|
@ -1,156 +0,0 @@
|
||||
From 16f191550058a768935cab2fe575c48e64eba334 Mon Sep 17 00:00:00 2001
|
||||
From: Goldwyn Rodrigues <rgoldwyn@suse.de>
|
||||
Date: Thu, 20 Sep 2012 20:12:14 -0500
|
||||
Subject: [PATCH 2/2] Break a chain loop in group desc
|
||||
|
||||
This patch detects and a loop by checking hops against the theoretical
|
||||
limit of number of chains in a chain_rec. If a loop is found, it breaks
|
||||
it by storing the block numbers and comparing with exiting block
|
||||
numbers.
|
||||
---
|
||||
fsck.ocfs2/fsck.ocfs2.checks.8.in | 9 ++++++
|
||||
fsck.ocfs2/pass0.c | 61 ++++++++++++++++++++++++++++++++++---
|
||||
include/ocfs2-kernel/ocfs2_fs.h | 2 +-
|
||||
3 files changed, 67 insertions(+), 5 deletions(-)
|
||||
|
||||
Index: ocfs2-tools/fsck.ocfs2/fsck.ocfs2.checks.8.in
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/fsck.ocfs2/fsck.ocfs2.checks.8.in 2012-09-25 11:12:57.000000000 -0500
|
||||
+++ ocfs2-tools/fsck.ocfs2/fsck.ocfs2.checks.8.in 2012-09-25 11:13:03.000000000 -0500
|
||||
@@ -202,6 +202,15 @@ valid in its bitmap.
|
||||
Answering yes decreases the number of recorded free bits so that it equals
|
||||
the total number of bits in the group descriptor's bitmap.
|
||||
|
||||
+.SS "GROUP_CHAIN_LOOP"
|
||||
+A chain may loop if the next field of the group descriptor points to one of
|
||||
+the previous group descriptors in the chain. This causes the ocfs2 code, both
|
||||
+user space and kernel module to loop forever.
|
||||
+
|
||||
+Answering yes breaks the loop at an optimum location so that all the existing
|
||||
+group descriptors are in the chain. However, it cannot re-connect stray group
|
||||
+descriptors and must rely on the rest of the fsck code to fix it.
|
||||
+
|
||||
.SS "CHAIN_COUNT"
|
||||
The chain list embedded in an inode is limited by the block size and the
|
||||
number of bytes consumed by the rest of the inode. A chain list header was
|
||||
Index: ocfs2-tools/fsck.ocfs2/pass0.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/fsck.ocfs2/pass0.c 2012-09-25 11:12:57.000000000 -0500
|
||||
+++ ocfs2-tools/fsck.ocfs2/pass0.c 2012-09-25 11:13:03.000000000 -0500
|
||||
@@ -666,6 +666,46 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static errcode_t break_loop(o2fsck_state *ost, struct ocfs2_chain_rec *chain,
|
||||
+ unsigned int max_depth)
|
||||
+{
|
||||
+ uint64_t *list;
|
||||
+ int i;
|
||||
+ unsigned int depth = 0;
|
||||
+ uint64_t blkno = chain->c_blkno;
|
||||
+ char *buf;
|
||||
+ struct ocfs2_group_desc *gd;
|
||||
+ errcode_t ret = ocfs2_malloc0(sizeof(uint64_t) * max_depth, &list);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ ret = ocfs2_malloc_block(ost->ost_fs->fs_io, &buf);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ gd = (struct ocfs2_group_desc *)buf;
|
||||
+
|
||||
+ while (blkno && (depth<=max_depth)) {
|
||||
+ list[depth++] = blkno;
|
||||
+ ret = ocfs2_read_group_desc(ost->ost_fs, blkno, buf);
|
||||
+ if (ret)
|
||||
+ goto out;
|
||||
+ blkno = gd->bg_next_group;
|
||||
+ for (i=0; i<depth; i++)
|
||||
+ if (list[i]==blkno) {
|
||||
+ gd->bg_next_group = 0;
|
||||
+ verbosef("Breaking gd loop %"PRIu64"\n", blkno);
|
||||
+ ret = ocfs2_write_group_desc(ost->ost_fs,
|
||||
+ blkno, buf);
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+out:
|
||||
+ if (list)
|
||||
+ ocfs2_free(&list);
|
||||
+ if (buf)
|
||||
+ ocfs2_free(&buf);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
/* this takes a slightly ridiculous number of arguments :/ */
|
||||
static errcode_t check_chain(o2fsck_state *ost,
|
||||
struct ocfs2_dinode *di,
|
||||
@@ -675,7 +715,8 @@ static errcode_t check_chain(o2fsck_stat
|
||||
char *buf2,
|
||||
int *chain_changed,
|
||||
ocfs2_bitmap *allowed,
|
||||
- ocfs2_bitmap *forbidden)
|
||||
+ ocfs2_bitmap *forbidden,
|
||||
+ unsigned int max_depth)
|
||||
{
|
||||
struct ocfs2_group_desc *bg1 = (struct ocfs2_group_desc *)buf1;
|
||||
struct ocfs2_group_desc *bg2 = (struct ocfs2_group_desc *)buf2;
|
||||
@@ -792,6 +833,14 @@ static errcode_t check_chain(o2fsck_stat
|
||||
/* the loop will now start by reading bg1->next_group */
|
||||
memcpy(buf1, buf2, ost->ost_fs->fs_blocksize);
|
||||
depth++;
|
||||
+ if (depth > max_depth) {
|
||||
+ if (prompt(ost, PY, PR_GROUP_CHAIN_LOOP,
|
||||
+ "Loop detected in chain %d at block %"PRIu64
|
||||
+ ". Break the loop?",cs->cs_chain_no,
|
||||
+ (uint64_t) chain->c_blkno))
|
||||
+ ret = break_loop(ost, chain, max_depth);
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
|
||||
/* we hit the premature end of a chain.. clear the last
|
||||
@@ -854,6 +903,7 @@ static errcode_t verify_chain_alloc(o2fs
|
||||
int changed = 0, trust_next_free = 1;
|
||||
errcode_t ret = 0;
|
||||
uint64_t chain_bytes;
|
||||
+ unsigned int num_gds, max_chain_len;
|
||||
|
||||
if (memcmp(di->i_signature, OCFS2_INODE_SIGNATURE,
|
||||
strlen(OCFS2_INODE_SIGNATURE))) {
|
||||
@@ -883,9 +933,12 @@ static errcode_t verify_chain_alloc(o2fs
|
||||
/* XXX should we check suballoc_node? */
|
||||
|
||||
cl = &di->id2.i_chain;
|
||||
+ num_gds = (di->i_clusters + cl->cl_cpg)/cl->cl_cpg;
|
||||
+ max_chain_len = (num_gds + cl->cl_count)/cl->cl_count;
|
||||
|
||||
- verbosef("cl cpg %u bpc %u count %u next %u\n",
|
||||
- cl->cl_cpg, cl->cl_bpc, cl->cl_count, cl->cl_next_free_rec);
|
||||
+ verbosef("cl cpg %u bpc %u count %u next %u gds %u max_ch_len %u\n",
|
||||
+ cl->cl_cpg, cl->cl_bpc, cl->cl_count, cl->cl_next_free_rec,
|
||||
+ num_gds, max_chain_len);
|
||||
|
||||
max_count = ocfs2_chain_recs_per_inode(ost->ost_fs->fs_blocksize);
|
||||
|
||||
@@ -948,7 +1001,7 @@ static errcode_t verify_chain_alloc(o2fs
|
||||
.cs_cpg = cl->cl_cpg,
|
||||
};
|
||||
ret = check_chain(ost, di, &cs, cr, buf1, buf2, &changed,
|
||||
- allowed, forbidden);
|
||||
+ allowed, forbidden, max_chain_len);
|
||||
/* XXX what? not checking ret? */
|
||||
|
||||
if (cr->c_blkno != 0) {
|
||||
Index: ocfs2-tools/include/ocfs2-kernel/ocfs2_fs.h
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/include/ocfs2-kernel/ocfs2_fs.h 2012-09-25 11:12:57.000000000 -0500
|
||||
+++ ocfs2-tools/include/ocfs2-kernel/ocfs2_fs.h 2012-09-25 11:13:03.000000000 -0500
|
||||
@@ -1685,7 +1685,7 @@ static inline int ocfs2_sprintf_system_i
|
||||
}
|
||||
|
||||
static inline void ocfs2_set_de_type(struct ocfs2_dir_entry *de,
|
||||
- umode_t mode)
|
||||
+ unsigned short mode)
|
||||
{
|
||||
de->file_type = ocfs2_type_by_mode[(mode & S_IFMT)>>S_SHIFT];
|
||||
}
|
2
_service
2
_service
@ -3,7 +3,7 @@
|
||||
<param name="url">git://oss.oracle.com/git/ocfs2-tools.git</param>
|
||||
<param name="scm">git</param>
|
||||
<param name="exclude">.git</param>
|
||||
<param name="versionformat">1.8.2+git.%ct.%h</param>
|
||||
<param name="versionformat">1.8.3+git.%ct.%h</param>
|
||||
<param name="revision">master</param>
|
||||
</service>
|
||||
|
||||
|
@ -1,13 +0,0 @@
|
||||
Index: ocfs2-tools/ocfs2_controld/main.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/ocfs2_controld/main.c
|
||||
+++ ocfs2-tools/ocfs2_controld/main.c
|
||||
@@ -1233,7 +1233,7 @@ static void set_scheduler(void)
|
||||
struct sched_param sched_param;
|
||||
int rv;
|
||||
|
||||
- rv = sched_get_priority_max(SCHED_RR);
|
||||
+ rv = sched_get_priority_min(SCHED_RR);
|
||||
if (rv != -1) {
|
||||
sched_param.sched_priority = rv;
|
||||
rv = sched_setscheduler(0, SCHED_RR, &sched_param);
|
@ -1,84 +0,0 @@
|
||||
Index: ocfs2-tools/ocfs2_controld/main.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/ocfs2_controld/main.c
|
||||
+++ ocfs2-tools/ocfs2_controld/main.c
|
||||
@@ -948,6 +948,68 @@ static void cpg_joined(int first)
|
||||
}
|
||||
}
|
||||
|
||||
+static int find_minors(void)
|
||||
+{
|
||||
+ FILE *fl;
|
||||
+ char name[256];
|
||||
+ uint32_t number;
|
||||
+ int c;
|
||||
+ int control_minor = 0;
|
||||
+
|
||||
+ if (!(fl = fopen("/proc/misc", "r"))) {
|
||||
+ log_error("failed to open /proc/misc: %s", strerror(errno));
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ while (!feof(fl)) {
|
||||
+ if (fscanf(fl, "%d %255s\n", &number, &name[0]) == 2) {
|
||||
+ if (!strcmp(name, "ocfs2_control"))
|
||||
+ control_minor = number;
|
||||
+ } else do {
|
||||
+ c = fgetc(fl);
|
||||
+ } while (c != EOF && c != '\n');
|
||||
+
|
||||
+ if (control_minor)
|
||||
+ break;
|
||||
+ }
|
||||
+ fclose(fl);
|
||||
+
|
||||
+ if (!control_minor)
|
||||
+ log_error("Is ocfs2 missing from kernel? No misc devices found");
|
||||
+out:
|
||||
+ return control_minor;
|
||||
+}
|
||||
+
|
||||
+static int find_udev_device(const char *path, uint32_t minor)
|
||||
+{
|
||||
+ struct stat st;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < 10; i++) {
|
||||
+ if (stat(path, &st) == 0 && minor(st.st_rdev) == minor)
|
||||
+ return 0;
|
||||
+ sleep(1);
|
||||
+ }
|
||||
+
|
||||
+ log_error("cannot find device %s with minor %d", path, minor);
|
||||
+ return -1;
|
||||
+}
|
||||
+
|
||||
+static int setup_misc_device(void)
|
||||
+{
|
||||
+ int rv = -1;
|
||||
+ int control_minor = find_minors();
|
||||
+
|
||||
+ if (control_minor) {
|
||||
+ rv = find_udev_device("/dev/misc/ocfs2_control", control_minor);
|
||||
+ if (rv < 0)
|
||||
+ return rv;
|
||||
+ log_debug("found /dev/misc/ocfs2_control %u", control_minor);
|
||||
+ }
|
||||
+
|
||||
+ return rv;
|
||||
+}
|
||||
+
|
||||
static int loop(void)
|
||||
{
|
||||
int rv, i, poll_timeout = -1;
|
||||
@@ -968,6 +1030,10 @@ static int loop(void)
|
||||
if (rv < 0)
|
||||
goto out;
|
||||
|
||||
+ rv = setup_misc_device();
|
||||
+ if (rv < 0)
|
||||
+ goto out;
|
||||
+
|
||||
rv = setup_cpg(cpg_joined);
|
||||
if (rv < 0)
|
||||
goto out;
|
@ -1,187 +0,0 @@
|
||||
---
|
||||
ocfs2_controld/ckpt.c | 2 -
|
||||
ocfs2_controld/main.c | 53 ++++++++++++++++++++++++++++++++++------
|
||||
ocfs2_controld/mount.c | 2 +
|
||||
ocfs2_controld/ocfs2_controld.h | 1
|
||||
ocfs2_controld/pacemaker.c | 2 -
|
||||
5 files changed, 51 insertions(+), 9 deletions(-)
|
||||
|
||||
Index: ocfs2-tools/ocfs2_controld/ckpt.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/ocfs2_controld/ckpt.c 2012-08-24 10:02:19.000000000 -0500
|
||||
+++ ocfs2-tools/ocfs2_controld/ckpt.c 2012-08-24 10:14:42.000000000 -0500
|
||||
@@ -413,7 +413,7 @@ static int call_section_read(struct ckpt
|
||||
|
||||
/* -ENOENT is a clean error for the caller to handle */
|
||||
if (rc == -ENOENT) {
|
||||
- log_debug("Checkpoint \"%.*s\" does not have a "
|
||||
+ log_error("Checkpoint \"%.*s\" does not have a "
|
||||
"section named \"%s\"",
|
||||
handle->ch_name.length,
|
||||
handle->ch_name.value, name);
|
||||
Index: ocfs2-tools/ocfs2_controld/main.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/ocfs2_controld/main.c 2012-08-24 10:02:19.000000000 -0500
|
||||
+++ ocfs2-tools/ocfs2_controld/main.c 2012-08-24 10:14:42.000000000 -0500
|
||||
@@ -74,7 +74,7 @@ static int time_to_die = 0;
|
||||
static int sigpipe_write_fd;
|
||||
|
||||
char *prog_name;
|
||||
-int daemon_debug_opt;
|
||||
+int daemon_debug_opt = 0;
|
||||
char daemon_debug_buf[1024];
|
||||
char dump_buf[DUMP_SIZE];
|
||||
int dump_point;
|
||||
@@ -1030,8 +1030,7 @@ static void lockfile(void)
|
||||
fd = open(LOCKFILE_NAME, O_CREAT|O_WRONLY,
|
||||
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
|
||||
if (fd < 0) {
|
||||
- fprintf(stderr, "cannot open/create lock file %s\n",
|
||||
- LOCKFILE_NAME);
|
||||
+ log_error("cannot open/create lock file %s", LOCKFILE_NAME);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -1042,13 +1041,13 @@ static void lockfile(void)
|
||||
|
||||
error = fcntl(fd, F_SETLK, &lock);
|
||||
if (error) {
|
||||
- fprintf(stderr, "ocfs2_controld is already running\n");
|
||||
+ log_error("ocfs2_controld is already running");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
error = ftruncate(fd, 0);
|
||||
if (error) {
|
||||
- fprintf(stderr, "cannot clear lock file %s\n", LOCKFILE_NAME);
|
||||
+ log_error("cannot clear lock file %s", LOCKFILE_NAME);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -1056,7 +1055,7 @@ static void lockfile(void)
|
||||
|
||||
error = write(fd, buf, strlen(buf));
|
||||
if (error <= 0) {
|
||||
- fprintf(stderr, "cannot write lock file %s\n", LOCKFILE_NAME);
|
||||
+ log_error("cannot write lock file %s", LOCKFILE_NAME);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
@@ -1066,13 +1065,13 @@ static void daemonize(void)
|
||||
int fd;
|
||||
pid_t pid = fork();
|
||||
if (pid < 0) {
|
||||
+ log_error("main: cannot fork");
|
||||
perror("main: cannot fork");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (pid)
|
||||
exit(EXIT_SUCCESS);
|
||||
setsid();
|
||||
- chdir("/");
|
||||
umask(0);
|
||||
close(0);
|
||||
close(1);
|
||||
@@ -1143,6 +1142,7 @@ static void decode_arguments(int argc, c
|
||||
break;
|
||||
|
||||
default:
|
||||
+ log_error("unknown option: %c\n", optchar);
|
||||
fprintf(stderr, "unknown option: %c\n", optchar);
|
||||
exit(EXIT_FAILURE);
|
||||
break;
|
||||
@@ -1180,12 +1180,53 @@ static void set_scheduler(void)
|
||||
}
|
||||
}
|
||||
|
||||
+#include <sys/time.h>
|
||||
+#include <sys/resource.h>
|
||||
+
|
||||
+static int
|
||||
+hack_enable_coredumps(void)
|
||||
+{
|
||||
+ int rc;
|
||||
+ struct rlimit rlim;
|
||||
+ int doenable = 1;
|
||||
+
|
||||
+ if ((rc = getrlimit(RLIMIT_CORE, &rlim)) < 0) {
|
||||
+ int errsave = errno;
|
||||
+ log_error("Cannot get current core limit value. %d", errsave);
|
||||
+ errno = errsave;
|
||||
+ return rc;
|
||||
+ }
|
||||
+ if (rlim.rlim_max == 0 && geteuid() == 0) {
|
||||
+ rlim.rlim_max = RLIM_INFINITY;
|
||||
+ }
|
||||
+
|
||||
+ rlim.rlim_cur = (doenable ? rlim.rlim_max : 0);
|
||||
+
|
||||
+ if (doenable && rlim.rlim_max == 0) {
|
||||
+ log_error("Not possible to enable core dumps (rlim_max is 0)");
|
||||
+ }
|
||||
+
|
||||
+ if ((rc = setrlimit(RLIMIT_CORE, &rlim)) < 0) {
|
||||
+ int errsave = errno;
|
||||
+ log_error("Unable to enable core dumps: %d", errsave);
|
||||
+ errno = errsave;
|
||||
+ return rc;
|
||||
+ }
|
||||
+ chdir("/var/lib/openais");
|
||||
+ log_debug("Core dumps enabled: /var/lib/openais");
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
errcode_t err;
|
||||
prog_name = argv[0];
|
||||
const char *stack = NULL;
|
||||
|
||||
+ decode_arguments(argc, argv);
|
||||
+
|
||||
+ hack_enable_coredumps();
|
||||
+
|
||||
init_mounts();
|
||||
|
||||
initialize_o2cb_error_table();
|
||||
@@ -1201,13 +1242,11 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
if (strcmp(stack, stackname)) {
|
||||
- fprintf(stderr, "%s: This daemon supports the \"%s\" stack, but the \"%s\" stack is in use\n",
|
||||
- prog_name, stackname, stack);
|
||||
+ log_error("%s: This daemon supports the \"%s\" stack, but the \"%s\" stack is in use",
|
||||
+ prog_name, stackname, stack);
|
||||
return 1;
|
||||
}
|
||||
|
||||
- decode_arguments(argc, argv);
|
||||
-
|
||||
if (!daemon_debug_opt)
|
||||
daemonize();
|
||||
|
||||
Index: ocfs2-tools/ocfs2_controld/mount.c
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/ocfs2_controld/mount.c 2012-08-24 10:02:19.000000000 -0500
|
||||
+++ ocfs2-tools/ocfs2_controld/mount.c 2012-08-24 10:14:42.000000000 -0500
|
||||
@@ -176,6 +176,8 @@ static void notify_mount_client(struct m
|
||||
else
|
||||
mg->mg_mount_notified = 1;
|
||||
|
||||
+ log_debug("Notified client: %d", mg->mg_mount_notified);
|
||||
+
|
||||
/*
|
||||
* XXX If we failed to notify the client, what can we do? I'm
|
||||
* guessing that our main loop will get POLLHUP and we'll clean
|
||||
Index: ocfs2-tools/ocfs2_controld/ocfs2_controld.h
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/ocfs2_controld/ocfs2_controld.h 2012-08-24 10:14:40.000000000 -0500
|
||||
+++ ocfs2-tools/ocfs2_controld/ocfs2_controld.h 2012-08-24 10:14:42.000000000 -0500
|
||||
@@ -60,6 +60,7 @@ do { \
|
||||
#define log_error(fmt, args...) \
|
||||
do { \
|
||||
log_debug(fmt, ##args); \
|
||||
+ fprintf(stderr, fmt "\n", ##args); \
|
||||
syslog(LOG_ERR, fmt, ##args); \
|
||||
} while (0)
|
||||
|
@ -1,70 +0,0 @@
|
||||
commit 1a5af4e8a91e106261e1552821b19b425d6adfd3
|
||||
Author: Goldwyn Rodrigues <rgoldwyn@suse.de>
|
||||
Date: Thu Jul 5 11:41:14 2012 -0500
|
||||
|
||||
fsck.ocfs2 fix indexed dirs
|
||||
|
||||
diff --git a/fsck.ocfs2/fsck.ocfs2.checks.8.in b/fsck.ocfs2/fsck.ocfs2.checks.8.in
|
||||
index 45f9336..788c89b 100644
|
||||
--- a/fsck.ocfs2/fsck.ocfs2.checks.8.in
|
||||
+++ b/fsck.ocfs2/fsck.ocfs2.checks.8.in
|
||||
@@ -1149,6 +1149,17 @@ possible data for a particular offset for the file.
|
||||
|
||||
Answering yes will serialize the extents.
|
||||
|
||||
+.SS "DX_TREE_CORRUPT"
|
||||
+The index tree of the directory is corrupt.
|
||||
+
|
||||
+Answering yes will rebuild the directory index, in pass 2.
|
||||
+
|
||||
+
|
||||
+.SS "DX_TREE_MISSING"
|
||||
+The index of this directory is missing.
|
||||
+
|
||||
+Answering yes will rebuild the directory index.
|
||||
+
|
||||
.SH "SEE ALSO"
|
||||
.BR debugfs.ocfs2(8)
|
||||
.BR fsck.ocfs2(8)
|
||||
diff --git a/fsck.ocfs2/pass1.c b/fsck.ocfs2/pass1.c
|
||||
index 3590a2d..c076e28 100644
|
||||
--- a/fsck.ocfs2/pass1.c
|
||||
+++ b/fsck.ocfs2/pass1.c
|
||||
@@ -917,10 +917,14 @@ static errcode_t o2fsck_check_blocks(ocfs2_filesys *fs, o2fsck_state *ost,
|
||||
}
|
||||
|
||||
ret = o2fsck_check_dx_dir(ost, di);
|
||||
- if (ret) {
|
||||
- com_err(whoami, ret, "while iterating over the dir indexed "
|
||||
- "tree for directory inode %"PRIu64, (uint64_t)di->i_blkno);
|
||||
- goto out;
|
||||
+ if (ret && prompt(ost, PY, PR_DX_TREE_CORRUPT,
|
||||
+ "Inode %"PRIu64" has invalid dx tree. "
|
||||
+ "Reset for later rebuild?", (uint64_t)di->i_blkno)) {
|
||||
+ ocfs2_dx_dir_truncate(fs, di->i_blkno);
|
||||
+ di->i_dx_root = 0ULL;
|
||||
+ di->i_dyn_features &= ~OCFS2_INDEXED_DIR_FL;
|
||||
+ o2fsck_write_inode(ost, di->i_blkno, di);
|
||||
+ ret = 0;
|
||||
}
|
||||
|
||||
if (S_ISLNK(di->i_mode))
|
||||
diff --git a/fsck.ocfs2/pass2.c b/fsck.ocfs2/pass2.c
|
||||
index 96c4eaf..681e817 100644
|
||||
--- a/fsck.ocfs2/pass2.c
|
||||
+++ b/fsck.ocfs2/pass2.c
|
||||
@@ -735,9 +735,11 @@ static unsigned pass2_dir_block_iterate(o2fsck_dirblock_entry *dbe,
|
||||
/* Set the flag for index rebuilding */
|
||||
if (ocfs2_supports_indexed_dirs(OCFS2_RAW_SB(dd->fs->fs_super))
|
||||
&& !(di->i_dyn_features & OCFS2_INLINE_DATA_FL)
|
||||
- && !(di->i_dyn_features & OCFS2_INDEXED_DIR_FL)) {
|
||||
- ret_flags |= OCFS2_DIRENT_CHANGED;
|
||||
- }
|
||||
+ && !(di->i_dyn_features & OCFS2_INDEXED_DIR_FL)
|
||||
+ && prompt(dd->ost, PY, PR_DX_TREE_MISSING,
|
||||
+ "Directory %"PRIu64" is missing index. "
|
||||
+ "Rebuild?", dbe->e_ino))
|
||||
+ ret_flags |= OCFS2_DIRENT_CHANGED;
|
||||
|
||||
}
|
||||
|
@ -1,28 +0,0 @@
|
||||
---
|
||||
ocfs2_controld/ocfs2_controld.h | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
Index: ocfs2_controld/ocfs2_controld.h
|
||||
===================================================================
|
||||
--- a/ocfs2_controld/ocfs2_controld.h.orig 2008-10-26 18:10:50.000000000 +0100
|
||||
+++ b/ocfs2_controld/ocfs2_controld.h 2009-03-10 22:22:52.719197000 +0100
|
||||
@@ -44,12 +44,19 @@ extern void daemon_dump_save(void);
|
||||
|
||||
#define log_debug(fmt, args...) \
|
||||
do { \
|
||||
+ syslog(LOG_DEBUG, fmt, ##args); \
|
||||
snprintf(daemon_debug_buf, 1023, "%ld %s@%d: " fmt "\n", \
|
||||
time(NULL), __FUNCTION__, __LINE__, ##args); \
|
||||
if (daemon_debug_opt) fprintf(stderr, "%s", daemon_debug_buf); \
|
||||
daemon_dump_save(); \
|
||||
} while (0)
|
||||
|
||||
+#define log_info(fmt, args...) \
|
||||
+do { \
|
||||
+ log_debug(fmt, ##args); \
|
||||
+ syslog(LOG_INFO, fmt, ##args); \
|
||||
+} while (0)
|
||||
+
|
||||
#define log_error(fmt, args...) \
|
||||
do { \
|
||||
log_debug(fmt, ##args); \
|
@ -1,23 +0,0 @@
|
||||
While running fsck.ocfs2, if an assert is met, fsck.ocfs2 terminates.
|
||||
This error is still recoverable, because the index of the directory
|
||||
can be rebuilt. Converting the asserts to an error would return
|
||||
control to fsck.
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/libocfs2/dir_indexed.c
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/libocfs2/dir_indexed.c 2013-04-02 04:38:06.444732480 -0500
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/libocfs2/dir_indexed.c 2013-08-13 09:37:35.120453200 -0500
|
||||
@@ -1436,9 +1436,11 @@ errcode_t ocfs2_dx_dir_search(ocfs2_file
|
||||
entry_list = &dx_leaf->dl_list;
|
||||
}
|
||||
|
||||
- assert(entry_list->de_count > 0);
|
||||
- assert(entry_list->de_num_used > 0);
|
||||
- assert(dx_root->dr_num_entries > 0);
|
||||
+ if ((entry_list->de_count == 0) || (entry_list->de_num_used == 0) ||
|
||||
+ (dx_root->dr_num_entries == 0)) {
|
||||
+ ret = OCFS2_ET_DIR_CORRUPTED;
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
ret = ocfs2_malloc_block(fs->fs_io, &dir_buf);
|
||||
if (ret)
|
@ -1,11 +0,0 @@
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/ocfs2.pc.in
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/ocfs2.pc.in 2013-04-02 04:38:06.452732480 -0500
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/ocfs2.pc.in 2013-08-09 16:51:54.933245397 -0500
|
||||
@@ -7,5 +7,5 @@ Name: ocfs2
|
||||
Description: Userspace ocfs2 library
|
||||
Version: @VERSION@
|
||||
Requires: o2dlm o2cb com_err
|
||||
-Libs: -L${libdir} -locfs2
|
||||
+Libs: -L${libdir} -locfs2 -laio
|
||||
Cflags: -I${includedir}
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:50591c0264e1317ac516d23d671cbc521f4d17e85ef42ab3f300add7f84ddd37
|
||||
size 1543758
|
3
ocfs2-tools-1.8.3+git.1418704844.65fac00.tar.gz
Normal file
3
ocfs2-tools-1.8.3+git.1418704844.65fac00.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0da129916f2be1f4a2950c127d8c31ec57f2c8635b4d5de7c386125b0a5b88b0
|
||||
size 1507995
|
@ -1,3 +1,22 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Feb 9 03:26:29 UTC 2015 - ghe@suse.com
|
||||
|
||||
- Update ocfs2-tools.tar.bz2 to upstream v1.8.3
|
||||
- Drop patches (merged upstream):
|
||||
- fix-indexed-dirs.patch
|
||||
- 0001-fswreck-Create-a-loop-in-group-chains.patch
|
||||
- 0002-Break-a-chain-loop-in-group-desc.patch
|
||||
- restore-g_list_append.patch
|
||||
- ocfs2console-libraries-include-aio.patch
|
||||
- libocfs2-needs-libaio.patch
|
||||
- libocfs2-Change-asserts-to-error.patch
|
||||
- Drop patches for ocfs2_controld
|
||||
- force-debug.patch
|
||||
- extra-debug.patch
|
||||
- bug-805764-ocfs2-controld.patch
|
||||
- bnc804707-reduce-RR-priority.patch
|
||||
- use-symlink-in-udev-rules.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Feb 11 16:57:54 UTC 2014 - rgoldwyn@suse.com
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package ocfs2-tools
|
||||
#
|
||||
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: ocfs2-tools
|
||||
Version: 1.8.2+git.1361836695.ff84eb5
|
||||
Version: 1.8.3+git.1418704844.65fac00
|
||||
Release: 0
|
||||
Summary: Oracle Cluster File System 2 Core Tools
|
||||
License: GPL-2.0+
|
||||
@ -26,8 +26,6 @@ Url: http://oss.oracle.com/projects/ocfs2-tools/
|
||||
Source: ocfs2-tools-%{version}.tar.gz
|
||||
Source1: o2cb.ocf
|
||||
Source2: reflink.tar.bz2
|
||||
Patch101: force-debug.patch
|
||||
Patch102: extra-debug.patch
|
||||
Patch103: debug-ocfs2_hb_ctl.patch
|
||||
Patch105: bug-470741-debug_start_failures.patch
|
||||
Patch106: ocfs2-devel.diff
|
||||
@ -37,16 +35,6 @@ Patch202: fix-configure-check-libs.patch
|
||||
Patch204: dont-use-var-lock-subsys.patch
|
||||
Patch205: ocfs2-tools-kernel33.patch
|
||||
Patch206: ocfs2-tools-resource.patch
|
||||
Patch207: fix-indexed-dirs.patch
|
||||
Patch208: 0001-fswreck-Create-a-loop-in-group-chains.patch
|
||||
Patch209: 0002-Break-a-chain-loop-in-group-desc.patch
|
||||
Patch210: restore-g_list_append.patch
|
||||
Patch212: bug-805764-ocfs2-controld.patch
|
||||
Patch213: bnc804707-reduce-RR-priority.patch
|
||||
Patch214: use-symlink-in-udev-rules.patch
|
||||
Patch215: ocfs2console-libraries-include-aio.patch
|
||||
Patch220: libocfs2-needs-libaio.patch
|
||||
Patch221: libocfs2-Change-asserts-to-error.patch
|
||||
Patch222: 0001-Use-cmap-for-getting-cluster-name.patch
|
||||
Patch223: 0002-Remove-controld-dependency-in-group_join-leave.patch
|
||||
Patch224: 0003-Auto-setup-cluster_stack-based-on-what-is-on-disk.patch
|
||||
@ -142,8 +130,6 @@ OCFS2 filesystem.
|
||||
|
||||
%prep
|
||||
%setup -q -a 2
|
||||
%patch101 -p1
|
||||
%patch102 -p1
|
||||
%patch103 -p1
|
||||
%patch105 -p1
|
||||
%patch106 -p1
|
||||
@ -153,16 +139,6 @@ OCFS2 filesystem.
|
||||
%patch204 -p1
|
||||
%patch205 -p1
|
||||
%patch206 -p1
|
||||
%patch207 -p1
|
||||
%patch208 -p1
|
||||
%patch209 -p1
|
||||
%patch210 -p1
|
||||
%patch212 -p1
|
||||
%patch213 -p1
|
||||
%patch214 -p1
|
||||
%patch215 -p1
|
||||
%patch220 -p1
|
||||
%patch221 -p1
|
||||
%patch222 -p1
|
||||
%patch223 -p1
|
||||
%patch224 -p1
|
||||
|
@ -1,13 +0,0 @@
|
||||
Index: ocfs2-tools/ocfs2console/ocfs2interface/Makefile
|
||||
===================================================================
|
||||
--- ocfs2-tools.orig/ocfs2console/ocfs2interface/Makefile 2012-08-24 10:02:19.000000000 -0500
|
||||
+++ ocfs2-tools/ocfs2console/ocfs2interface/Makefile 2013-04-24 12:06:35.115649501 -0500
|
||||
@@ -8,7 +8,7 @@ CFLAGS += -fPIC
|
||||
|
||||
PYMOD_CFLAGS = -fno-strict-aliasing $(PYTHON_INCLUDES)
|
||||
|
||||
-LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2
|
||||
+LIBOCFS2_LIBS = -L$(TOPDIR)/libocfs2 -locfs2 -laio
|
||||
LIBOCFS2_DEPS = $(TOPDIR)/libocfs2/libocfs2.a
|
||||
|
||||
LIBO2DLM_LIBS = -L$(TOPDIR)/libo2dlm -lo2dlm $(DL_LIBS)
|
@ -1,11 +0,0 @@
|
||||
--- ocfs2-tools.orig/o2cb_ctl/jconfig.c 2012-09-25 11:12:57.000000000 -0500
|
||||
+++ ocfs2-tools/o2cb_ctl/jconfig.c 2012-09-25 11:13:03.000000000 -0500
|
||||
@@ -1082,6 +1082,8 @@
|
||||
g_strdup(stanza_name),
|
||||
elem);
|
||||
}
|
||||
+ else
|
||||
+ g_list_append(elem, cfs);
|
||||
|
||||
return(cfs);
|
||||
} /* j_config_add_stanza() */
|
@ -1,8 +0,0 @@
|
||||
Index: ocfs2-tools-1.8.2+git.1361836695.ff84eb5/vendor/common/51-ocfs2.rules
|
||||
===================================================================
|
||||
--- ocfs2-tools-1.8.2+git.1361836695.ff84eb5.orig/vendor/common/51-ocfs2.rules
|
||||
+++ ocfs2-tools-1.8.2+git.1361836695.ff84eb5/vendor/common/51-ocfs2.rules
|
||||
@@ -1,2 +1,2 @@
|
||||
-KERNEL=="ocfs2_control", NAME="misc/ocfs2_control", MODE="0660"
|
||||
+KERNEL=="ocfs2_control", SYMLINK+="misc/ocfs2_control", MODE="0660"
|
||||
|
Loading…
Reference in New Issue
Block a user