From andyp@fedoraproject.org Wed Jul 1 17:08:00 2009 From: andyp@fedoraproject.org (andyp) Date: Wed, 01 Jul 2009 17:08:00 -0000 Subject: gfs2-utils: master - gfs2-utils: Remove askant, contrib Message-ID: <20090701170725.923831201F0@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=bf290707a90710422feeef90124459fdc39e783f Commit: bf290707a90710422feeef90124459fdc39e783f Parent: 0f462ee984d67250a66ac1c962ec66164c57d794 Author: Andrew Price AuthorDate: Wed Jul 1 15:34:56 2009 +0100 Committer: Andrew Price CommitterDate: Wed Jul 1 15:34:56 2009 +0100 gfs2-utils: Remove askant, contrib Askant would be better off maintained in its own git tree. Python's distutils provides a sufficient build system for Python modules and extensions. Splitting out askant into its own tree will allow it to revert to using that simpler system, as well as avoiding dependencies on unnecessary packages. It also means one less package to maintain in gfs2-utils.git. Also remove contrib/ as nothing lives there any more. Signed-off-by: Andrew Price --- Makefile.am | 4 - configure.ac | 8 - contrib/Makefile.am | 3 - contrib/askant/INSTALL | 42 --- contrib/askant/Makefile.am | 57 ---- contrib/askant/PLUGINAPI | 65 ----- contrib/askant/README | 74 ----- contrib/askant/askant/about.py | 5 - contrib/askant/askant/askant.py | 24 -- contrib/askant/askant/blktrace.py | 93 ------- contrib/askant/askant/commands.py | 333 ----------------------- contrib/askant/askant/sysfs.py | 86 ------ contrib/askant/fsplugins/gfs2/gfs2.c | 404 ---------------------------- contrib/askant/fsplugins/gfs2/gfs2.h | 3 - contrib/askant/fsplugins/gfs2/gfs2module.c | 104 ------- contrib/askant/scripts/askant | 6 - contrib/askant/setup.py | 16 -- doc/COPYRIGHT | 3 - 18 files changed, 0 insertions(+), 1330 deletions(-) diff --git a/Makefile.am b/Makefile.am index 981319f..688c350 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,10 +14,6 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = group gfs2 doc -if BUILD_CONTRIB -SUBDIRS += contrib -endif - install-exec-local: $(INSTALL) -d $(DESTDIR)/$(LOGDIR) $(INSTALL) -d $(DESTDIR)/$(CLUSTERVARRUN) diff --git a/configure.ac b/configure.ac index a568463..78db886 100644 --- a/configure.ac +++ b/configure.ac @@ -104,10 +104,6 @@ AC_ARG_WITH([sysloglevel], [ SYSLOGLEVEL="$withval" ], [ SYSLOGLEVEL="LOG_INFO" ]) -AC_ARG_ENABLE([contrib], - [ --enable-contrib enable contrib build. ], - [ default="no" ]) - AC_ARG_WITH([kernel], [ --with-kernel=path path to kernel source. ], [ KERNEL_DIR="$withval" ], @@ -208,8 +204,6 @@ AC_DEFINE_UNQUOTED([SYSLOGFACILITY], $(eval echo ${SYSLOGFACILITY}), AC_DEFINE_UNQUOTED([SYSLOGLEVEL], $(eval echo ${SYSLOGLEVEL}), [Default syslog level]) -AM_CONDITIONAL(BUILD_CONTRIB, test "x${enable_contrib}" = xyes) - ## *FLAGS handling ENV_CFLAGS="$CFLAGS" @@ -285,8 +279,6 @@ AC_CONFIG_FILES([Makefile gfs2/quota/Makefile gfs2/tool/Makefile gfs2/man/Makefile - contrib/Makefile - contrib/askant/Makefile doc/Makefile ]) diff --git a/contrib/Makefile.am b/contrib/Makefile.am deleted file mode 100644 index 28b39d5..0000000 --- a/contrib/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -SUBDIRS = askant diff --git a/contrib/askant/INSTALL b/contrib/askant/INSTALL deleted file mode 100644 index ce26b82..0000000 --- a/contrib/askant/INSTALL +++ /dev/null @@ -1,42 +0,0 @@ - - How To Install Askant - --------------------- - -o Build Dependencies - - Python - - libgfs2 (part of the Red Hat cluster suite as a static lib) - -o Dependencies - - Python - - blktrace and blkparse with appropriate kernel config options enabled and - debugfs mounted - -o Intro - Askant uses Python's distutils for its standard installation procedure so the - setup.py script provides installation routines. Note that it doesn't provide - uninstallation routines so the best way to install it is to obtain a package - for your particular distribution and install that. - -o Installation - To install askant to the default location on your system, run as root: - - ./setup.py install - - If you wish to install it to a different root directory (e.g. /var/mychroot) - or prefix directory (e.g. /usr/local instead of /usr) see: - - ./setup.py install --help - - To find out everything else setup.py can do: - - ./setup.py --help-commands - -o Use Without Installing - To use askant without installing it (e.g. if you want to test patches - quickly) it is necessary to carry out the build stage to compile the required - plugins. Do: - - ./setup.py build - cd build/lib* - python askant/askant.py - diff --git a/contrib/askant/Makefile.am b/contrib/askant/Makefile.am deleted file mode 100644 index 59b4309..0000000 --- a/contrib/askant/Makefile.am +++ /dev/null @@ -1,57 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -EXTRA_DIST = setup.py INSTALL PLUGINAPI README \ - scripts/askant \ - askant/__init__.py askant/about.py \ - askant/askant.py askant/blktrace.py \ - askant/commands.py askant/sysfs.py \ - askant/fs/__init__.py \ - fsplugins/__init__.py \ - fsplugins/gfs2/gfs2.c fsplugins/gfs2/gfs2.h \ - fsplugins/gfs2/gfs2module.c - -CFLAGS += -I$(top_srcdir)/gfs2/libgfs2 -CFLAGS += -I$(top_srcdir)/gfs2/include - -LDFLAGS += -L$(abs_builddir)/$(top_builddir)/gfs2/libgfs2/.libs - -all-local: linkcode - CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ - $(PYTHON) setup.py build - -install-exec-local: linkcode - if [ -n "$(DESTDIR)" ]; then \ - python setup.py install --root $(DESTDIR); \ - else \ - python setup.py install --prefix $(prefix); \ - fi - -uninstall-local: - if [ -n "$(DESTDIR)" ]; then \ - cd $(DESTDIR)/$(bindir) && \ - rm -f askant; \ - cd $(DESTDIR)/$(pythondir) && \ - rm -rf askant && rm askant*.egg-info; \ - else \ - cd $(prefix)/$(bindir) && \ - rm -f askant; \ - cd $(prefix)/$(pythondir) && \ - rm -rf askant && rm askant*.egg-info; \ - fi - -linkcode: Makefile - if [ ! -e setup.py ]; then \ - touch linkcode; \ - cd $(srcdir); \ - find . -type d -exec mkdir -p $(abs_builddir)/{} \; ; \ - find . -type f -exec ln -sf $(abs_srcdir)/{} $(abs_builddir)/{} \; ; \ - fi - -clean-local: - -$(PYTHON) setup.py clean - rm -rf askant/*.pyc - rm -rf build - if [ -e linkcode ]; then \ - find . -type l -exec rm -f {} \; ; \ - rm -rf askant fsplugins scripts linkcode; \ - fi diff --git a/contrib/askant/PLUGINAPI b/contrib/askant/PLUGINAPI deleted file mode 100644 index 4c2eceb..0000000 --- a/contrib/askant/PLUGINAPI +++ /dev/null @@ -1,65 +0,0 @@ - - Writing File System Plugins for Askant - -------------------------------------- - -0. Contents - - 1. Intro - 2. API - 3. Reference - - -1. Intro - -In order to gather file system data with which to enhance the data provided by -blktrace, there must be specific code written for each file system type we wish -to support. This is where file system plugins come along. The plugins must -basically traverse an on-disk file system structure on a block device and report -back their findings through a callback handed to them by askant. They must also -expose a function which stops their traversal loop in case askant wishes to stop -their execution prematurely. - - -2. API - -A file system plugin must be written as a Python module. This means that C, C++ -and Python are suitable languages to write them in. They must expose a number of -Python functions to askant: - -parsefs(dev) - - This function is called when askant wants the plugin to parse the file - system on the device specified by the device, dev. - -get_block_size() - - This function is called to ascertain the file system block size which is - required in order to map the disk sector numbers provided by blktrace to - file system block numbers. It takes no arguments and should return a Python - integer value. - -set_report_hook(func) - - This function is called to pass in a report function which the plugin should - call to report the details of a file system block. func is a function which - accepts four arguments in this order: - - Block number: a Python long integer - Block type: a Python string - Block number of parent: a Python long integer - Block file name: a Python string (should be "" for non-inode blocks) - -handle_sigint() - - This function should make the plugin stop its parsing loop. This allows it - to be interrupted if askant catches a signal, for example. It takes no - arguments and its return value is not used. - - -3. Reference - -o See fsplugins/gfs2/gfs2module.c for an example of writing a Python fs plugin - module in C. - -o http://www.python.org/doc/ext/intro.html shows how to extend Python with C or - C++. diff --git a/contrib/askant/README b/contrib/askant/README deleted file mode 100644 index 74e3219..0000000 --- a/contrib/askant/README +++ /dev/null @@ -1,74 +0,0 @@ - - Askant - A Block I/O Analysis Tool - ---------------------------------- - -0. Contents - - 1. Intro - 2. Commands and their options - 3. Examples - - -1. Intro - -Askant allows you to gather file system block I/O data for performance analysis. -It uses blktrace to trace block operations and adds file system specific data by -parsing fs block information straight from the storage device. To do this it -invokes functionality from file system parser plugins which traverse the on-disk -structures and report details of the blocks they encounter through callbacks. - -Usage: askant [options...] - -o See 'askant --commands' for a full list of commands. - - -2. Commands and their options - - dumpfs - - Dumps the block data provided by an fs plugin from the given file system. - - -d The block device which contains the file system under scrutiny - -t The type of the file system, i.e. the name of the fs plugin to load - -o Output file (optional). Stdout is used if '-' or omitted. - (Note that the output file should be on a different device to the one - specified with -d.) - - unlinks - - Does a dumpfs and runs blktrace until interrupted. It then blkparses the - blktrace data and adds the block data. This is suitable for tracing I/O - operations during an unlink test run. - - -d The block device which contains the file system under scrutiny - -t The type of the file system, i.e. the name of the fs plugin to load - -g The path to the debugfs mount point, defaults to /sys/kernel/debug - -D The directory in which to store the block dumps and blktrace files. - - creates - - Runs blktrace until interrupted. It then does a dumpfs and blkparses the - blktrace data and adds the block data. This is suitable for tracing I/O - operations during a file creation test run. - - -d The block device which contains the file system under scrutiny - -t The type of the file system, i.e. the name of the fs plugin to load - -g The path to the debugfs mount point, defaults to /sys/kernel/debug - -D The directory in which to store the block dumps and blktrace files. - -3. Examples - -o Parse the file system and dump information about each block to stdout e.g.: - - # askant dumpfs -t gfs2 -d /dev/sda3 - -o Trace 'unlinks' by dumping block information before the blktrace and matching - block data to provide a more detailed blkparse output e.g.: - - # askant unlinks -t gfs2 -d /dev/sda3 -D /tmp/dir -g /mnt/debugfs - -o Trace 'creates' by dumping block information after the blktrace and matching - block data to provide a more detailed blkparse output e.g.: - - # askant creates -t gfs2 -d /dev/sda3 -D /tmp/dir -g /mnt/debugfs - diff --git a/contrib/askant/askant/__init__.py b/contrib/askant/askant/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/contrib/askant/askant/about.py b/contrib/askant/askant/about.py deleted file mode 100644 index 3d40a74..0000000 --- a/contrib/askant/askant/about.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Version information for askant. -""" - -version = "0.0.1" diff --git a/contrib/askant/askant/askant.py b/contrib/askant/askant/askant.py deleted file mode 100644 index a4376b6..0000000 --- a/contrib/askant/askant/askant.py +++ /dev/null @@ -1,24 +0,0 @@ -""" -The main entry point for askant. -""" - -import sys -import commands - -def main(): - - """Run askant""" - - cmds = commands.Commands() - cmds.register_command(commands.DumpFSCommand()) - cmds.register_command(commands.UnlinksCommand()) - cmds.register_command(commands.CreatesCommand()) - - try: - cmds.process_argv(sys.argv) - except commands.NoFSPluginException, p: - print >>sys.stderr, "Plugin not found: %s" %p - - -if __name__ == '__main__': - main() diff --git a/contrib/askant/askant/blktrace.py b/contrib/askant/askant/blktrace.py deleted file mode 100644 index fdf0219..0000000 --- a/contrib/askant/askant/blktrace.py +++ /dev/null @@ -1,93 +0,0 @@ -""" -Wrapper classes for running blktrace and blkparse and using their output -""" - -import os -import sys -import time -import signal -from subprocess import Popen -from subprocess import PIPE -from sysfs import Sysfs - -class BlktraceException(Exception): - - def __init__(self, val, msg): - Exception.__init__(self) - self.val = val - self.msg = msg - - def __str__(self): - return self.msg - -class Blktrace: - - def __init__(self, dev, debugfs='/sys/kernel/debug'): - self.dev = dev - self.debugfs = debugfs - self.sysfs = Sysfs(dev) - self.btpid = -1 - - def handle_sigint(self, sig, frame): - if self.btpid >= 0: - os.kill(self.btpid, signal.SIGTERM) - - def trace(self, tracefile): - - if not self.dev: - raise Exception("No device specified.") - - btargs = ['blktrace', - '-d', self.dev, - '-r', self.debugfs, - '-o', tracefile] - - blktrace = Popen(btargs, bufsize=1, stdout=PIPE, - stderr=open('/dev/null','w')) - self.btpid = blktrace.pid - btres = None - while btres is None: - time.sleep(1) - btres = blktrace.poll() - - self.btpid = -1 - if btres: - raise BlktraceException(btres, - 'blktrace exited with code ' + str(btres)) - - - - def parse(self, tracefile, getblk): - - if not self.dev: - raise Exception("No device specified.") - - offset = self.sysfs.get_partition_start_sector() - - bpargs = ['blkparse', '-i', tracefile] - blkparse = Popen(bpargs, bufsize=1, stdout=PIPE) - - bpres = None - while bpres is None: - output = blkparse.stdout.readline().strip() - if output: - chunks = output.split() - try: - # chunks[7] is the sector number - blk = list(getblk(int(chunks[7]))) - print "%s %s %s" %\ - (' '.join(blk[0:3]),\ - output.strip(), - blk[3].strip()) - except KeyError: - pass - except ValueError: - pass - - bpres = blkparse.poll() - - if bpres: - raise BlktraceException(bpres, - 'blkparse exited with code ' + str(bpres)) - - diff --git a/contrib/askant/askant/commands.py b/contrib/askant/askant/commands.py deleted file mode 100644 index ad4639f..0000000 --- a/contrib/askant/askant/commands.py +++ /dev/null @@ -1,333 +0,0 @@ -"""Command line parsing and processing for askant""" - -import fs -import os -import sys -import time -import about -import signal -import tempfile -from sysfs import Sysfs, SysfsException -from blktrace import Blktrace, BlktraceException -from optparse import OptionParser, make_option - -class NoFSPluginException(Exception): - - """A generic Exception class for when file system plugins are missing""" - - pass # Nothing special about this exception - -class Commands: - - """Provides a convenient interface to the askant commands""" - - def __init__(self): - - self.commands = {} - self.parser = OptionParser(usage="%prog COMMAND [options]", - version=about.version) - - - def register_command(self, command): - self.commands[str(command)] = command - - def __lookup_command(self, command): - try: - return self.commands[command] - except KeyError, k: - return DefaultCommand() - - def __parse_command(self, command, argv): - self.parser.prog = "%s %s" %\ - (self.parser.get_prog_name(), str(command)) - self.parser.set_usage(command.get_usage()) - optlst = command.get_options() - for o in optlst: - self.parser.add_option(o) - self.parser.set_description(command.get_help()) - - if str(command) != "": - argv = argv[1:] - - return self.parser.parse_args(argv) - - def process_argv(self, argv): - try: - command = self.__lookup_command(argv[1]) - except IndexError, i: - # This exits - self.parser.error("No command specified. Try --help") - - options, args = self.__parse_command(command, argv[1:]) - - command.do_command(options, args, self) - -class Command: - def __init__(self): - self.options = [] - -class DefaultCommand(Command): - def __str__(self): - return "" - - def get_options(self): - self.options.append(make_option("-c","--commands", - action="store_true", - help="Lists available commands")) - return self.options - - def get_usage(self): - return "%prog COMMAND [options] [args]" - - def get_help(self): - return "Askant is a tool for tracing I/O activity in Linux "\ - "and adding extra file system context by "\ - "parsing file system data directly." - - def do_command(self, options, args, base): - if options.commands: - base.parser.print_usage() - print "Available commands:" - keys = base.commands.keys() - keys.sort() - for k in keys: - print " %10s %s" %\ - (k, base.commands[k].get_help()) - print "" - print "For command-specific help, use "\ - "%sCOMMAND --help" % base.parser.get_prog_name() - else: - base.parser.error("Command not found. Try --commands") - - -class FSCommandTemplate(Command): - def __init__(self): - self.fsmod = None - self.block_table = {} - self.block_func = self.__report_hook - self.sector_size = None - self.offset = None - self.options = [ - make_option("-d","--device", metavar="DEVICE", - help="The device to analyse."), - ] - - def load_fs_plugin(self, fsname): - try: - self.fsmod = __import__("fs." + fsname, - globals(), locals(), ["fs"]) - except ImportError, i: - raise NoFSPluginException(fsname) - - def parse_fs(self, dev, hook=None): - if hook is None: - hook = self.block_func - - sfs = Sysfs(dev) - offset = sfs.get_partition_start_sector() - sector_size = sfs.get_dev_sector_size() - - self.fsmod.set_report_hook(hook) - - try: - sfs = Sysfs(dev) - self.offset = sfs.get_partition_start_sector() - self.sector_size = sfs.get_dev_sector_size() - signal.signal(signal.SIGINT, self.fsmod.handle_sigint) - self.blk_size = self.fsmod.get_block_size(dev) - self.fsmod.parsefs(dev) - signal.signal(signal.SIGINT, signal.SIG_DFL) - except IOError, i: - print >>sys.stderr, str(i) - sys.exit(1) - - def set_outfile(self, outfile): - self.outfile = outfile - - def trace(self, options, dump_before): - - sfs = Sysfs(options.device) - self.offset = sfs.get_partition_start_sector() - self.sector_size = sfs.get_dev_sector_size() - - tmstamp = time.strftime('%Y%m%d%H%M%S') - self.block_func = self.__report_hook - try: - self.outfile = open(os.path.join(options.outdir, "blocks-%s" % - tmstamp), 'w') - except IOError, e: - print >>sys.stderr, str(e) - sys.exit(1) - - if dump_before: - print >>sys.stderr, "Gathering block data..." - self.parse_fs(options.device) - self.outfile.close() - - if options.debugfs: - bt = Blktrace(options.device, options.debugfs) - else: - bt = Blktrace(options.device) - - os.chdir(options.outdir) # Blktrace doesn't use absolute paths - print >>sys.stderr, "Tracing. Hit Ctrl-C to end..." - try: - signal.signal(signal.SIGINT, bt.handle_sigint) - bt.trace(tmstamp) - signal.signal(signal.SIGINT, signal.SIG_DFL) - except BlktraceException, b: - signal.signal(signal.SIGINT, signal.SIG_DFL) - print >>sys.stderr, str(b) - sys.exit(1) - - if not dump_before: - print >>sys.stderr, "Gathering block data..." - self.parse_fs(options.device) - self.outfile.close() - - print >>sys.stderr, "Matching blocks..." - blockdb = open(self.outfile.name, 'r') - blocks = {} - for l in blockdb.readlines(): - s = l.split('\t') - blocks[int(s[0])] = tuple(s[1:]) - - bt.parse(os.path.join(options.outdir, tmstamp), blocks.__getitem__) - blockdb.close() - - def __report_hook(self, blk, type, parent, fn): - if not fn: - fn = "" - try: - self.outfile.write("%d\t%d\t%s\t%d\t\"%s\"\n" % ( - ((blk * self.blk_size)/self.sector_size) + self.offset, - blk, type, parent, fn)) - except Exception, e: - print str(e) - - def __dict_hook(self, blk, type, parent, fn): - self.block_table[ - ((blk * self.blk_size)/self.sector_size)+self.offset] =\ - (blk, type, parent, fn) - - -class DumpFSCommand(FSCommandTemplate): - def __str__(self): - return "dumpfs" - - def get_options(self): - self.options.append(make_option("-t","--type", metavar="FSTYPE", - help="The type of file system on the device.")) - self.options.append(make_option("-o","--output", metavar="FILE", - default="-", - help="File to write output to or '-' for stdout " - "(default)")) - return self.options - - def get_usage(self): - return "%prog [options]" - - def get_help(self): - return "Dump fs block information in TSV format." - - def do_command(self, options, args, base): - - if not options.device: - base.parser.error("No device specified. Use -d.") - - if not options.type: - base.parser.error("No file system type specified. " - "Use -t.") - try: - if options.output != "-": - self.set_outfile(open(options.output, 'w')) - else: - self.set_outfile(sys.stdout) - except IOError, e: - print >>sys.stderr,\ - "Unable to open file for writing: %s" %\ - options.output - return - except KeyError: - pass - - self.load_fs_plugin(options.type) - try: - self.parse_fs(options.device) - except SysfsException, s: - base.parser.error(s) - -class UnlinksCommand(FSCommandTemplate): - def __str__(self): - return "unlinks" - - def get_options(self): - self.options.append(make_option("-t","--type", metavar="FSTYPE", - help="The type of file system on the device.")) - self.options.append(make_option("-g","--debugfs", metavar="PATH", - default="/sys/kernel/debug", - help="The path to the debugfs mountpoint. Default " - "/sys/kernel/debug")) - self.options.append(make_option("-D","--outdir", metavar="DIR", - help="Directory to write output to. Required.")) - return self.options - - def get_usage(self): - return "%prog [options]" - - def get_help(self): - return "Trace block I/O activity during unlink tests." - - def do_command(self, options, args, base): - if not options.device: - base.parser.error("No device specified. Use -d.") - - self.device = options.device - - if not options.type: - base.parser.error("No file system type specified. " - "Use -t.") - if not options.outdir: - base.parser.error("No output directory specified. " - "Use -D.") - - self.load_fs_plugin(options.type) - self.trace(options, dump_before=True) - -class CreatesCommand(FSCommandTemplate): - def __str__(self): - return "creates" - - def get_options(self): - self.options.append(make_option("-t","--type", metavar="FSTYPE", - help="The type of file system on the device.")) - self.options.append(make_option("-g","--debugfs", metavar="PATH", - default="/sys/kernel/debug", - help="The path to the debugfs mountpoint. Default " - "/sys/kernel/debug")) - self.options.append(make_option("-D","--outdir", metavar="DIR", - help="Directory to write output to. Required.")) - return self.options - - def get_usage(self): - return "%prog [options]" - - def get_help(self): - return "Trace block I/O activity during create tests." - - def do_command(self, options, args, base): - if not options.device: - base.parser.error("No device specified. Use -d.") - - self.device = options.device - - if not options.type: - base.parser.error("No file system type specified. " - "Use -t.") - if not options.outdir: - base.parser.error("No output directory specified. " - "Use -D.") - - self.load_fs_plugin(options.type) - self.trace(options, dump_before=False) - diff --git a/contrib/askant/askant/fs/__init__.py b/contrib/askant/askant/fs/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/contrib/askant/askant/sysfs.py b/contrib/askant/askant/sysfs.py deleted file mode 100644 index 12b7a3b..0000000 --- a/contrib/askant/askant/sysfs.py +++ /dev/null @@ -1,86 +0,0 @@ -""" -Provides access to sysfs data pertaining to storage partitions. -""" - -import os -import os.path - -class SysfsException(Exception): - """ - An exception which is raised when things go wrong with Sysfs. - """ - pass # No functionality to add over Exception class - -class Sysfs: - """ - Provides access to sysfs data pertaining to storage partitions. - """ - def __init__(self, partition, sysfs_path='/sys'): - """ - Instantiate a Sysfs object. partition should be a path to a - disc partition device e.g. /dev/sda3. - """ - self.partition = partition - self.device = self.__partition2parent() - self.sysfs_path = sysfs_path - line = self.__firstline(os.path.join( - sysfs_path,'block', - os.path.split(self.device)[1], - os.path.split(self.partition)[1], - 'start')) - self.partition_start = int(line) - line = self.__firstline(os.path.join( - sysfs_path,'block', - os.path.split(self.device)[1], - 'queue', - 'hw_sector_size')) - self.dev_sector_size = int(line) - line = self.__firstline(os.path.join( - sysfs_path,'block', - os.path.split(self.device)[1], - os.path.split(self.partition)[1], - 'size')) - self.partition_size = int(line) - - def __firstline(self, fname): - """ - Read the first line of a file - """ - try: - fobj = open(fname, 'r') - except IOError: - raise SysfsException( - 'Could not open file "%s" for reading. Please ' - 'check your kernel is 2.6.25 or later and ' - 'sysfs is mounted.' % fname) - line = fobj.readline() - fobj.close() - return line - - def __partition2parent(self): - """ - Return the name of a partition device's parent device - e.g. /dev/sda3 -> /dev/sda - """ - # This may need thinking about a bit more - - # nothing in life can be this simple. - return self.partition.rstrip('0123456789') - - - def get_partition_start_sector(self): - """ - Look up the start sector of the partition. - """ - return self.partition_start - - def get_dev_sector_size(self): - """ - Look up the size of the device's sectors. - """ - return self.dev_sector_size - - def get_partition_size(self): - """ - Look up the size of the partition. - """ - return self.partition_size diff --git a/contrib/askant/fsplugins/__init__.py b/contrib/askant/fsplugins/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/contrib/askant/fsplugins/gfs2/gfs2.c b/contrib/askant/fsplugins/gfs2/gfs2.c deleted file mode 100644 index 7a4d448..0000000 --- a/contrib/askant/fsplugins/gfs2/gfs2.c +++ /dev/null @@ -1,404 +0,0 @@ -/** - * main.c - Functions for parsing the on-disk structure of a GFS2 fs. - * Written by Andrew Price - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void (*report_func)(long int blk, char *type, long int parent, char *fn); - -/* Define how the block information is reported */ -#define report(b,p,t,n) \ - ((*report_func)((long int)b, t, (long int)p,n)) -/* (printf("%lu\t%s\t%lu\t%s\n", (long int)b, t, (long int)p, f)) */ -#define report_data(b,p) report(b,p,"D","") -#define report_leaf(b,p) report(b,p,"L","") -#define report_indir(b,p) report(b,p,"i","") -#define report_inode(b,p,n) report(b,p,"I",n) - -struct blk_extended { - uint64_t parent_blk; - char *fname; - char *blk; -}; - -/* FIXME: A static length block stack is most likely a stupid idea */ -struct blkstack { - int top; - struct blk_extended blocks[1024]; -}; - -struct blkstack blk_stack; -struct gfs2_sb sb; -uint32_t blk_size; -off_t max_seek; -int fd; -int flag_stop; - -/* print_it() is needed to satisfy an extern in libgfs2 */ - -void print_it(const char *label, const char *fmt, const char *fmt2, ...) -{ - va_list args; - - va_start(args, fmt2); - printf("%s = ", label); - vprintf(fmt, args); - printf("\n"); - va_end(args); -} - -/** - * Push a block onto the stack - */ -static void push_blk(char *blk, uint64_t parent, char *fn) -{ - struct blk_extended eblk; - - eblk.blk = blk; - eblk.parent_blk = parent; - eblk.fname = fn; - - blk_stack.top++; - blk_stack.blocks[blk_stack.top] = eblk; -} - -/** - * Initialise the block stack - */ -static int blk_stack_init(void) -{ - blk_stack.top = -1; - return 1; -} - -/** - * Pop a block from the stack - */ -static struct blk_extended pop_blk(void) -{ - return blk_stack.blocks[blk_stack.top--]; -} - -/** - * Read the GFS2 superblock into the global sb variable. - * Returns 1 on error, 0 on success. - */ -static int read_gfs2_sb(void) -{ - off_t offsetsb; - off_t offsetres; - unsigned char buffer[GFS2_BASIC_BLOCK]; - ssize_t readsz; - - offsetsb = GFS2_SB_ADDR * GFS2_BASIC_BLOCK; - offsetres = lseek(fd, offsetsb, SEEK_SET); - - if (offsetres != offsetsb) { - fprintf(stderr, "Could not seek to sb location on device.\n"); - return 0; - } - - readsz = read(fd, buffer, GFS2_BASIC_BLOCK); - if (readsz != GFS2_BASIC_BLOCK) { - fprintf(stderr, "Could not read superblock.\n"); - return 0; - } - - gfs2_sb_in(&sb, (char *)buffer); - if (check_sb(&sb)) { - fprintf(stderr, "Not a GFS2 filesystem.\n"); - return 0; - } - - return 1; -} - -/** - * Read a block. - * blk_offset must be a block number. - * The returned pointer must be free'd. - */ -static char *read_gfs2_blk(off_t blk_offset) -{ - off_t offset; - off_t offsetres; - ssize_t readsz; - char *buffer; - - buffer = (char *)malloc(blk_size); - if (!buffer) { - fprintf(stderr, "Could not allocate memory for block.\n"); - return NULL; - } - - offset = blk_offset * blk_size; - - offsetres = lseek(fd, offset, SEEK_SET); - if (offsetres != offset) { - fprintf(stderr, - "Could not seek to block location: %lu error: %s\n", - (long int)blk_offset, strerror(errno)); - return NULL; - } - - readsz = read(fd, buffer, blk_size); - if (readsz != blk_size) { - fprintf(stderr, "Could not read block: %lu\n", - (long int)blk_offset); - return NULL; - } - - return buffer; -} - -/** - * Look at indirect pointers from a starting point in a block. - */ -static void do_indirect(char *start, uint16_t height, uint64_t parent) -{ - uint64_t ptr; - unsigned int i; - char *blk; - - for (i = 0; i < blk_size; i += sizeof(uint64_t)) { - ptr = be64_to_cpu(*(uint64_t *)(start + i)); - if (ptr > 0 && ptr < (max_seek / blk_size)) { - if (height == 1) { - report_data(ptr, parent); - } else if (height > 1) { - blk = read_gfs2_blk(ptr); - if (blk) { - report_indir(ptr, parent); - do_indirect(blk, height - 1, ptr); - free(blk); - } - } - } else { - break; - } - } -} - -/** - * Parse count number of dirents from a starting point in a block. - */ -static void do_dirents(char *dirents, char *end, uint64_t parent, uint64_t gparent) -{ - struct gfs2_dirent dirent; - char *di_blk; - char *fname; - - while (dirents < end) { - gfs2_dirent_in(&dirent, dirents); - if (dirent.de_inum.no_addr && - dirent.de_inum.no_addr != parent && - dirent.de_inum.no_addr != gparent && - dirent.de_name_len > 0 && - dirent.de_name_len <= GFS2_FNAMESIZE) { - - fname = (char *)malloc(dirent.de_name_len + 1); - if (!fname) { - break; - } - - memcpy(fname, dirents + sizeof(struct gfs2_dirent), - dirent.de_name_len); - fname[dirent.de_name_len] = '\0'; - - di_blk = read_gfs2_blk(dirent.de_inum.no_addr); - if (di_blk) { - push_blk(di_blk, parent, fname); - } - } - dirents += dirent.de_rec_len; - } -} - -/** - * Examine the dirents in a leaf block. - * If the leaf is chained, do the chained leaves too. - */ -static void do_leaf(char *blk, uint64_t parent, uint64_t gparent) -{ - struct gfs2_leaf leaf; - - while (blk) { - gfs2_leaf_in(&leaf, blk); - do_dirents(blk + sizeof(struct gfs2_leaf), blk + blk_size, - parent, gparent); - free(blk); - if (!leaf.lf_next) { - break; - } - - blk = read_gfs2_blk(leaf.lf_next); - } -} - -/** - * Parse leaf pointer data and examine the - * dirents in the destination leaf blocks. - */ -static void do_leaves(char *start, uint64_t parent, uint64_t gparent) -{ - uint64_t ptr; - uint64_t prev; - unsigned int i; - char *blk; - - prev = 0; - for (i = 0; i < blk_size - sizeof(struct gfs2_dinode); - i += sizeof(uint64_t)) { - ptr = be64_to_cpu(*(uint64_t *)(start + i)); - - if (ptr >= (max_seek / blk_size)) { - break; - } - - if (ptr && ptr != prev) { - blk = read_gfs2_blk(ptr); - if (blk) { - report_leaf(ptr, parent); - do_leaf(blk, parent, gparent); - } - prev = ptr; - } - } -} - -/** - * Parse inode data from a block - */ -static void do_inode_blk(char *blk, uint64_t parent, char *fname) -{ - struct gfs2_dinode di; - char *data; - - gfs2_dinode_in(&di, blk); - report_inode(di.di_num.no_addr, parent, fname); - - data = (char *)((struct gfs2_dinode *)blk + 1); - - if (di.di_height > 0) { - /* Indirect pointers */ - do_indirect(data, di.di_height, di.di_num.no_addr); - } else if (S_ISDIR(di.di_mode) && !(di.di_flags & GFS2_DIF_EXHASH)) { - /* Stuffed directory */ - do_dirents(data, blk + blk_size, di.di_num.no_addr, parent); - } else if (S_ISDIR(di.di_mode) && - (di.di_flags & GFS2_DIF_EXHASH) && - !(di.di_height)) { - /* Directory, has hashtable, height == 0 */ - do_leaves(data, di.di_num.no_addr, parent); - } - - /* free previously stacked block */ - free(fname); - free(blk); -} - -/** - * Get the root dir block and parse the fs - * using a stack to keep track of the unvisited - * inode blocks. - */ -static void parse_fs(void) -{ - struct gfs2_inum *root_dir_inum; - struct gfs2_inum *master_dir_inum; - struct blk_extended blk; - char *root_blk; - char *master_blk; - - flag_stop = 0; - - root_dir_inum = &(sb.sb_root_dir); - master_dir_inum = &(sb.sb_master_dir); - - root_blk = read_gfs2_blk(root_dir_inum->no_addr); - master_blk = read_gfs2_blk(master_dir_inum->no_addr); - if (!root_blk || !master_blk) { - return; - } - - push_blk(root_blk, root_dir_inum->no_addr, NULL); - while (blk_stack.top >= 0 && !flag_stop) { - blk = pop_blk(); - do_inode_blk(blk.blk, blk.parent_blk, blk.fname); - } - - push_blk(master_blk, master_dir_inum->no_addr, NULL); - while (blk_stack.top >= 0 && !flag_stop) { - blk = pop_blk(); - /* TODO: Examine each block's magic number instead of assuming - * they're inodes. Omitted for now due to time constraints and - * the number of GFS2_METATYPE_*s which need catering for. - */ - do_inode_blk(blk.blk, blk.parent_blk, blk.fname); - } -} - -/** - * Raise a flag to stop the parse loop cleanly - */ -void gfs2_stop(void) -{ - flag_stop = 1; -} - -/** - * Parse a gfs2 file system on a given device - */ -int gfs2_parse(char *dev, void (*func)(long int b, char *t, long int p, char *f)) -{ - report_func = func; - - if (!blk_stack_init()) { - return 0; - } - - if ((fd = open(dev, O_RDONLY)) < 0) { - return 0; - } - - if (!read_gfs2_sb()) { - close(fd); - return 0; - } - - blk_size = sb.sb_bsize; - max_seek = lseek(fd, 0, SEEK_END); - - parse_fs(); - - close(fd); - - return 1; -} - -/** - * Return the block size of the gfs2 file system on a given device. - */ -uint32_t gfs2_block_size(char *dev) -{ - if ((fd = open(dev, O_RDONLY)) < 0) { - return 0; - } - - if (!read_gfs2_sb()) { - close(fd); - return 0; - } - close(fd); - return sb.sb_bsize; -} diff --git a/contrib/askant/fsplugins/gfs2/gfs2.h b/contrib/askant/fsplugins/gfs2/gfs2.h deleted file mode 100644 index 6c72eb0..0000000 --- a/contrib/askant/fsplugins/gfs2/gfs2.h +++ /dev/null @@ -1,3 +0,0 @@ -uint32_t gfs2_block_size(char *dev); -int gfs2_parse(char *dev, void (*func)(long int b, char *t, long int p, char *f)); -void gfs2_stop(void); diff --git a/contrib/askant/fsplugins/gfs2/gfs2module.c b/contrib/askant/fsplugins/gfs2/gfs2module.c deleted file mode 100644 index c6a0584..0000000 --- a/contrib/askant/fsplugins/gfs2/gfs2module.c +++ /dev/null @@ -1,104 +0,0 @@ -#include - -#include "gfs2.h" - -static PyObject *report_func = NULL; - -void report_func_wrapper(long int blk, char *type, long int parent, char *fn) -{ - PyObject *arglist; - PyObject *result; - - arglist = Py_BuildValue("lsls", blk, type, parent, fn); - if (!arglist) { - return; - } - result = PyEval_CallObject(report_func, arglist); - Py_DECREF(arglist); - if (!result) { - return; - } - Py_DECREF(result); -} - -static PyObject *gfs2_set_report_hook(PyObject *self, PyObject *args) -{ - PyObject *result = NULL; - PyObject *temp; - - if (PyArg_ParseTuple(args, "O:set_callback", &temp)) { - if (!PyCallable_Check(temp)) { - PyErr_SetString(PyExc_TypeError, "parameter must be callable"); - return NULL; - } - Py_XINCREF(temp); - Py_XDECREF(report_func); - report_func = temp; - - Py_INCREF(Py_None); - result = Py_None; - } - return result; -} - -static PyObject *gfs2_parsefs(PyObject *self, PyObject *args) -{ - char *dev; - - if (!PyArg_ParseTuple(args, "s:parsefs", &dev)) { - return NULL; - } - - if (!gfs2_parse(dev, &report_func_wrapper)) { - return PyErr_SetFromErrno(PyExc_IOError); - } - Py_INCREF(Py_None); - - return Py_None; -} - -static PyObject *gfs2_get_block_size(PyObject *self, PyObject *args) -{ - char *dev; - uint32_t blksize; - - if (!PyArg_ParseTuple(args, "s:get_block_size", &dev)) { - return NULL; - } - - blksize = gfs2_block_size(dev); - if (!blksize) { - return PyErr_SetFromErrno(PyExc_IOError); - } - - PyObject *size = Py_BuildValue("I", blksize); - if (!size) { - return NULL; - } - Py_INCREF(size); - return size; -} - -static PyObject *gfs2_handle_sigint(PyObject *signum, PyObject *frame) -{ - gfs2_stop(); - Py_INCREF(Py_None); - return Py_None; -} - -static PyMethodDef GFS2Methods[] = { - {"set_report_hook", gfs2_set_report_hook, METH_VARARGS, - "Specify a hook function through which to report blocks."}, - {"parsefs", gfs2_parsefs, METH_VARARGS, - "Parses the given block device as a GFS2 file system."}, - {"get_block_size", gfs2_get_block_size, METH_VARARGS, - "Returns the file system block size."}, - {"handle_sigint", gfs2_handle_sigint, METH_VARARGS, - "Handles signal SIGINT."}, - {NULL, NULL, 0, NULL} -}; - -PyMODINIT_FUNC initgfs2(void) -{ - (void)Py_InitModule("gfs2", GFS2Methods); -} diff --git a/contrib/askant/scripts/askant b/contrib/askant/scripts/askant deleted file mode 100644 index 3375b0c..0000000 --- a/contrib/askant/scripts/askant +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/bin/env python - -from askant import askant - -if __name__ == '__main__': - askant.main() diff --git a/contrib/askant/setup.py b/contrib/askant/setup.py deleted file mode 100644 index 26c5ca1..0000000 --- a/contrib/askant/setup.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup, Extension -from askant import about - -setup(name="askant", - version=about.version, - description="File system performance analysis tool", - author="Andrew Price", - author_email="andy@andrewprice.me.uk", - url="http://andrewprice.me.uk/projects/askant", - packages = ['askant','askant.fs'], - ext_modules = [Extension("askant.fs.gfs2", - sources = ["fsplugins/gfs2/gfs2module.c","fsplugins/gfs2/gfs2.c"], - libraries = ["gfs2"])], - scripts = ['scripts/askant']) diff --git a/doc/COPYRIGHT b/doc/COPYRIGHT index 5bbfaae..ed6733c 100644 --- a/doc/COPYRIGHT +++ b/doc/COPYRIGHT @@ -5,9 +5,6 @@ Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. Exceptions: -contrib/askant: - Copyright (C) 2008-2009 Andrew Price - gfs2/man/gfs2_mount.8: Portions copyright (C) 2001-2003 The OpenGFS2 Project Portions copyright (C) 2004 From rpeterso@fedoraproject.org Wed Jul 1 19:49:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Wed, 01 Jul 2009 19:49:00 -0000 Subject: gfs1-utils: master - gfs_fsck: Segfault in EA leaf repair Message-ID: <20090701194847.B01DC1201F0@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs1-utils.git?p=gfs1-utils.git;a=commitdiff;h=6ec6f79ce2b87d3d53efea9074f16339e4e66f2c Commit: 6ec6f79ce2b87d3d53efea9074f16339e4e66f2c Parent: fb264df3f0a1932a892a49bf8967da6e4fc613b2 Author: Bob Peterson AuthorDate: Wed Jul 1 14:34:17 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 1 14:48:37 2009 -0500 gfs_fsck: Segfault in EA leaf repair bz 495774 / 507775 --- gfs/gfs_fsck/metawalk.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gfs/gfs_fsck/metawalk.c b/gfs/gfs_fsck/metawalk.c index 104ab7e..b797cca 100644 --- a/gfs/gfs_fsck/metawalk.c +++ b/gfs/gfs_fsck/metawalk.c @@ -411,10 +411,11 @@ static int check_leaf_eattr(struct fsck_inode *ip, uint64_t block, relse_buf(ip->i_sbd, bh); return 1; } - check_eattr_entries(ip, bh, pass); - - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass); relse_buf(ip->i_sbd, bh); + } + return error; } return 0; From rpeterso@fedoraproject.org Wed Jul 1 19:50:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Wed, 01 Jul 2009 19:50:00 -0000 Subject: cluster: STABLE2 - gfs_fsck: Segfault in EA leaf repair Message-ID: <20090701195033.1663B1201F0@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6f93883fe128c365ced47d78838213d62c61a7eb Commit: 6f93883fe128c365ced47d78838213d62c61a7eb Parent: 112985f2b82d3f4665a9720eb744a1fc50ba490e Author: Bob Peterson AuthorDate: Wed Jul 1 14:34:17 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 1 14:37:20 2009 -0500 gfs_fsck: Segfault in EA leaf repair bz 495774 / 507775 --- gfs/gfs_fsck/metawalk.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gfs/gfs_fsck/metawalk.c b/gfs/gfs_fsck/metawalk.c index 64bd519..8667897 100644 --- a/gfs/gfs_fsck/metawalk.c +++ b/gfs/gfs_fsck/metawalk.c @@ -411,10 +411,11 @@ static int check_leaf_eattr(struct fsck_inode *ip, uint64_t block, relse_buf(ip->i_sbd, bh); return 1; } - check_eattr_entries(ip, bh, pass); - - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass); relse_buf(ip->i_sbd, bh); + } + return error; } return 0; From rpeterso@fedoraproject.org Wed Jul 1 19:50:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Wed, 01 Jul 2009 19:50:00 -0000 Subject: cluster: STABLE3 - gfs_fsck: Segfault in EA leaf repair Message-ID: <20090701194945.B66341201F0@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7e29854c15d5f0f0968f3a2e3728643caeec92ae Commit: 7e29854c15d5f0f0968f3a2e3728643caeec92ae Parent: ac92e41653e6a0361168e2b80daee8ede2f21750 Author: Bob Peterson AuthorDate: Wed Jul 1 14:34:17 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 1 14:38:07 2009 -0500 gfs_fsck: Segfault in EA leaf repair bz 495774 / 507775 --- gfs/gfs_fsck/metawalk.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gfs/gfs_fsck/metawalk.c b/gfs/gfs_fsck/metawalk.c index 104ab7e..b797cca 100644 --- a/gfs/gfs_fsck/metawalk.c +++ b/gfs/gfs_fsck/metawalk.c @@ -411,10 +411,11 @@ static int check_leaf_eattr(struct fsck_inode *ip, uint64_t block, relse_buf(ip->i_sbd, bh); return 1; } - check_eattr_entries(ip, bh, pass); - - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass); relse_buf(ip->i_sbd, bh); + } + return error; } return 0; From rpeterso@fedoraproject.org Wed Jul 1 19:51:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Wed, 01 Jul 2009 19:51:00 -0000 Subject: cluster: RHEL54 - gfs_fsck: Segfault in EA leaf repair Message-ID: <20090701195114.24E231201F0@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=704f137b77fce75d27621b1571bbb142696d30d6 Commit: 704f137b77fce75d27621b1571bbb142696d30d6 Parent: ba219de10bab8bc327f83a96f52b98068914def8 Author: Bob Peterson AuthorDate: Wed Jul 1 14:34:17 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 1 14:36:46 2009 -0500 gfs_fsck: Segfault in EA leaf repair bz 495774 / 507775 --- gfs/gfs_fsck/metawalk.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gfs/gfs_fsck/metawalk.c b/gfs/gfs_fsck/metawalk.c index 3279266..2da494d 100644 --- a/gfs/gfs_fsck/metawalk.c +++ b/gfs/gfs_fsck/metawalk.c @@ -423,10 +423,11 @@ static int check_leaf_eattr(struct fsck_inode *ip, uint64_t block, relse_buf(ip->i_sbd, bh); return 1; } - check_eattr_entries(ip, bh, pass); - - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass); relse_buf(ip->i_sbd, bh); + } + return error; } return 0; From rpeterso@fedoraproject.org Wed Jul 1 19:51:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Wed, 01 Jul 2009 19:51:00 -0000 Subject: cluster: RHEL5 - gfs_fsck: Segfault in EA leaf repair Message-ID: <20090701195059.800D01201F5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8df780b532e02acef7f0ebc0113cf96515a7a3b6 Commit: 8df780b532e02acef7f0ebc0113cf96515a7a3b6 Parent: 70dbc6a16de5c2f84ca08c6957f9178fcba3d80d Author: Bob Peterson AuthorDate: Wed Jul 1 14:34:17 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 1 14:34:17 2009 -0500 gfs_fsck: Segfault in EA leaf repair bz 495774 / 507775 --- gfs/gfs_fsck/metawalk.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gfs/gfs_fsck/metawalk.c b/gfs/gfs_fsck/metawalk.c index 3279266..2da494d 100644 --- a/gfs/gfs_fsck/metawalk.c +++ b/gfs/gfs_fsck/metawalk.c @@ -423,10 +423,11 @@ static int check_leaf_eattr(struct fsck_inode *ip, uint64_t block, relse_buf(ip->i_sbd, bh); return 1; } - check_eattr_entries(ip, bh, pass); - - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass); relse_buf(ip->i_sbd, bh); + } + return error; } return 0; From fabbione@fedoraproject.org Wed Jul 1 21:48:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Wed, 01 Jul 2009 21:48:00 -0000 Subject: cluster: the annotated tag cluster-3.0.0.rc4 has been created Message-ID: <20090701214731.3BC651201F0@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=fd0b6d1705db02824c5a59635b2b214c000cf256 Commit: fd0b6d1705db02824c5a59635b2b214c000cf256 Parent: 0000000000000000000000000000000000000000 Author: Fabio M. Di Nitto AuthorDate: 2009-07-01 21:44 +0000 Committer: Fabio M. Di Nitto CommitterDate: 2009-07-01 21:44 +0000 annotated tag: cluster-3.0.0.rc4 has been created at fd0b6d1705db02824c5a59635b2b214c000cf256 (tag) tagging 7e29854c15d5f0f0968f3a2e3728643caeec92ae (commit) replaces cluster-3.0.0.rc3 cluster-3.0.0.rc4 release Bob Peterson (4): GFS2: gfs2_convert, parameter not understood on ppc /sbin/mount.gfs2: can't find /proc/mounts entry for directory / Message printed to stderr instead of stdout gfs_fsck: Segfault in EA leaf repair Christine Caulfield (3): cman: use api->shutdown_request instead of api->request_shutdown cman: Fix some compile-time warning dlm: Fix some compile warnings Fabio M. Di Nitto (17): gfs: kill dead test code gfs2: drop dead test code build: enable fence_xvm by default config: fix warnings in confdb2ldif config: use HDB_X instead of _D gfs: add missing format attributes gfs2: handle output conversion properly gfs2: add missing casts gfs2: make functions static gfs2: backport coding format from master gfs2: resync internationalization support from master cman: port to the latest corosync API cman init: stop qdiskd only if enabled qdiskd: fix log file name cman init: don't stop fence_xvmd if we don't know the status cman init: readd support for fence_xvmd standalone operations Revert "gfs-kernel: enable FS_HAS_FREEZE" Federico Simoncelli (1): rgmanager: Allow vm.sh use of libvirt XML file Jim Meyering (5): src/clulib/ckpt_state.c (ds_key_init_nt): detect failed malloc dlm/tests: handle malloc failure cman: handle malloc failure (i.e., don't deref NULL) dlm_controld: handle heap allocation failure and plug leaks dlm_controld: add comments: mark memory problems Lon Hohberger (42): rgmanager: Fix ptr arithmetic and C90 warnings rgmanager: Fix rg_locks.c build warnings rgmanager: Fix rg_strings.c build warnings rgmanager: Fix members.c and related build warnings rgmanager: Change ccs_read_old_logging to static rgmanager: Fix daemon_init related warnings rgmanager: Remove unused function rgmanager: Remove unused proof-of-concept code rgmanager: Fix build warnings in cman.c rgmanager: Fix build warnings in fdops.c rgmanager: Fix vft.c and related build warnings rgmanager: Fix msgtest.c build warnings rgmanager: Fix complier warnings in msg_cluster.c rgmanager: Fix build warnings in msg_socket.c rgmanager: Fix build warnings in msgtest.c rgmanager: Fix fo_domain.c build warnings rgmanager: Fix fo_domain.c build warnings (part 2) rgmanager: Fix clufindhostname.c build warnings rgmanager: Fix clustat.c build warnings rgmanager: Fix clusvcadm.c build warnings rgmanager: Fix clulog.c build warnings rgmanager: groups.c cleanup rgmanager: Cleanups around main.c rgmanager: Fix reslist.c complier warnings rgmanager: Fix resrules.c compiler warnings rgmanager: Fix restree.c compiler warnings rgmanager: Clean up rg_event.c and related build warnings rgmanager: Fix rg_forward.c build warnings rgmanager: Fix rg_queue.c build warnings rgmanager: Clean up rg_queue.c and related warnings rgmanager: Clean up slang_event.c and related warnings rgmanager: Fix last bits of compiler warnings rgmanager: Fix leaked context on queue fail rgmanager: Fix stop/start race rgmanager: Fix stack overflows on stress testing rgmanager: Fix small memory leak rgmanager: Don't push NULL on to the S/Lang stack rgmanager: Fix error message rgmanager: Fix --debug build fence: Make fence_node return 2 for no fencing rgmanager: follow-service.sl stack cleanup rgmanager: Allow exit while waiting for fencing Marek 'marx' Grac (1): fence_wti: Fence agent for WTI ends with traceback when option is missing Steven Dake (1): fence: Fix missing case in switch statement Steven Whitehouse (1): libgfs2: Use -o meta rather than gfs2meta fs type From fabbione@fedoraproject.org Thu Jul 2 06:57:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 02 Jul 2009 06:57:00 -0000 Subject: cluster: STABLE3 - contrib: Remove askant Message-ID: <20090702065634.57607120320@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d0dfe005116496b59b7093a4ba5658dd8d229fd7 Commit: d0dfe005116496b59b7093a4ba5658dd8d229fd7 Parent: 7e29854c15d5f0f0968f3a2e3728643caeec92ae Author: Fabio M. Di Nitto AuthorDate: Thu Jul 2 08:53:56 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 2 08:53:56 2009 +0200 contrib: Remove askant Askant would be better off maintained in its own git tree. Python's distutils provides a sufficient build system for Python modules and extensions. Splitting out askant into its own tree will allow it to revert to using that simpler system, as well as avoiding dependencies on unnecessary packages. It also means one less package to maintain in gfs2-utils.git. Signed-off-by: Andrew Price Signed-off-by: Fabio M. Di Nitto --- contrib/Makefile | 2 +- contrib/askant/INSTALL | 42 --- contrib/askant/Makefile | 24 -- contrib/askant/PLUGINAPI | 65 ----- contrib/askant/README | 74 ----- contrib/askant/askant/about.py | 5 - contrib/askant/askant/askant.py | 24 -- contrib/askant/askant/blktrace.py | 93 ------- contrib/askant/askant/commands.py | 333 ----------------------- contrib/askant/askant/sysfs.py | 86 ------ contrib/askant/fsplugins/gfs2/gfs2.c | 404 ---------------------------- contrib/askant/fsplugins/gfs2/gfs2.h | 3 - contrib/askant/fsplugins/gfs2/gfs2module.c | 104 ------- contrib/askant/scripts/askant | 6 - contrib/askant/setup.py | 16 -- doc/COPYRIGHT | 3 - 16 files changed, 1 insertions(+), 1283 deletions(-) diff --git a/contrib/Makefile b/contrib/Makefile index 77a4b96..368e035 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -2,5 +2,5 @@ include ../make/defines.mk include $(OBJDIR)/make/passthrough.mk ifdef contrib_code -SUBDIRS=askant libaislock +SUBDIRS=libaislock endif diff --git a/contrib/askant/INSTALL b/contrib/askant/INSTALL deleted file mode 100644 index ce26b82..0000000 --- a/contrib/askant/INSTALL +++ /dev/null @@ -1,42 +0,0 @@ - - How To Install Askant - --------------------- - -o Build Dependencies - - Python - - libgfs2 (part of the Red Hat cluster suite as a static lib) - -o Dependencies - - Python - - blktrace and blkparse with appropriate kernel config options enabled and - debugfs mounted - -o Intro - Askant uses Python's distutils for its standard installation procedure so the - setup.py script provides installation routines. Note that it doesn't provide - uninstallation routines so the best way to install it is to obtain a package - for your particular distribution and install that. - -o Installation - To install askant to the default location on your system, run as root: - - ./setup.py install - - If you wish to install it to a different root directory (e.g. /var/mychroot) - or prefix directory (e.g. /usr/local instead of /usr) see: - - ./setup.py install --help - - To find out everything else setup.py can do: - - ./setup.py --help-commands - -o Use Without Installing - To use askant without installing it (e.g. if you want to test patches - quickly) it is necessary to carry out the build stage to compile the required - plugins. Do: - - ./setup.py build - cd build/lib* - python askant/askant.py - diff --git a/contrib/askant/Makefile b/contrib/askant/Makefile deleted file mode 100644 index 9ba53df..0000000 --- a/contrib/askant/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -include ../../make/defines.mk - -all: build - -include $(OBJDIR)/make/clean.mk - -CFLAGS += -I$(SRCDIR)/gfs2/libgfs2 -CFLAGS += -I$(SRCDIR)/gfs2/include - -LDFLAGS += -L$(OBJDIR)/gfs2/libgfs2 - -build: - CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" python $(S)/setup.py build - -install: - python $(S)/setup.py install --root $(DESTDIR) - -uninstall: - @echo UNINSTALL TARGET UNSUPPORTED - -clean: - python $(S)/setup.py clean - rm -rf askant/*.pyc - rm -rf build diff --git a/contrib/askant/PLUGINAPI b/contrib/askant/PLUGINAPI deleted file mode 100644 index 4c2eceb..0000000 --- a/contrib/askant/PLUGINAPI +++ /dev/null @@ -1,65 +0,0 @@ - - Writing File System Plugins for Askant - -------------------------------------- - -0. Contents - - 1. Intro - 2. API - 3. Reference - - -1. Intro - -In order to gather file system data with which to enhance the data provided by -blktrace, there must be specific code written for each file system type we wish -to support. This is where file system plugins come along. The plugins must -basically traverse an on-disk file system structure on a block device and report -back their findings through a callback handed to them by askant. They must also -expose a function which stops their traversal loop in case askant wishes to stop -their execution prematurely. - - -2. API - -A file system plugin must be written as a Python module. This means that C, C++ -and Python are suitable languages to write them in. They must expose a number of -Python functions to askant: - -parsefs(dev) - - This function is called when askant wants the plugin to parse the file - system on the device specified by the device, dev. - -get_block_size() - - This function is called to ascertain the file system block size which is - required in order to map the disk sector numbers provided by blktrace to - file system block numbers. It takes no arguments and should return a Python - integer value. - -set_report_hook(func) - - This function is called to pass in a report function which the plugin should - call to report the details of a file system block. func is a function which - accepts four arguments in this order: - - Block number: a Python long integer - Block type: a Python string - Block number of parent: a Python long integer - Block file name: a Python string (should be "" for non-inode blocks) - -handle_sigint() - - This function should make the plugin stop its parsing loop. This allows it - to be interrupted if askant catches a signal, for example. It takes no - arguments and its return value is not used. - - -3. Reference - -o See fsplugins/gfs2/gfs2module.c for an example of writing a Python fs plugin - module in C. - -o http://www.python.org/doc/ext/intro.html shows how to extend Python with C or - C++. diff --git a/contrib/askant/README b/contrib/askant/README deleted file mode 100644 index 74e3219..0000000 --- a/contrib/askant/README +++ /dev/null @@ -1,74 +0,0 @@ - - Askant - A Block I/O Analysis Tool - ---------------------------------- - -0. Contents - - 1. Intro - 2. Commands and their options - 3. Examples - - -1. Intro - -Askant allows you to gather file system block I/O data for performance analysis. -It uses blktrace to trace block operations and adds file system specific data by -parsing fs block information straight from the storage device. To do this it -invokes functionality from file system parser plugins which traverse the on-disk -structures and report details of the blocks they encounter through callbacks. - -Usage: askant [options...] - -o See 'askant --commands' for a full list of commands. - - -2. Commands and their options - - dumpfs - - Dumps the block data provided by an fs plugin from the given file system. - - -d The block device which contains the file system under scrutiny - -t The type of the file system, i.e. the name of the fs plugin to load - -o Output file (optional). Stdout is used if '-' or omitted. - (Note that the output file should be on a different device to the one - specified with -d.) - - unlinks - - Does a dumpfs and runs blktrace until interrupted. It then blkparses the - blktrace data and adds the block data. This is suitable for tracing I/O - operations during an unlink test run. - - -d The block device which contains the file system under scrutiny - -t The type of the file system, i.e. the name of the fs plugin to load - -g The path to the debugfs mount point, defaults to /sys/kernel/debug - -D The directory in which to store the block dumps and blktrace files. - - creates - - Runs blktrace until interrupted. It then does a dumpfs and blkparses the - blktrace data and adds the block data. This is suitable for tracing I/O - operations during a file creation test run. - - -d The block device which contains the file system under scrutiny - -t The type of the file system, i.e. the name of the fs plugin to load - -g The path to the debugfs mount point, defaults to /sys/kernel/debug - -D The directory in which to store the block dumps and blktrace files. - -3. Examples - -o Parse the file system and dump information about each block to stdout e.g.: - - # askant dumpfs -t gfs2 -d /dev/sda3 - -o Trace 'unlinks' by dumping block information before the blktrace and matching - block data to provide a more detailed blkparse output e.g.: - - # askant unlinks -t gfs2 -d /dev/sda3 -D /tmp/dir -g /mnt/debugfs - -o Trace 'creates' by dumping block information after the blktrace and matching - block data to provide a more detailed blkparse output e.g.: - - # askant creates -t gfs2 -d /dev/sda3 -D /tmp/dir -g /mnt/debugfs - diff --git a/contrib/askant/askant/__init__.py b/contrib/askant/askant/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/contrib/askant/askant/about.py b/contrib/askant/askant/about.py deleted file mode 100644 index 3d40a74..0000000 --- a/contrib/askant/askant/about.py +++ /dev/null @@ -1,5 +0,0 @@ -""" -Version information for askant. -""" - -version = "0.0.1" diff --git a/contrib/askant/askant/askant.py b/contrib/askant/askant/askant.py deleted file mode 100644 index a4376b6..0000000 --- a/contrib/askant/askant/askant.py +++ /dev/null @@ -1,24 +0,0 @@ -""" -The main entry point for askant. -""" - -import sys -import commands - -def main(): - - """Run askant""" - - cmds = commands.Commands() - cmds.register_command(commands.DumpFSCommand()) - cmds.register_command(commands.UnlinksCommand()) - cmds.register_command(commands.CreatesCommand()) - - try: - cmds.process_argv(sys.argv) - except commands.NoFSPluginException, p: - print >>sys.stderr, "Plugin not found: %s" %p - - -if __name__ == '__main__': - main() diff --git a/contrib/askant/askant/blktrace.py b/contrib/askant/askant/blktrace.py deleted file mode 100644 index fdf0219..0000000 --- a/contrib/askant/askant/blktrace.py +++ /dev/null @@ -1,93 +0,0 @@ -""" -Wrapper classes for running blktrace and blkparse and using their output -""" - -import os -import sys -import time -import signal -from subprocess import Popen -from subprocess import PIPE -from sysfs import Sysfs - -class BlktraceException(Exception): - - def __init__(self, val, msg): - Exception.__init__(self) - self.val = val - self.msg = msg - - def __str__(self): - return self.msg - -class Blktrace: - - def __init__(self, dev, debugfs='/sys/kernel/debug'): - self.dev = dev - self.debugfs = debugfs - self.sysfs = Sysfs(dev) - self.btpid = -1 - - def handle_sigint(self, sig, frame): - if self.btpid >= 0: - os.kill(self.btpid, signal.SIGTERM) - - def trace(self, tracefile): - - if not self.dev: - raise Exception("No device specified.") - - btargs = ['blktrace', - '-d', self.dev, - '-r', self.debugfs, - '-o', tracefile] - - blktrace = Popen(btargs, bufsize=1, stdout=PIPE, - stderr=open('/dev/null','w')) - self.btpid = blktrace.pid - btres = None - while btres is None: - time.sleep(1) - btres = blktrace.poll() - - self.btpid = -1 - if btres: - raise BlktraceException(btres, - 'blktrace exited with code ' + str(btres)) - - - - def parse(self, tracefile, getblk): - - if not self.dev: - raise Exception("No device specified.") - - offset = self.sysfs.get_partition_start_sector() - - bpargs = ['blkparse', '-i', tracefile] - blkparse = Popen(bpargs, bufsize=1, stdout=PIPE) - - bpres = None - while bpres is None: - output = blkparse.stdout.readline().strip() - if output: - chunks = output.split() - try: - # chunks[7] is the sector number - blk = list(getblk(int(chunks[7]))) - print "%s %s %s" %\ - (' '.join(blk[0:3]),\ - output.strip(), - blk[3].strip()) - except KeyError: - pass - except ValueError: - pass - - bpres = blkparse.poll() - - if bpres: - raise BlktraceException(bpres, - 'blkparse exited with code ' + str(bpres)) - - diff --git a/contrib/askant/askant/commands.py b/contrib/askant/askant/commands.py deleted file mode 100644 index ad4639f..0000000 --- a/contrib/askant/askant/commands.py +++ /dev/null @@ -1,333 +0,0 @@ -"""Command line parsing and processing for askant""" - -import fs -import os -import sys -import time -import about -import signal -import tempfile -from sysfs import Sysfs, SysfsException -from blktrace import Blktrace, BlktraceException -from optparse import OptionParser, make_option - -class NoFSPluginException(Exception): - - """A generic Exception class for when file system plugins are missing""" - - pass # Nothing special about this exception - -class Commands: - - """Provides a convenient interface to the askant commands""" - - def __init__(self): - - self.commands = {} - self.parser = OptionParser(usage="%prog COMMAND [options]", - version=about.version) - - - def register_command(self, command): - self.commands[str(command)] = command - - def __lookup_command(self, command): - try: - return self.commands[command] - except KeyError, k: - return DefaultCommand() - - def __parse_command(self, command, argv): - self.parser.prog = "%s %s" %\ - (self.parser.get_prog_name(), str(command)) - self.parser.set_usage(command.get_usage()) - optlst = command.get_options() - for o in optlst: - self.parser.add_option(o) - self.parser.set_description(command.get_help()) - - if str(command) != "": - argv = argv[1:] - - return self.parser.parse_args(argv) - - def process_argv(self, argv): - try: - command = self.__lookup_command(argv[1]) - except IndexError, i: - # This exits - self.parser.error("No command specified. Try --help") - - options, args = self.__parse_command(command, argv[1:]) - - command.do_command(options, args, self) - -class Command: - def __init__(self): - self.options = [] - -class DefaultCommand(Command): - def __str__(self): - return "" - - def get_options(self): - self.options.append(make_option("-c","--commands", - action="store_true", - help="Lists available commands")) - return self.options - - def get_usage(self): - return "%prog COMMAND [options] [args]" - - def get_help(self): - return "Askant is a tool for tracing I/O activity in Linux "\ - "and adding extra file system context by "\ - "parsing file system data directly." - - def do_command(self, options, args, base): - if options.commands: - base.parser.print_usage() - print "Available commands:" - keys = base.commands.keys() - keys.sort() - for k in keys: - print " %10s %s" %\ - (k, base.commands[k].get_help()) - print "" - print "For command-specific help, use "\ - "%sCOMMAND --help" % base.parser.get_prog_name() - else: - base.parser.error("Command not found. Try --commands") - - -class FSCommandTemplate(Command): - def __init__(self): - self.fsmod = None - self.block_table = {} - self.block_func = self.__report_hook - self.sector_size = None - self.offset = None - self.options = [ - make_option("-d","--device", metavar="DEVICE", - help="The device to analyse."), - ] - - def load_fs_plugin(self, fsname): - try: - self.fsmod = __import__("fs." + fsname, - globals(), locals(), ["fs"]) - except ImportError, i: - raise NoFSPluginException(fsname) - - def parse_fs(self, dev, hook=None): - if hook is None: - hook = self.block_func - - sfs = Sysfs(dev) - offset = sfs.get_partition_start_sector() - sector_size = sfs.get_dev_sector_size() - - self.fsmod.set_report_hook(hook) - - try: - sfs = Sysfs(dev) - self.offset = sfs.get_partition_start_sector() - self.sector_size = sfs.get_dev_sector_size() - signal.signal(signal.SIGINT, self.fsmod.handle_sigint) - self.blk_size = self.fsmod.get_block_size(dev) - self.fsmod.parsefs(dev) - signal.signal(signal.SIGINT, signal.SIG_DFL) - except IOError, i: - print >>sys.stderr, str(i) - sys.exit(1) - - def set_outfile(self, outfile): - self.outfile = outfile - - def trace(self, options, dump_before): - - sfs = Sysfs(options.device) - self.offset = sfs.get_partition_start_sector() - self.sector_size = sfs.get_dev_sector_size() - - tmstamp = time.strftime('%Y%m%d%H%M%S') - self.block_func = self.__report_hook - try: - self.outfile = open(os.path.join(options.outdir, "blocks-%s" % - tmstamp), 'w') - except IOError, e: - print >>sys.stderr, str(e) - sys.exit(1) - - if dump_before: - print >>sys.stderr, "Gathering block data..." - self.parse_fs(options.device) - self.outfile.close() - - if options.debugfs: - bt = Blktrace(options.device, options.debugfs) - else: - bt = Blktrace(options.device) - - os.chdir(options.outdir) # Blktrace doesn't use absolute paths - print >>sys.stderr, "Tracing. Hit Ctrl-C to end..." - try: - signal.signal(signal.SIGINT, bt.handle_sigint) - bt.trace(tmstamp) - signal.signal(signal.SIGINT, signal.SIG_DFL) - except BlktraceException, b: - signal.signal(signal.SIGINT, signal.SIG_DFL) - print >>sys.stderr, str(b) - sys.exit(1) - - if not dump_before: - print >>sys.stderr, "Gathering block data..." - self.parse_fs(options.device) - self.outfile.close() - - print >>sys.stderr, "Matching blocks..." - blockdb = open(self.outfile.name, 'r') - blocks = {} - for l in blockdb.readlines(): - s = l.split('\t') - blocks[int(s[0])] = tuple(s[1:]) - - bt.parse(os.path.join(options.outdir, tmstamp), blocks.__getitem__) - blockdb.close() - - def __report_hook(self, blk, type, parent, fn): - if not fn: - fn = "" - try: - self.outfile.write("%d\t%d\t%s\t%d\t\"%s\"\n" % ( - ((blk * self.blk_size)/self.sector_size) + self.offset, - blk, type, parent, fn)) - except Exception, e: - print str(e) - - def __dict_hook(self, blk, type, parent, fn): - self.block_table[ - ((blk * self.blk_size)/self.sector_size)+self.offset] =\ - (blk, type, parent, fn) - - -class DumpFSCommand(FSCommandTemplate): - def __str__(self): - return "dumpfs" - - def get_options(self): - self.options.append(make_option("-t","--type", metavar="FSTYPE", - help="The type of file system on the device.")) - self.options.append(make_option("-o","--output", metavar="FILE", - default="-", - help="File to write output to or '-' for stdout " - "(default)")) - return self.options - - def get_usage(self): - return "%prog [options]" - - def get_help(self): - return "Dump fs block information in TSV format." - - def do_command(self, options, args, base): - - if not options.device: - base.parser.error("No device specified. Use -d.") - - if not options.type: - base.parser.error("No file system type specified. " - "Use -t.") - try: - if options.output != "-": - self.set_outfile(open(options.output, 'w')) - else: - self.set_outfile(sys.stdout) - except IOError, e: - print >>sys.stderr,\ - "Unable to open file for writing: %s" %\ - options.output - return - except KeyError: - pass - - self.load_fs_plugin(options.type) - try: - self.parse_fs(options.device) - except SysfsException, s: - base.parser.error(s) - -class UnlinksCommand(FSCommandTemplate): - def __str__(self): - return "unlinks" - - def get_options(self): - self.options.append(make_option("-t","--type", metavar="FSTYPE", - help="The type of file system on the device.")) - self.options.append(make_option("-g","--debugfs", metavar="PATH", - default="/sys/kernel/debug", - help="The path to the debugfs mountpoint. Default " - "/sys/kernel/debug")) - self.options.append(make_option("-D","--outdir", metavar="DIR", - help="Directory to write output to. Required.")) - return self.options - - def get_usage(self): - return "%prog [options]" - - def get_help(self): - return "Trace block I/O activity during unlink tests." - - def do_command(self, options, args, base): - if not options.device: - base.parser.error("No device specified. Use -d.") - - self.device = options.device - - if not options.type: - base.parser.error("No file system type specified. " - "Use -t.") - if not options.outdir: - base.parser.error("No output directory specified. " - "Use -D.") - - self.load_fs_plugin(options.type) - self.trace(options, dump_before=True) - -class CreatesCommand(FSCommandTemplate): - def __str__(self): - return "creates" - - def get_options(self): - self.options.append(make_option("-t","--type", metavar="FSTYPE", - help="The type of file system on the device.")) - self.options.append(make_option("-g","--debugfs", metavar="PATH", - default="/sys/kernel/debug", - help="The path to the debugfs mountpoint. Default " - "/sys/kernel/debug")) - self.options.append(make_option("-D","--outdir", metavar="DIR", - help="Directory to write output to. Required.")) - return self.options - - def get_usage(self): - return "%prog [options]" - - def get_help(self): - return "Trace block I/O activity during create tests." - - def do_command(self, options, args, base): - if not options.device: - base.parser.error("No device specified. Use -d.") - - self.device = options.device - - if not options.type: - base.parser.error("No file system type specified. " - "Use -t.") - if not options.outdir: - base.parser.error("No output directory specified. " - "Use -D.") - - self.load_fs_plugin(options.type) - self.trace(options, dump_before=False) - diff --git a/contrib/askant/askant/fs/__init__.py b/contrib/askant/askant/fs/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/contrib/askant/askant/sysfs.py b/contrib/askant/askant/sysfs.py deleted file mode 100644 index 12b7a3b..0000000 --- a/contrib/askant/askant/sysfs.py +++ /dev/null @@ -1,86 +0,0 @@ -""" -Provides access to sysfs data pertaining to storage partitions. -""" - -import os -import os.path - -class SysfsException(Exception): - """ - An exception which is raised when things go wrong with Sysfs. - """ - pass # No functionality to add over Exception class - -class Sysfs: - """ - Provides access to sysfs data pertaining to storage partitions. - """ - def __init__(self, partition, sysfs_path='/sys'): - """ - Instantiate a Sysfs object. partition should be a path to a - disc partition device e.g. /dev/sda3. - """ - self.partition = partition - self.device = self.__partition2parent() - self.sysfs_path = sysfs_path - line = self.__firstline(os.path.join( - sysfs_path,'block', - os.path.split(self.device)[1], - os.path.split(self.partition)[1], - 'start')) - self.partition_start = int(line) - line = self.__firstline(os.path.join( - sysfs_path,'block', - os.path.split(self.device)[1], - 'queue', - 'hw_sector_size')) - self.dev_sector_size = int(line) - line = self.__firstline(os.path.join( - sysfs_path,'block', - os.path.split(self.device)[1], - os.path.split(self.partition)[1], - 'size')) - self.partition_size = int(line) - - def __firstline(self, fname): - """ - Read the first line of a file - """ - try: - fobj = open(fname, 'r') - except IOError: - raise SysfsException( - 'Could not open file "%s" for reading. Please ' - 'check your kernel is 2.6.25 or later and ' - 'sysfs is mounted.' % fname) - line = fobj.readline() - fobj.close() - return line - - def __partition2parent(self): - """ - Return the name of a partition device's parent device - e.g. /dev/sda3 -> /dev/sda - """ - # This may need thinking about a bit more - - # nothing in life can be this simple. - return self.partition.rstrip('0123456789') - - - def get_partition_start_sector(self): - """ - Look up the start sector of the partition. - """ - return self.partition_start - - def get_dev_sector_size(self): - """ - Look up the size of the device's sectors. - """ - return self.dev_sector_size - - def get_partition_size(self): - """ - Look up the size of the partition. - """ - return self.partition_size diff --git a/contrib/askant/fsplugins/__init__.py b/contrib/askant/fsplugins/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/contrib/askant/fsplugins/gfs2/gfs2.c b/contrib/askant/fsplugins/gfs2/gfs2.c deleted file mode 100644 index 7a4d448..0000000 --- a/contrib/askant/fsplugins/gfs2/gfs2.c +++ /dev/null @@ -1,404 +0,0 @@ -/** - * main.c - Functions for parsing the on-disk structure of a GFS2 fs. - * Written by Andrew Price - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void (*report_func)(long int blk, char *type, long int parent, char *fn); - -/* Define how the block information is reported */ -#define report(b,p,t,n) \ - ((*report_func)((long int)b, t, (long int)p,n)) -/* (printf("%lu\t%s\t%lu\t%s\n", (long int)b, t, (long int)p, f)) */ -#define report_data(b,p) report(b,p,"D","") -#define report_leaf(b,p) report(b,p,"L","") -#define report_indir(b,p) report(b,p,"i","") -#define report_inode(b,p,n) report(b,p,"I",n) - -struct blk_extended { - uint64_t parent_blk; - char *fname; - char *blk; -}; - -/* FIXME: A static length block stack is most likely a stupid idea */ -struct blkstack { - int top; - struct blk_extended blocks[1024]; -}; - -struct blkstack blk_stack; -struct gfs2_sb sb; -uint32_t blk_size; -off_t max_seek; -int fd; -int flag_stop; - -/* print_it() is needed to satisfy an extern in libgfs2 */ - -void print_it(const char *label, const char *fmt, const char *fmt2, ...) -{ - va_list args; - - va_start(args, fmt2); - printf("%s = ", label); - vprintf(fmt, args); - printf("\n"); - va_end(args); -} - -/** - * Push a block onto the stack - */ -static void push_blk(char *blk, uint64_t parent, char *fn) -{ - struct blk_extended eblk; - - eblk.blk = blk; - eblk.parent_blk = parent; - eblk.fname = fn; - - blk_stack.top++; - blk_stack.blocks[blk_stack.top] = eblk; -} - -/** - * Initialise the block stack - */ -static int blk_stack_init(void) -{ - blk_stack.top = -1; - return 1; -} - -/** - * Pop a block from the stack - */ -static struct blk_extended pop_blk(void) -{ - return blk_stack.blocks[blk_stack.top--]; -} - -/** - * Read the GFS2 superblock into the global sb variable. - * Returns 1 on error, 0 on success. - */ -static int read_gfs2_sb(void) -{ - off_t offsetsb; - off_t offsetres; - unsigned char buffer[GFS2_BASIC_BLOCK]; - ssize_t readsz; - - offsetsb = GFS2_SB_ADDR * GFS2_BASIC_BLOCK; - offsetres = lseek(fd, offsetsb, SEEK_SET); - - if (offsetres != offsetsb) { - fprintf(stderr, "Could not seek to sb location on device.\n"); - return 0; - } - - readsz = read(fd, buffer, GFS2_BASIC_BLOCK); - if (readsz != GFS2_BASIC_BLOCK) { - fprintf(stderr, "Could not read superblock.\n"); - return 0; - } - - gfs2_sb_in(&sb, (char *)buffer); - if (check_sb(&sb)) { - fprintf(stderr, "Not a GFS2 filesystem.\n"); - return 0; - } - - return 1; -} - -/** - * Read a block. - * blk_offset must be a block number. - * The returned pointer must be free'd. - */ -static char *read_gfs2_blk(off_t blk_offset) -{ - off_t offset; - off_t offsetres; - ssize_t readsz; - char *buffer; - - buffer = (char *)malloc(blk_size); - if (!buffer) { - fprintf(stderr, "Could not allocate memory for block.\n"); - return NULL; - } - - offset = blk_offset * blk_size; - - offsetres = lseek(fd, offset, SEEK_SET); - if (offsetres != offset) { - fprintf(stderr, - "Could not seek to block location: %lu error: %s\n", - (long int)blk_offset, strerror(errno)); - return NULL; - } - - readsz = read(fd, buffer, blk_size); - if (readsz != blk_size) { - fprintf(stderr, "Could not read block: %lu\n", - (long int)blk_offset); - return NULL; - } - - return buffer; -} - -/** - * Look at indirect pointers from a starting point in a block. - */ -static void do_indirect(char *start, uint16_t height, uint64_t parent) -{ - uint64_t ptr; - unsigned int i; - char *blk; - - for (i = 0; i < blk_size; i += sizeof(uint64_t)) { - ptr = be64_to_cpu(*(uint64_t *)(start + i)); - if (ptr > 0 && ptr < (max_seek / blk_size)) { - if (height == 1) { - report_data(ptr, parent); - } else if (height > 1) { - blk = read_gfs2_blk(ptr); - if (blk) { - report_indir(ptr, parent); - do_indirect(blk, height - 1, ptr); - free(blk); - } - } - } else { - break; - } - } -} - -/** - * Parse count number of dirents from a starting point in a block. - */ -static void do_dirents(char *dirents, char *end, uint64_t parent, uint64_t gparent) -{ - struct gfs2_dirent dirent; - char *di_blk; - char *fname; - - while (dirents < end) { - gfs2_dirent_in(&dirent, dirents); - if (dirent.de_inum.no_addr && - dirent.de_inum.no_addr != parent && - dirent.de_inum.no_addr != gparent && - dirent.de_name_len > 0 && - dirent.de_name_len <= GFS2_FNAMESIZE) { - - fname = (char *)malloc(dirent.de_name_len + 1); - if (!fname) { - break; - } - - memcpy(fname, dirents + sizeof(struct gfs2_dirent), - dirent.de_name_len); - fname[dirent.de_name_len] = '\0'; - - di_blk = read_gfs2_blk(dirent.de_inum.no_addr); - if (di_blk) { - push_blk(di_blk, parent, fname); - } - } - dirents += dirent.de_rec_len; - } -} - -/** - * Examine the dirents in a leaf block. - * If the leaf is chained, do the chained leaves too. - */ -static void do_leaf(char *blk, uint64_t parent, uint64_t gparent) -{ - struct gfs2_leaf leaf; - - while (blk) { - gfs2_leaf_in(&leaf, blk); - do_dirents(blk + sizeof(struct gfs2_leaf), blk + blk_size, - parent, gparent); - free(blk); - if (!leaf.lf_next) { - break; - } - - blk = read_gfs2_blk(leaf.lf_next); - } -} - -/** - * Parse leaf pointer data and examine the - * dirents in the destination leaf blocks. - */ -static void do_leaves(char *start, uint64_t parent, uint64_t gparent) -{ - uint64_t ptr; - uint64_t prev; - unsigned int i; - char *blk; - - prev = 0; - for (i = 0; i < blk_size - sizeof(struct gfs2_dinode); - i += sizeof(uint64_t)) { - ptr = be64_to_cpu(*(uint64_t *)(start + i)); - - if (ptr >= (max_seek / blk_size)) { - break; - } - - if (ptr && ptr != prev) { - blk = read_gfs2_blk(ptr); - if (blk) { - report_leaf(ptr, parent); - do_leaf(blk, parent, gparent); - } - prev = ptr; - } - } -} - -/** - * Parse inode data from a block - */ -static void do_inode_blk(char *blk, uint64_t parent, char *fname) -{ - struct gfs2_dinode di; - char *data; - - gfs2_dinode_in(&di, blk); - report_inode(di.di_num.no_addr, parent, fname); - - data = (char *)((struct gfs2_dinode *)blk + 1); - - if (di.di_height > 0) { - /* Indirect pointers */ - do_indirect(data, di.di_height, di.di_num.no_addr); - } else if (S_ISDIR(di.di_mode) && !(di.di_flags & GFS2_DIF_EXHASH)) { - /* Stuffed directory */ - do_dirents(data, blk + blk_size, di.di_num.no_addr, parent); - } else if (S_ISDIR(di.di_mode) && - (di.di_flags & GFS2_DIF_EXHASH) && - !(di.di_height)) { - /* Directory, has hashtable, height == 0 */ - do_leaves(data, di.di_num.no_addr, parent); - } - - /* free previously stacked block */ - free(fname); - free(blk); -} - -/** - * Get the root dir block and parse the fs - * using a stack to keep track of the unvisited - * inode blocks. - */ -static void parse_fs(void) -{ - struct gfs2_inum *root_dir_inum; - struct gfs2_inum *master_dir_inum; - struct blk_extended blk; - char *root_blk; - char *master_blk; - - flag_stop = 0; - - root_dir_inum = &(sb.sb_root_dir); - master_dir_inum = &(sb.sb_master_dir); - - root_blk = read_gfs2_blk(root_dir_inum->no_addr); - master_blk = read_gfs2_blk(master_dir_inum->no_addr); - if (!root_blk || !master_blk) { - return; - } - - push_blk(root_blk, root_dir_inum->no_addr, NULL); - while (blk_stack.top >= 0 && !flag_stop) { - blk = pop_blk(); - do_inode_blk(blk.blk, blk.parent_blk, blk.fname); - } - - push_blk(master_blk, master_dir_inum->no_addr, NULL); - while (blk_stack.top >= 0 && !flag_stop) { - blk = pop_blk(); - /* TODO: Examine each block's magic number instead of assuming - * they're inodes. Omitted for now due to time constraints and - * the number of GFS2_METATYPE_*s which need catering for. - */ - do_inode_blk(blk.blk, blk.parent_blk, blk.fname); - } -} - -/** - * Raise a flag to stop the parse loop cleanly - */ -void gfs2_stop(void) -{ - flag_stop = 1; -} - -/** - * Parse a gfs2 file system on a given device - */ -int gfs2_parse(char *dev, void (*func)(long int b, char *t, long int p, char *f)) -{ - report_func = func; - - if (!blk_stack_init()) { - return 0; - } - - if ((fd = open(dev, O_RDONLY)) < 0) { - return 0; - } - - if (!read_gfs2_sb()) { - close(fd); - return 0; - } - - blk_size = sb.sb_bsize; - max_seek = lseek(fd, 0, SEEK_END); - - parse_fs(); - - close(fd); - - return 1; -} - -/** - * Return the block size of the gfs2 file system on a given device. - */ -uint32_t gfs2_block_size(char *dev) -{ - if ((fd = open(dev, O_RDONLY)) < 0) { - return 0; - } - - if (!read_gfs2_sb()) { - close(fd); - return 0; - } - close(fd); - return sb.sb_bsize; -} diff --git a/contrib/askant/fsplugins/gfs2/gfs2.h b/contrib/askant/fsplugins/gfs2/gfs2.h deleted file mode 100644 index 6c72eb0..0000000 --- a/contrib/askant/fsplugins/gfs2/gfs2.h +++ /dev/null @@ -1,3 +0,0 @@ -uint32_t gfs2_block_size(char *dev); -int gfs2_parse(char *dev, void (*func)(long int b, char *t, long int p, char *f)); -void gfs2_stop(void); diff --git a/contrib/askant/fsplugins/gfs2/gfs2module.c b/contrib/askant/fsplugins/gfs2/gfs2module.c deleted file mode 100644 index c6a0584..0000000 --- a/contrib/askant/fsplugins/gfs2/gfs2module.c +++ /dev/null @@ -1,104 +0,0 @@ -#include - -#include "gfs2.h" - -static PyObject *report_func = NULL; - -void report_func_wrapper(long int blk, char *type, long int parent, char *fn) -{ - PyObject *arglist; - PyObject *result; - - arglist = Py_BuildValue("lsls", blk, type, parent, fn); - if (!arglist) { - return; - } - result = PyEval_CallObject(report_func, arglist); - Py_DECREF(arglist); - if (!result) { - return; - } - Py_DECREF(result); -} - -static PyObject *gfs2_set_report_hook(PyObject *self, PyObject *args) -{ - PyObject *result = NULL; - PyObject *temp; - - if (PyArg_ParseTuple(args, "O:set_callback", &temp)) { - if (!PyCallable_Check(temp)) { - PyErr_SetString(PyExc_TypeError, "parameter must be callable"); - return NULL; - } - Py_XINCREF(temp); - Py_XDECREF(report_func); - report_func = temp; - - Py_INCREF(Py_None); - result = Py_None; - } - return result; -} - -static PyObject *gfs2_parsefs(PyObject *self, PyObject *args) -{ - char *dev; - - if (!PyArg_ParseTuple(args, "s:parsefs", &dev)) { - return NULL; - } - - if (!gfs2_parse(dev, &report_func_wrapper)) { - return PyErr_SetFromErrno(PyExc_IOError); - } - Py_INCREF(Py_None); - - return Py_None; -} - -static PyObject *gfs2_get_block_size(PyObject *self, PyObject *args) -{ - char *dev; - uint32_t blksize; - - if (!PyArg_ParseTuple(args, "s:get_block_size", &dev)) { - return NULL; - } - - blksize = gfs2_block_size(dev); - if (!blksize) { - return PyErr_SetFromErrno(PyExc_IOError); - } - - PyObject *size = Py_BuildValue("I", blksize); - if (!size) { - return NULL; - } - Py_INCREF(size); - return size; -} - -static PyObject *gfs2_handle_sigint(PyObject *signum, PyObject *frame) -{ - gfs2_stop(); - Py_INCREF(Py_None); - return Py_None; -} - -static PyMethodDef GFS2Methods[] = { - {"set_report_hook", gfs2_set_report_hook, METH_VARARGS, - "Specify a hook function through which to report blocks."}, - {"parsefs", gfs2_parsefs, METH_VARARGS, - "Parses the given block device as a GFS2 file system."}, - {"get_block_size", gfs2_get_block_size, METH_VARARGS, - "Returns the file system block size."}, - {"handle_sigint", gfs2_handle_sigint, METH_VARARGS, - "Handles signal SIGINT."}, - {NULL, NULL, 0, NULL} -}; - -PyMODINIT_FUNC initgfs2(void) -{ - (void)Py_InitModule("gfs2", GFS2Methods); -} diff --git a/contrib/askant/scripts/askant b/contrib/askant/scripts/askant deleted file mode 100644 index 3375b0c..0000000 --- a/contrib/askant/scripts/askant +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/bin/env python - -from askant import askant - -if __name__ == '__main__': - askant.main() diff --git a/contrib/askant/setup.py b/contrib/askant/setup.py deleted file mode 100644 index 26c5ca1..0000000 --- a/contrib/askant/setup.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python - -from distutils.core import setup, Extension -from askant import about - -setup(name="askant", - version=about.version, - description="File system performance analysis tool", - author="Andrew Price", - author_email="andy@andrewprice.me.uk", - url="http://andrewprice.me.uk/projects/askant", - packages = ['askant','askant.fs'], - ext_modules = [Extension("askant.fs.gfs2", - sources = ["fsplugins/gfs2/gfs2module.c","fsplugins/gfs2/gfs2.c"], - libraries = ["gfs2"])], - scripts = ['scripts/askant']) diff --git a/doc/COPYRIGHT b/doc/COPYRIGHT index d0d511b..8c8d6c9 100644 --- a/doc/COPYRIGHT +++ b/doc/COPYRIGHT @@ -5,9 +5,6 @@ Copyright (C) 2004-2009 Red Hat, Inc. All rights reserved. Exceptions: -contrib/askant: - Copyright (C) 2008-2009 Andrew Price - contrib/libaislock: Contributed by Stanley Wang of Intel. From fabbione@fedoraproject.org Thu Jul 2 06:57:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 02 Jul 2009 06:57:00 -0000 Subject: cluster: STABLE3 - contrib: fix build warnings in libaislock Message-ID: <20090702065636.74E90120330@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=b836d0ea80be55cc9cad84a4f44a725b4a34536f Commit: b836d0ea80be55cc9cad84a4f44a725b4a34536f Parent: d0dfe005116496b59b7093a4ba5658dd8d229fd7 Author: Fabio M. Di Nitto AuthorDate: Thu Jul 2 08:56:07 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 2 08:56:07 2009 +0200 contrib: fix build warnings in libaislock Signed-off-by: Fabio M. Di Nitto --- contrib/libaislock/libaislock.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/contrib/libaislock/libaislock.c b/contrib/libaislock/libaislock.c index 82f06ab..4de90ba 100644 --- a/contrib/libaislock/libaislock.c +++ b/contrib/libaislock/libaislock.c @@ -26,7 +26,7 @@ enum { static struct dlm_ls_info *sa_default_ls = NULL; -inline int lkmode_ais2dlm(SaLckLockModeT mode) +static inline int lkmode_ais2dlm(SaLckLockModeT mode) { switch(mode) { @@ -39,7 +39,7 @@ inline int lkmode_ais2dlm(SaLckLockModeT mode) } } -inline SaLckLockModeT lkmode_dlm2ais(int mode) +static inline SaLckLockModeT lkmode_dlm2ais(int mode) { switch(mode) { @@ -52,7 +52,7 @@ inline SaLckLockModeT lkmode_dlm2ais(int mode) } } -inline unsigned long lkflag_ais2dlm(SaLckLockFlagsT flag) +static inline unsigned long lkflag_ais2dlm(SaLckLockFlagsT flag) { unsigned long dlm_flag = 0; @@ -64,7 +64,7 @@ inline unsigned long lkflag_ais2dlm(SaLckLockFlagsT flag) return dlm_flag; } -inline SaLckLockStatusT lkstatus_dlm2ais(int status) +static inline SaLckLockStatusT lkstatus_dlm2ais(int status) { switch(status) { @@ -79,7 +79,7 @@ inline SaLckLockStatusT lkstatus_dlm2ais(int status) } } -inline SaErrorT lkerr_dlm2ais(int status) +static inline SaErrorT lkerr_dlm2ais(int status) { switch(status) { From meyering@fedoraproject.org Thu Jul 2 11:01:00 2009 From: meyering@fedoraproject.org (Jim Meyering) Date: Thu, 02 Jul 2009 11:01:00 -0000 Subject: gfs2-utils: master - don't dereference NULL for a hostdata string with no "=" Message-ID: <20090702110121.41A94120363@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=c1309888b4824577cc334f3fcdb2b9bbcbe4a84b Commit: c1309888b4824577cc334f3fcdb2b9bbcbe4a84b Parent: bf290707a90710422feeef90124459fdc39e783f Author: Jim Meyering AuthorDate: Mon Jun 29 17:58:16 2009 +0200 Committer: Jim Meyering CommitterDate: Thu Jul 2 12:52:56 2009 +0200 don't dereference NULL for a hostdata string with no "=" * gfs2/mount/util.c (lock_dlm_join): Instead, just ignore it. --- gfs2/mount/util.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gfs2/mount/util.c b/gfs2/mount/util.c index 16f8985..cb1a860 100644 --- a/gfs2/mount/util.c +++ b/gfs2/mount/util.c @@ -503,9 +503,11 @@ int lock_dlm_join(struct mount_options *mo, struct gen_sb *sb) if (!mo->hostdata[0]) snprintf(mo->hostdata, PATH_MAX, "%s", ma.hostdata); else { - char *p = strstr(ma.hostdata, "=") + 1; - strcat(mo->hostdata, ":"); - strcat(mo->hostdata, p); + const char *p = strstr(ma.hostdata, "="); + if (p) { + strcat(mo->hostdata, ":"); + strcat(mo->hostdata, p + 1); + } } log_debug("lock_dlm_join: hostdata: \"%s\"", mo->hostdata); From meyering@fedoraproject.org Thu Jul 2 11:05:00 2009 From: meyering@fedoraproject.org (Jim Meyering) Date: Thu, 02 Jul 2009 11:05:00 -0000 Subject: gfs2-utils: master - hexedit: avoid NULL dereference upon failed malloc Message-ID: <20090702110528.EF3261201C1@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=3b256287f994e564ec7a6c580003d77029a246bf Commit: 3b256287f994e564ec7a6c580003d77029a246bf Parent: c1309888b4824577cc334f3fcdb2b9bbcbe4a84b Author: Jim Meyering AuthorDate: Wed Jun 17 16:54:03 2009 +0200 Committer: Jim Meyering CommitterDate: Thu Jul 2 13:04:05 2009 +0200 hexedit: avoid NULL dereference upon failed malloc * gfs2/edit/hexedit.c (display_indirect): Avoid unchecked malloc by declaring more_indir on the stack. --- gfs2/edit/hexedit.c | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index f9b9bb4..5c66995 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -1416,13 +1416,12 @@ static int display_indirect(struct iinfo *ind, int indblocks, int level, uint64_ file_offset = 0; if (!termlines && ((level + 1 < di.di_height) || (S_ISDIR(di.di_mode) && !level))) { - struct iinfo *more_indir; int more_ind; char *tmpbuf; - more_indir = malloc(sizeof(struct iinfo)); tmpbuf = malloc(sbd.bsize); if (tmpbuf) { + struct iinfo more_indir; lseek(sbd.device_fd, ind->ii[pndx].block * sbd.bsize, SEEK_SET); @@ -1437,20 +1436,19 @@ static int display_indirect(struct iinfo *ind, int indblocks, int level, uint64_ (unsigned long long)ind->ii[pndx].block); exit(-1); } - memset(more_indir, 0, sizeof(struct iinfo)); + memset(&more_indir, 0, sizeof(struct iinfo)); if (S_ISDIR(di.di_mode)) { - do_leaf_extended(tmpbuf, more_indir); - display_leaf(more_indir); + do_leaf_extended(tmpbuf, &more_indir); + display_leaf(&more_indir); } else { more_ind = do_indirect_extended(tmpbuf, - more_indir); - display_indirect(more_indir, + &more_indir); + display_indirect(&more_indir, more_ind, level + 1, file_offset); } free(tmpbuf); } - free(more_indir); } print_entry_ndx = pndx; /* restore after recursion */ eol(0); From teigland@fedoraproject.org Thu Jul 2 21:23:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Thu, 02 Jul 2009 21:23:00 -0000 Subject: cluster: STABLE3 - gfs_controld: fix default plock_ownership in compat mode Message-ID: <20090702212326.EC66C1201EF@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=457eaf5565e2804d3c6e367e7256c23752debcef Commit: 457eaf5565e2804d3c6e367e7256c23752debcef Parent: b836d0ea80be55cc9cad84a4f44a725b4a34536f Author: David Teigland AuthorDate: Thu Jul 2 16:13:17 2009 -0500 Committer: David Teigland CommitterDate: Thu Jul 2 16:16:48 2009 -0500 gfs_controld: fix default plock_ownership in compat mode The cluster2 default is plock_owernship=0, so if running in compat mode that should be the default. All nodes must use the same plock_ownership value or the protocol doesn't match (regardless of cluster2 vs cluster3) Signed-off-by: David Teigland --- group/gfs_controld/config.c | 10 +++++++++- group/gfs_controld/gfs_daemon.h | 1 + group/gfs_controld/main.c | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletions(-) diff --git a/group/gfs_controld/config.c b/group/gfs_controld/config.c index 0be26e5..b97e2de 100644 --- a/group/gfs_controld/config.c +++ b/group/gfs_controld/config.c @@ -170,6 +170,12 @@ int setup_ccs(void) } ccs_handle = cd; + /* plock_ownership is a special case */ + if (optd_plock_ownership) + using_default_plock_ownership = 0; + else + using_default_plock_ownership = 1; + /* These config values are set from cluster.conf only if they haven't already been set on the command line. */ @@ -182,7 +188,9 @@ int setup_ccs(void) if (!optd_plock_ownership) { rv = read_ccs_int(PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership); if (rv < 0) - read_ccs_int(DLM_PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership); + rv = read_ccs_int(DLM_PLOCK_OWNERSHIP_PATH, &cfgd_plock_ownership); + if (!rv) + using_default_plock_ownership = 0; } /* The following can be changed while running */ diff --git a/group/gfs_controld/gfs_daemon.h b/group/gfs_controld/gfs_daemon.h index a76c7f4..11c71c7 100644 --- a/group/gfs_controld/gfs_daemon.h +++ b/group/gfs_controld/gfs_daemon.h @@ -86,6 +86,7 @@ extern int group_mode; extern uint32_t plock_minor; extern uint32_t old_plock_minor; extern struct list_head withdrawn_mounts; +extern int using_default_plock_ownership; void daemon_dump_save(void); diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c index 0235b26..ae59d80 100644 --- a/group/gfs_controld/main.c +++ b/group/gfs_controld/main.c @@ -1200,6 +1200,11 @@ static void loop(void) } else if (group_mode == GROUP_LIBGROUP) { + /* the stable2 default is zero plock_ownership which we need + to match or protocol_active will differ */ + if (using_default_plock_ownership) + cfgd_plock_ownership = 0; + /* * The old, bad, way of doing things using libgroup. * code in: cpg-old.c group.c plock.c @@ -1576,4 +1581,5 @@ int group_mode; uint32_t plock_minor; uint32_t old_plock_minor; struct list_head withdrawn_mounts; +int using_default_plock_ownership; From fabbione@fedoraproject.org Tue Jul 7 07:15:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Tue, 07 Jul 2009 07:15:00 -0000 Subject: cluster: STABLE3 - libccs: fix yet another uint -> hdb_handle_t conversion Message-ID: <20090707071442.78132120368@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=158affb03150143e5561c9b8a5a3cc89865d3652 Commit: 158affb03150143e5561c9b8a5a3cc89865d3652 Parent: 457eaf5565e2804d3c6e367e7256c23752debcef Author: Fabio M. Di Nitto AuthorDate: Tue Jul 7 09:13:53 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Tue Jul 7 09:13:53 2009 +0200 libccs: fix yet another uint -> hdb_handle_t conversion Signed-off-by: Fabio M. Di Nitto --- config/libs/libccsconfdb/libccs.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/libs/libccsconfdb/libccs.c b/config/libs/libccsconfdb/libccs.c index 1d62b4b..6dc09a5 100644 --- a/config/libs/libccsconfdb/libccs.c +++ b/config/libs/libccsconfdb/libccs.c @@ -325,7 +325,8 @@ int set_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle, { char temp[PATH_MAX]; size_t templen = 0; - unsigned int temphandle; + hdb_handle_t temphandle; + unsigned int temptracker; if (confdb_key_get (handle, connection_handle, "previous_query", @@ -375,11 +376,11 @@ int set_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle, if (confdb_key_get (handle, connection_handle, "iterator_tracker", - strlen("iterator_tracker"), &temphandle, &templen) != CS_OK) { - temphandle = 1; + strlen("iterator_tracker"), &temptracker, &templen) != CS_OK) { + temptracker = 1; if (confdb_key_create (handle, connection_handle, "iterator_tracker", - strlen("iterator_tracker"), &temphandle, + strlen("iterator_tracker"), &temptracker, sizeof(unsigned int)) != CS_OK) { errno = ENOMEM; return -1; From fabbione@fedoraproject.org Tue Jul 7 07:16:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Tue, 07 Jul 2009 07:16:00 -0000 Subject: cluster: master - libccs: fix yet another uint -> hdb_handle_t conversion Message-ID: <20090707071611.99CC7120368@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6d04c956635a0af1ac96d23ecc93806c1e4acd79 Commit: 6d04c956635a0af1ac96d23ecc93806c1e4acd79 Parent: 2de0b6f3459f0d0600c5a82b544f59ce1cde89db Author: Fabio M. Di Nitto AuthorDate: Tue Jul 7 09:13:53 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Tue Jul 7 09:15:58 2009 +0200 libccs: fix yet another uint -> hdb_handle_t conversion Signed-off-by: Fabio M. Di Nitto --- config/libs/libccsconfdb/libccs.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/config/libs/libccsconfdb/libccs.c b/config/libs/libccsconfdb/libccs.c index c7e67db..e068358 100644 --- a/config/libs/libccsconfdb/libccs.c +++ b/config/libs/libccsconfdb/libccs.c @@ -327,7 +327,8 @@ int set_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle, { char temp[PATH_MAX]; size_t templen = 0; - unsigned int temphandle; + hdb_handle_t temphandle; + unsigned int temptracker; if (confdb_key_get (handle, connection_handle, "previous_query", @@ -377,11 +378,11 @@ int set_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle, if (confdb_key_get (handle, connection_handle, "iterator_tracker", - strlen("iterator_tracker"), &temphandle, &templen) != CS_OK) { - temphandle = 1; + strlen("iterator_tracker"), &temptracker, &templen) != CS_OK) { + temptracker = 1; if (confdb_key_create (handle, connection_handle, "iterator_tracker", - strlen("iterator_tracker"), &temphandle, + strlen("iterator_tracker"), &temptracker, sizeof(unsigned int)) != CS_OK) { errno = ENOMEM; return -1; From fabbione@fedoraproject.org Tue Jul 7 07:19:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Tue, 07 Jul 2009 07:19:00 -0000 Subject: cluster: STABLE3 - init scripts: add force-reload targets Message-ID: <20090707071929.B72BB120368@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=192d4e27c36fb263617ad726795f1c8dbc709497 Commit: 192d4e27c36fb263617ad726795f1c8dbc709497 Parent: 158affb03150143e5561c9b8a5a3cc89865d3652 Author: Guido G????nther AuthorDate: Tue Jul 7 09:18:25 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Tue Jul 7 09:18:25 2009 +0200 init scripts: add force-reload targets add the force-reload targets to the init scripts as expected by Debian based distros. Signed-off-by: Fabio M. Di Nitto --- cman/init.d/cman.in | 2 +- gfs/init.d/gfs.in | 2 +- gfs2/init.d/gfs2.in | 2 +- rgmanager/init.d/rgmanager.in | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in index e48300d..6481d6b 100644 --- a/cman/init.d/cman.in +++ b/cman/init.d/cman.in @@ -820,7 +820,7 @@ stop) echo fi ;; -restart|reload) +restart|reload|force-reload) cmanremove=remove stop start diff --git a/gfs/init.d/gfs.in b/gfs/init.d/gfs.in index a233148..31104b4 100644 --- a/gfs/init.d/gfs.in +++ b/gfs/init.d/gfs.in @@ -137,7 +137,7 @@ case "$1" in $0 start ;; - reload) + reload|force-reload) $0 start ;; *) diff --git a/gfs2/init.d/gfs2.in b/gfs2/init.d/gfs2.in index 241e3f9..b28a99a 100644 --- a/gfs2/init.d/gfs2.in +++ b/gfs2/init.d/gfs2.in @@ -137,7 +137,7 @@ case "$1" in $0 start ;; - reload) + reload|force-reload) $0 start ;; *) diff --git a/rgmanager/init.d/rgmanager.in b/rgmanager/init.d/rgmanager.in index 0bc1245..37539ba 100644 --- a/rgmanager/init.d/rgmanager.in +++ b/rgmanager/init.d/rgmanager.in @@ -100,7 +100,7 @@ restart|condrestart) $0 stop $0 start ;; -reload) +reload|force-reload) # not required anymore # return not implemented rtrn=3 From fabbione@fedoraproject.org Wed Jul 8 06:39:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Wed, 08 Jul 2009 06:39:00 -0000 Subject: rgmanager: master - build: convert to autoconf/automake/libtool Message-ID: <20090708063857.5D59F1202D3@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/rgmanager.git?p=rgmanager.git;a=commitdiff;h=31d270c5ebfb4d287c2665062825a4df9d83bacb Commit: 31d270c5ebfb4d287c2665062825a4df9d83bacb Parent: f2f475ccdf38752ea8f137d1c9b7ff149d22c3bd Author: Fabio M. Di Nitto AuthorDate: Wed Jul 8 08:37:31 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Wed Jul 8 08:37:31 2009 +0200 build: convert to autoconf/automake/libtool requires: - autoconf 2.63b - automake 1.11 - libtool 2.2.7a - pkgconfig 0.23 - m4 1.4.13 Signed-off-by: Fabio M. Di Nitto --- .gitignore | 49 ++- Makefile | 46 --- Makefile.am | 28 ++ autogen.sh | 4 + configure | 400 ------------------- configure.ac | 267 +++++++++++++ doc/Makefile | 16 - doc/Makefile.am | 10 + make/clean.mk | 7 - make/cobj.mk | 6 - make/defines.mk.input | 50 --- make/install.mk | 27 -- make/man.mk | 18 - make/passthrough.mk | 7 - make/uninstall.mk | 13 - rgmanager/ChangeLog | 634 ------------------------------- rgmanager/Makefile | 4 - rgmanager/Makefile.am | 11 + rgmanager/examples/Makefile.am | 3 + rgmanager/include/Makefile.am | 30 ++ rgmanager/include/reslist.h | 6 +- rgmanager/init.d/Makefile | 20 - rgmanager/man/Makefile | 12 - rgmanager/man/Makefile.am | 12 + rgmanager/src/Makefile | 4 - rgmanager/src/Makefile.am | 3 + rgmanager/src/clulib/Makefile | 41 -- rgmanager/src/clulib/Makefile.am | 42 ++ rgmanager/src/clulib/ckpt_state.c | 2 + rgmanager/src/clulib/cman.c | 2 + rgmanager/src/clulib/daemon_init.c | 2 + rgmanager/src/clulib/fdops.c | 2 + rgmanager/src/clulib/gettid.c | 2 + rgmanager/src/clulib/lock.c | 2 + rgmanager/src/clulib/locktest.c | 2 + rgmanager/src/clulib/logging.c | 2 + rgmanager/src/clulib/members.c | 2 + rgmanager/src/clulib/message.c | 2 + rgmanager/src/clulib/msg_cluster.c | 2 + rgmanager/src/clulib/msg_socket.c | 2 + rgmanager/src/clulib/msgsimple.c | 2 + rgmanager/src/clulib/msgtest.c | 2 + rgmanager/src/clulib/rg_strings.c | 2 + rgmanager/src/clulib/sets.c | 2 + rgmanager/src/clulib/signals.c | 2 + rgmanager/src/clulib/tmgr.c | 2 + rgmanager/src/clulib/vft.c | 2 + rgmanager/src/clulib/wrap_lock.c | 2 + rgmanager/src/daemons/Makefile | 115 ------ rgmanager/src/daemons/Makefile.am | 61 +++ rgmanager/src/daemons/event_config.c | 2 + rgmanager/src/daemons/fo_domain.c | 2 + rgmanager/src/daemons/groups.c | 2 + rgmanager/src/daemons/main.c | 2 + rgmanager/src/daemons/reslist.c | 2 + rgmanager/src/daemons/resrules.c | 2 + rgmanager/src/daemons/restart_counter.c | 1 + rgmanager/src/daemons/restree.c | 2 + rgmanager/src/daemons/rg_event.c | 2 + rgmanager/src/daemons/rg_forward.c | 2 + rgmanager/src/daemons/rg_locks.c | 2 + rgmanager/src/daemons/rg_queue.c | 2 + rgmanager/src/daemons/rg_state.c | 2 + rgmanager/src/daemons/rg_thread.c | 2 + rgmanager/src/daemons/sbuf.c | 2 + rgmanager/src/daemons/service_op.c | 2 + rgmanager/src/daemons/slang_event.c | 2 + rgmanager/src/daemons/test.c | 2 + rgmanager/src/daemons/tests/Makefile.am | 96 +++++ rgmanager/src/daemons/watchdog.c | 2 + rgmanager/src/utils/Makefile | 75 ---- rgmanager/src/utils/Makefile.am | 43 ++ rgmanager/src/utils/cluarp.c | 1 + rgmanager/src/utils/clubufflush.c | 6 +- rgmanager/src/utils/clufindhostname.c | 2 + rgmanager/src/utils/clulog.c | 2 + rgmanager/src/utils/clunfslock | 69 ++++ rgmanager/src/utils/clunfslock.sh | 69 ---- rgmanager/src/utils/clunfsops.c | 3 +- rgmanager/src/utils/clustat.c | 8 +- rgmanager/src/utils/clusvcadm.c | 9 +- scripts/fenceparse | 35 -- scripts/uninstall.pl | 71 ---- 83 files changed, 807 insertions(+), 1705 deletions(-) diff --git a/.gitignore b/.gitignore index 4ca135d..dd0e4da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,37 @@ -make/defines.mk -.configure.sh -*.d +*.swp +Makefile.in +aclocal.m4 +autoconf +autoheader +autom4te.cache +automake +compile +configure +config.guess +config.log +config.sub +config.status +Makefile +depcomp +install-sh +libtoolize +ltmain.sh +libtool +make/stamp-h1 +m4 +make/clusterautoconfig.h* +missing +*.pc +.deps +.libs *.o -*.a -*.so* -*.lcrso -*.po -.*.*o.cmd -.tmp_versions -*.ko -Module.symvers -modules.order -*.mod.c +*.la +*.lo +rgmanager/src/clulib/msgtest +rgmanager/src/daemons/rg_test +rgmanager/src/daemons/rgmanager +rgmanager/src/utils/clubufflush +rgmanager/src/utils/clufindhostname +rgmanager/src/utils/clulog +rgmanager/src/utils/clustat +rgmanager/src/utils/clusvcadm diff --git a/Makefile b/Makefile deleted file mode 100644 index c3e6c96..0000000 --- a/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -include make/defines.mk - -REALSUBDIRS = rgmanager doc - -SUBDIRS = $(REALSUBDIRS) - -all: ${SUBDIRS} - -${SUBDIRS}: - [ -n "${without_$@}" ] || ${MAKE} -C $@ all - -rgmanager: - -oldconfig: - @if [ -f $(OBJDIR)/.configure.sh ]; then \ - sh $(OBJDIR)/.configure.sh; \ - else \ - echo "Unable to find old configuration data"; \ - fi - -install: - set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done - install -d ${logdir} - install -d ${DESTDIR}/var/lib/cluster - install -d ${DESTDIR}/var/run/cluster - -uninstall: - set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done - rmdir ${logdir} || :; - rmdir ${DESTDIR}/var/lib/cluster || :; - rmdir ${DESTDIR}/var/run/cluster || :; - -clean: - set -e && for i in ${REALSUBDIRS}; do \ - contrib_code=1 \ - legacy_code=1 \ - ${MAKE} -C $$i $@;\ - done - -distclean: clean - rm -f make/defines.mk - rm -f .configure.sh - rm -f *tar.gz - rm -rf build - -.PHONY: ${REALSUBDIRS} diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..fb5a608 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,28 @@ +EXTRA_DIST = autogen.sh + +AUTOMAKE_OPTIONS = foreign + +MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure depcomp \ + config.guess config.sub missing install-sh \ + autoheader automake autoconf libtool libtoolize \ + ltmain.sh compile make/clusterautoconfig.h.in \ + make/clusterautoconfig.h.in~ + +noinst_HEADERS = make/copyright.cf + +ACLOCAL_AMFLAGS = -I m4 + +SUBDIRS = rgmanager doc + +install-exec-local: + $(INSTALL) -d $(DESTDIR)/$(LOGDIR) + $(INSTALL) -d $(DESTDIR)/$(CLUSTERVARRUN) + $(INSTALL) -d $(DESTDIR)/$(CLUSTERVARLIB) + +uninstall-local: + rmdir $(DESTDIR)/$(LOGDIR) || :; + rmdir $(DESTDIR)/$(CLUSTERVARRUN) || :; + rmdir $(DESTDIR)/$(CLUSTERVARLIB) || :; + +maintainer-clean-local: + rm -rf m4 diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..3c5e1d9 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,4 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. +mkdir -p m4 +autoreconf -i -v && echo Now run ./configure and make diff --git a/configure b/configure deleted file mode 100755 index 1ea68e7..0000000 --- a/configure +++ /dev/null @@ -1,400 +0,0 @@ -#!/usr/bin/perl -w - -use warnings; -use Getopt::Long; -use Cwd 'abs_path'; -use File::Basename; - -print "\nConfiguring Makefiles for your system...\n"; - -# Set a bunch of variables - -my @invoke = @ARGV; - -my $ret = 0; - -my %options = ( - help => \$help, - cc => \$cc, - debug => \$debug, - cflags => \$cflags, - extracflags => \$extracflags, - ldflags => \$ldflags, - extraldflags => \$extraldflags, - objdir => \$objdir, - incdir => \$incdir, - libdir => \$libdir, - ccsincdir => \$ccsincdir, - ccslibdir => \$ccslibdir, - cmanincdir => \$cmanincdir, - cmanlibdir => \$cmanlibdir, - dlmincdir => \$dlmincdir, - dlmlibdir => \$dlmlibdir, - logtincdir => \$logtincdir, - logtlibdir => \$logtlibdir, - ncursesincdir => \$ncursesincdir, - ncurseslibdir => \$ncurseslibdir, - slangincdir => \$slangincdir, - slanglibdir => \$slanglibdir, - readlineincdir => \$readlineincdir, - readlinelibdir => \$readlinelibdir, - mandir => \$mandir, - prefix => \$prefix, - sbindir => \$sbindir, - initddir => \$initddir, - sharedir => \$sharedir, - docdir => \$docdir, - logdir => \$logdir, - syslogfacility => \$syslogfacility, - sysloglevel => \$sysloglevel, - confdir => \$confdir, - conffile => \$conffile, - enable_crack_of_the_day => \$enable_crack_of_the_day, - enable_legacy_code => \$enable_legacy_code, - release_version => \$release_version, -); - -my $err = &GetOptions (\%options, - 'help', - 'cc=s', - 'debug', - 'cflags=s', - 'extracflags=s', - 'ldflags=s', - 'extraldflags=s', - 'objdir=s', - 'incdir=s', - 'libdir=s', - 'ccsincdir=s', - 'ccslibdir=s', - 'cmanincdir=s', - 'cmanlibdir=s', - 'dlmincdir=s', - 'dlmlibdir=s', - 'logtincdir=s', - 'logtlibdir=s', - 'ncursesincdir=s', - 'ncurseslibdir=s', - 'slangincdir=s', - 'slanglibdir=s', - 'readlineincdir=s', - 'readlinelibdir=s', - 'mandir=s', - 'prefix=s', - 'sbindir=s', - 'initddir=s', - 'sharedir=s', - 'docdir=s', - 'logdir=s', - 'syslogfacility=s', - 'sysloglevel=s', - 'confdir=s', - 'conffile=s', - 'release_version=s', - 'enable_crack_of_the_day', - 'enable_legacy_code'); - -if(!$err) { - $ret = 1; - print "*** ERROR: Invalid option detected ***\n"; -} - -# Check for the --help flag -if ($help || !$err) { - $_ = $0; - s/.*\.\/(.*)/$1/; - print "Usage: $_ [flags]\n"; - print "--help\t\tPrints this usage information\n\n"; - print "install flags:\n"; - print "--prefix=\tthe base directory to install into. (Default: /usr)\n"; - print "--sbindir=\tthe base directory for system binaries. (Default: {prefix}/sbin)\n"; - print "--initddir=\tthe base directory for init.d scripts. (Default: /etc/init.d)\n"; - print "--libdir=\tthe base directory for libraries. (Default: {prefix}/lib)\n"; - print "--sharedir=\tthe base directory for misc cluster files. (Default: {prefix}/share/cluster)\n"; - print "--docdir=\tthe base directory for misc cluster documentation files. (Default: {prefix}/share/doc/cluster)\n"; - print "--logdir=\tthe base directory for cluster logging files. (Default: /var/log/cluster/)\n"; - print "--syslogfacility=\tset the default syslog facility. (Default: LOG_LOCAL4)\n"; - print "--sysloglevel=\tset the default syslog level. (Default: LOG_INFO)\n"; - print "--confdir=\tthe cluster config directory. (Default: /etc/cluster)\n"; - print "--conffile=\tthe cluster config file. (Default: cluster.conf)\n"; - print "--mandir=\tthe base directory for man pages. (Default: {prefix}/share/man)\n"; - print "\nbuild flags:\n"; - print "--cc=\t\tcompiler to use. (Default: gcc)\n"; - print "--debug\t\tEnable debugging build. Changes default CFLAGS to -Wall -O0 -DDEBUG -g.\n"; - print "--cflags=\toverride default CFLAGS settings. (Default: -Wall -O2 -g)\n"; - print "--extracflags=\tadd extra compiler options to default CFLAGS setting. (Default: none)\n"; - print "--ldflags=\toverride default LDFLAGS settings. (Default: none)\n"; - print "--extraldflags=\tadd extra linking options to default LDFLAGS settings. (Default: none)\n"; - print "--objdir=\tspecify directory where to store object files. (Defaults: current build dir)\n"; - print "--incdir=\tthe base directory for include files. (Default: {prefix}/include)\n"; - print "--ccsincdir=\tthe base directory for ccs include files. (Default: {incdir})\n"; - print "--ccslibdir=\tthe base directory for ccs libraries. (Default: {libdir})\n"; - print "--cmanincdir=\tthe base directory for cman include files. (Default: {incdir})\n"; - print "--cmanlibdir=\tthe base directory for cman libraries. (Default: {libdir})\n"; - print "--dlmincdir=\tthe base directory for dlm include files. (Default: {incdir})\n"; - print "--dlmlibdir=\tthe base directory for dlm libraries. (Default: {libdir})\n"; - print "--logtincdir=\tthe base directory for logthread include files. (Default: {incdir})\n"; - print "--logtlibdir=\tthe base directory for logthread libraries. (Default: {libdir})\n"; - print "--ncursesincdir=\tthe base directory for ncurses include files. (Default: {incdir})\n"; - print "--ncurseslibdir=\tthe base directory for ncurses libraries. (Default: {libdir})\n"; - print "--slangincdir=\tthe base directory for S-Lang include files. (Default: {incdir})\n"; - print "--slanglibdir=\tthe base directory for S-Lang libraries. (Default: {libdir})\n"; - print "--readlineincdir=\tthe base directory for readline include files. (Default: {incdir})\n"; - print "--readlinelibdir=\tthe base directory for readline libraries. (Default: {libdir})\n"; - print "--enable_crack_of_the_day\tEnable build of highly experimental features that rely on code that is not yet available for general use. (Default: no)\n"; - print "--enable_legacy_code\tEnable build of old/obsolete/unsupported code/tools. (Default: no)\n"; - exit $ret; -} - -sub symlinks { - my $dir = shift; - my $pattern = shift; - @args = "find $dir -type f -name $pattern"; - open (IFILE, "@args |"); - while () { - chomp; - s|\./||g; - s|.*make\/defines.mk||g; - $dirname = dirname($_); - $filename = basename($_); - system("mkdir -p $objdir/$dirname"); - symlink("${cdir}/$_","$objdir/$dirname/$filename"); - } - close IFILE; - return 0; -} - -$pwd = `pwd`; -chomp($pwd); - -if (!$cc) { - $cc="gcc"; -} -if (!$cflags) { - $cflags="-Wall -Wformat=2 -MMD"; - if (!$debug) { - $cflags="${cflags} -O2"; - } else { - $cflags="${cflags} -O0 -DDEBUG"; - } - $cflags="${cflags} -g"; -} -if ($extracflags) { - $cflags="${cflags} ${extracflags}"; -} -if (!$ldflags) { - $ldflags=""; -} -if ($extraldflags) { - $ldflags="${ldflags} ${extraldflags}"; -} -if (!$prefix) { - $prefix="/usr"; -} - -print "\nChecking tree: "; -if (!$objdir) { - $objdir="${pwd}"; -} -$objdir = abs_path( $objdir ); -$cdir = dirname ( abs_path( $0 ) ); -unless ("$cdir" eq "$objdir") { - chdir "$cdir"; -} - -if (! -d "$objdir/make") { - print "setting up $objdir\n"; - mkdir "$objdir"; - symlinks(".","Makefile"); - symlinks(".","*.mk"); -} else { - print "nothing to do\n"; -} - -if (!$incdir) { - $incdir="${prefix}/include"; -} -if (!$libdir) { - $libdir="${prefix}/lib"; -} -if (!$ccsincdir) { - $ccsincdir="${incdir}"; -} -if (!$ccslibdir) { - $ccslibdir="${libdir}"; -} -if (!$cmanincdir) { - $cmanincdir="${incdir}"; -} -if (!$cmanlibdir) { - $cmanlibdir="${libdir}"; -} -if (!$dlmincdir) { - $dlmincdir="${incdir}"; -} -if (!$dlmlibdir) { - $dlmlibdir="${libdir}"; -} -if (!$logtincdir) { - $logtincdir="${cdir}/common/liblogthread"; -} -if (!$logtlibdir) { - $logtlibdir="${objdir}/common/liblogthread"; -} -if (!$readlineincdir) { - $readlineincdir="${incdir}"; -} -if (!$readlinelibdir) { - $readlinelibdir="${libdir}"; -} -if (!$ncursesincdir) { - $ncursesincdir="${incdir}"; -} -if (!$ncurseslibdir) { - $ncurseslibdir="${libdir}"; -} -if (!$slangincdir) { - $slangincdir="${incdir}"; - if (! -f "$slangincdir/slang.h") { - $slangincdir="${incdir}/slang"; - } -} -if (!$slanglibdir) { - $slanglibdir="${libdir}"; -} -if (!$mandir) { - $mandir="${prefix}/share/man"; -} -if (!$sbindir) { - $sbindir="${prefix}/sbin"; -} -if (!$initddir) { - $initddir="/etc/init.d"; -} -if (!$sharedir) { - $sharedir="${prefix}/share/cluster"; -} -if (!$docdir) { - $docdir="${prefix}/share/doc/cluster"; -} -if (!$logdir) { - $logdir="/var/log/cluster"; -} -if (!$syslogfacility) { - $syslogfacility="LOG_LOCAL4"; -} -if (!$sysloglevel) { - $sysloglevel="LOG_INFO"; -} -if (!$confdir) { - $confdir="/etc/cluster"; -} -if (!$conffile) { - $conffile="cluster.conf"; -} -if (!$enable_crack_of_the_day) { - $enable_crack_of_the_day=""; -} else { - print "\n********************************************************************************************\n"; - print "WARNING: *you* have explicitly enabled all possible experimental features under development!\n"; - print " This code will have no mercy for your data and your machines. You have been warned!\n"; - print "\n********************************************************************************************\n"; - $cflags="${cflags} -DEXPERIMENTAL_BUILD"; -} -if (!$enable_legacy_code) { - $enable_legacy_code=""; -} else { - print "\n********************************************************************************************\n"; - print "WARNING: *you* have explicitly enabled the build of old/obsoleted/unsupported code/tools\n"; - print " This code is provided *only* for backward compatibility\n"; - print "\n********************************************************************************************\n"; - $cflags="${cflags} -DLEGACY_CODE"; -} -if (defined($release_version) && not length $release_version) { - $release_version=""; -} - -open IFILE, "${objdir}/make/defines.mk" or die "Can't redirect stdout"; - -print OFILE "# This file was generated by configure from defines.mk.input\n"; - -while () { - chomp; - $_ =~ s/\@SRCDIR\@/$cdir/; - $_ =~ s/\@CC\@/$cc/; - $_ =~ s/\@CFLAGS\@/$cflags/; - $_ =~ s/\@LDFLAGS\@/$ldflags/; - $_ =~ s/\@OBJDIR\@/$objdir/; - $_ =~ s/\@INCDIR\@/$incdir/; - $_ =~ s/\@LIBDIR\@/$libdir/; - $_ =~ s/\@CCSINCDIR\@/$ccsincdir/; - $_ =~ s/\@CCSLIBDIR\@/$ccslibdir/; - $_ =~ s/\@CMANINCDIR\@/$cmanincdir/; - $_ =~ s/\@CMANLIBDIR\@/$cmanlibdir/; - $_ =~ s/\@DLMINCDIR\@/$dlmincdir/; - $_ =~ s/\@DLMLIBDIR\@/$dlmlibdir/; - $_ =~ s/\@LOGTINCDIR\@/$logtincdir/; - $_ =~ s/\@LOGTLIBDIR\@/$logtlibdir/; - $_ =~ s/\@READLINEINCDIR\@/$readlineincdir/; - $_ =~ s/\@READLINELIBDIR\@/$readlinelibdir/; - $_ =~ s/\@NCURSESINCDIR\@/$ncursesincdir/; - $_ =~ s/\@NCURSESLIBDIR\@/$ncurseslibdir/; - $_ =~ s/\@SLANGINCDIR\@/$slangincdir/; - $_ =~ s/\@SLANGLIBDIR\@/$slanglibdir/; - $_ =~ s/\@MANDIR\@/$mandir/; - $_ =~ s/\@SBINDIR\@/$sbindir/; - $_ =~ s/\@INITDDIR\@/$initddir/; - $_ =~ s/\@SHAREDIR\@/$sharedir/; - $_ =~ s/\@DOCDIR\@/$docdir/; - $_ =~ s/\@LOGDIR\@/$logdir/; - $_ =~ s/\@SYSLOGFACILITY\@/$syslogfacility/; - $_ =~ s/\@SYSLOGLEVEL\@/$sysloglevel/; - $_ =~ s/\@CONFDIR\@/$confdir/; - $_ =~ s/\@CONFFILE\@/$conffile/; - $_ =~ s/\@ENABLE_CRACK_OF_THE_DAY\@/$enable_crack_of_the_day/; - $_ =~ s/\@ENABLE_LEGACY_CODE\@/$enable_legacy_code/; - - print OFILE "$_\n"; -} - -close IFILE; - -if (not defined($release_version)) { - - my $current_version; - if ( -f 'make/official_release_version' ) { - open OFFICIAL_VERSION, '<', "make/official_release_version"; - while () { - if ($_ =~ /VERSION/) { - $current_version = $_; - } - } - close OFFICIAL_VERSION; - } - - if (not defined($release_version)) { - if (not defined($current_version)) { - $release_version = `date +%s`; - chomp $release_version; - } else { - $release_version = $current_version; - $release_version =~ s/.*"(.*)"\n/$1/; - } - } -} - -print OFILE "RELEASE_VERSION = $release_version\n"; -print OFILE "CFLAGS += -DRELEASE_VERSION=\\\"$release_version\\\"\n"; - -close OFILE; - -open OFILE, ">${objdir}/.configure.sh.tmp" or die "Can't redirect stdout"; -print OFILE "#!/bin/bash\n"; -print OFILE "$0 @invoke \$@\n"; -print OFILE "exit \$?\n"; -close OFILE; - -system("mv ${objdir}/.configure.sh.tmp ${objdir}/.configure.sh"); - -print "Completed Makefile configuration\n\n"; diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..f5b1637 --- /dev/null +++ b/configure.ac @@ -0,0 +1,267 @@ + +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.63b]) +AC_INIT([rgmanager], [master], [linux-cluster@redhat.com]) +AM_INIT_AUTOMAKE([-Wno-portability]) +LT_PREREQ([2.2.7]) +LT_INIT + +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_SRCDIR([rgmanager/include/signals.h]) +AC_CONFIG_HEADERS([make/clusterautoconfig.h]) + +AC_CANONICAL_HOST +AC_PROG_LIBTOOL + +AC_LANG([C]) + +# Sanitize path + +if test "$prefix" = "NONE"; then + prefix="/usr" + if test "$localstatedir" = "\${prefix}/var"; then + localstatedir="/var" + fi + if test "$sysconfdir" = "\${prefix}/etc"; then + sysconfdir="/etc" + fi + if test "$libdir" = "\${exec_prefix}/lib"; then + if test -e /usr/lib64; then + libdir="/usr/lib64" + else + libdir="/usr/lib" + fi + fi +fi + +case $exec_prefix in + NONE) exec_prefix=$prefix;; + prefix) exec_prefix=$prefix;; +esac + +# Checks for programs. + +# check stolen from gnulib/m4/gnu-make.m4 +if ! ${MAKE-make} --version /cannot/make/this >/dev/null 2>&1; then + AC_MSG_ERROR([you don't seem to have GNU make; it is required]) +fi + +AC_PROG_AWK +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_LN_S +AC_PROG_INSTALL +AC_PROG_MAKE_SET + +## local helper functions + +# this function checks if CC support options passed as +# args. Global CFLAGS are ignored during this test. +cc_supports_flag() { + local CFLAGS="$@" + AC_MSG_CHECKING([whether $CC supports "$@"]) + AC_COMPILE_IFELSE([int main(){return 0;}] , + [RC=0; AC_MSG_RESULT([yes])], + [RC=1; AC_MSG_RESULT([no])]) + return $RC +} + +# this function tests if a library has a certain function +# by using AC_CHECK_LIB but restores the original LIBS global +# envvar. This is required to avoid libtool to link everything +# with everything. +check_lib_no_libs() { + AC_CHECK_LIB([$1], [$2],, + [AC_MSG_ERROR([Unable to find $1 library])]) + LIBS=$ac_check_lib_save_LIBS +} + +PKG_CHECK_MODULES([ccs],[libccs]) +PKG_CHECK_MODULES([cman],[libcman]) +PKG_CHECK_MODULES([dlm],[libdlm]) +PKG_CHECK_MODULES([logt],[liblogthread]) +PKG_CHECK_MODULES([xml],[libxml-2.0]) + +# old versions of ncurses don't ship pkg-config files +PKG_CHECK_MODULES([ncurses],[ncurses],, + [check_lib_no_libs ncurses printw]) + +if test -z "$ncurses_CFLAGS" && test -z "$ncurses_LIBS"; then + ncurses_LIBS=-lncurses +fi + +# external libs (no pkgconfig) +check_lib_no_libs pthread pthread_mutex_lock + +AC_CHECK_HEADERS([slang/slang.h], [slang_in_slang=yes]) +if test x"${slang_in_slang}" = xyes; then + slang_CFLAGS="-I${oldincludedir}/slang" +else + AC_CHECK_HEADERS([slang.h], [], + [AC_MSG_ERROR([Unable to find slang development files])]) +fi +slang_LIBS="-lslang" + +check_lib_no_libs slang SLmemcmp + +# Checks for header files. +AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_INLINE +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T +AC_TYPE_UID_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINT8_T + + +# Checks for library functions. +AC_FUNC_FORK +AC_FUNC_MALLOC +AC_FUNC_REALLOC +AC_CHECK_FUNCS([bzero dup2 gethostbyaddr gethostbyname gettimeofday memmove memset select socket strcasecmp strchr strdup strerror strncasecmp strrchr strstr]) + +# local options +AC_ARG_ENABLE([debug], + [ --enable-debug enable debug build. ], + [ default="no" ]) + +AC_ARG_WITH([default-config-dir], + [ --default-config-dir=DIR + cluster config directory. ], + [ DEFAULT_CONFIG_DIR="$withval" ], + [ DEFAULT_CONFIG_DIR="$sysconfdir/cluster" ]) + +AC_ARG_WITH([default-config-file], + [ --default-config-file=FILE + cluster config file. ], + [ DEFAULT_CONFIG_FILE="$withval" ], + [ DEFAULT_CONFIG_FILE="cluster.conf" ]) + +AC_ARG_WITH([syslogfacility], + [ --syslogfacility=FACILITY + cluster default syslog facility. ], + [ SYSLOGFACILITY="$withval" ], + [ SYSLOGFACILITY="LOG_LOCAL4" ]) + +AC_ARG_WITH([sysloglevel], + [ --sysloglevel=LEVEL + cluster default syslog level. ], + [ SYSLOGLEVEL="$withval" ], + [ SYSLOGLEVEL="LOG_INFO" ]) + +## random vars + +LOGDIR=${localstatedir}/log/cluster +CLUSTERVARRUN=${localstatedir}/run/cluster +CLUSTERVARLIB=${localstatedir}/lib/cluster +CLUSTERDATA=${datadir}/cluster + +## do subst +AC_DEFINE_UNQUOTED([DEFAULT_CONFIG_DIR], "$(eval echo ${DEFAULT_CONFIG_DIR})", + [Default config directory]) + +AC_DEFINE_UNQUOTED([DEFAULT_CONFIG_FILE], "$(eval echo ${DEFAULT_CONFIG_FILE})", + [Default config file]) + +AC_SUBST([LOGDIR]) +AC_DEFINE_UNQUOTED([LOGDIR], "$(eval echo ${LOGDIR})", + [Default logging directory]) + +AC_SUBST([CLUSTERVARRUN]) +AC_DEFINE_UNQUOTED([CLUSTERVARRUN], "$(eval echo ${CLUSTERVARRUN})", + [Default cluster var/run directory]) + +AC_SUBST([CLUSTERVARLIB]) + +AC_DEFINE_UNQUOTED([CLUSTERDATA], "$(eval echo ${CLUSTERDATA})", + [Default cluster agents directory]) + +AC_DEFINE_UNQUOTED([SYSLOGFACILITY], $(eval echo ${SYSLOGFACILITY}), + [Default syslog facility]) + +AC_DEFINE_UNQUOTED([SYSLOGLEVEL], $(eval echo ${SYSLOGLEVEL}), + [Default syslog level]) + +AC_SUBST([slang_CFLAGS]) +AC_SUBST([slang_LIBS]) + +## *FLAGS handling + +ENV_CFLAGS="$CFLAGS" +ENV_CPPFLAGS="$CPPFLAGS" +ENV_LDFLAGS="$LDFLAGS" + +# debug build stuff +if test "x${enable_debug}" = xyes; then + AC_DEFINE_UNQUOTED([DEBUG], [1], [Compiling Debugging code]) + OPT_CFLAGS="-O0" +else + OPT_CFLAGS="-O2" +fi + +# gdb flags +if test "x${GCC}" = xyes; then + GDB_FLAGS="-ggdb3" +else + GDB_FLAGS="-g" +fi + +# extra warnings +EXTRA_WARNINGS="" + +WARNLIST=" + all + shadow + missing-prototypes + missing-declarations + strict-prototypes + declaration-after-statement + pointer-arith + write-strings + cast-align + bad-function-cast + missing-format-attribute + format=2 + format-security + format-nonliteral + no-long-long + unsigned-char + gnu89-inline + no-strict-aliasing + " + +for j in $WARNLIST; do + if cc_supports_flag -W$j; then + EXTRA_WARNINGS="$EXTRA_WARNINGS -W$j"; + fi +done + +CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS \ + $EXTRA_WARNINGS $WERROR_CFLAGS" +CPPFLAGS="-I\$(top_builddir)/make -I\$(top_srcdir)/make -I. $ENV_CPPFLAGS" +LDFLAGS="$ENV_LDFLAGS" + +AC_CONFIG_FILES([Makefile + rgmanager/Makefile + rgmanager/src/Makefile + rgmanager/src/clulib/Makefile + rgmanager/src/daemons/Makefile + rgmanager/src/daemons/tests/Makefile + rgmanager/src/utils/Makefile + rgmanager/include/Makefile + rgmanager/examples/Makefile + rgmanager/man/Makefile + doc/Makefile + ]) + +AC_OUTPUT diff --git a/doc/Makefile b/doc/Makefile deleted file mode 100644 index 24192ba..0000000 --- a/doc/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -DOCS = gfs2.txt \ - journaling.txt \ - min-gfs.txt \ - usage.txt \ - COPYING.applications \ - COPYING.libraries \ - COPYRIGHT \ - README.licence - -all: - -clean: - -include ../make/defines.mk -include $(OBJDIR)/make/install.mk -include $(OBJDIR)/make/uninstall.mk diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..2e6a2ec --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,10 @@ +MAINTAINERCLEANFILES = Makefile.in + +dist_doc_DATA = gfs2.txt \ + journaling.txt \ + min-gfs.txt \ + usage.txt \ + COPYING.applications \ + COPYING.libraries \ + COPYRIGHT \ + README.licence diff --git a/make/clean.mk b/make/clean.mk deleted file mode 100644 index b31a3fa..0000000 --- a/make/clean.mk +++ /dev/null @@ -1,7 +0,0 @@ -generalclean: - rm -rf *~* *.o *.a *.so *.so.* a.out *.po *.s *.d *.pyc - rm -rf core core.* .depend cscope.* *.orig *.rej - rm -rf linux .*.o.cmd .*.ko.cmd *.mod.c .tmp_versions - rm -rf Module.symvers Module.markers .*.o.d modules.order - rm -rf ${TARGET} ${TARGETS} ${TARGET}_test - rm -rf ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6} diff --git a/make/cobj.mk b/make/cobj.mk deleted file mode 100644 index dd86cfb..0000000 --- a/make/cobj.mk +++ /dev/null @@ -1,6 +0,0 @@ -%.o: $(S)/%.c - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(REENT_CFLAGS) -c -o $@ $< - -# used by rgmanager/src/daemons -%-noccs.o: $(S)/%.c - $(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(NOCCS_CFLAGS) -c -o $@ $< diff --git a/make/defines.mk.input b/make/defines.mk.input deleted file mode 100644 index 85e5726..0000000 --- a/make/defines.mk.input +++ /dev/null @@ -1,50 +0,0 @@ -# Install Locations -sbindir ?= ${DESTDIR}@SBINDIR@ -initddir ?= ${DESTDIR}@INITDDIR@ -libdir ?= ${DESTDIR}@LIBDIR@ -sharedir ?= ${DESTDIR}@SHAREDIR@ -docdir ?= ${DESTDIR}@DOCDIR@ -logdir ?= ${DESTDIR}@LOGDIR@ -mandir ?= ${DESTDIR}@MANDIR@ -incdir ?= ${DESTDIR}@INCDIR@ - -# Build information - -# C Compiler defaults -CC = @CC@ -AR = ar -RANLIB = ranlib - -CFLAGS += @CFLAGS@ -I@SRCDIR@/make -CFLAGS += -DDEFAULT_CONFIG_DIR=\"@CONFDIR@\" -DDEFAULT_CONFIG_FILE=\"@CONFFILE@\" -CFLAGS += -DLOGDIR=\"@LOGDIR@\" -DSYSLOGFACILITY=@SYSLOGFACILITY@ -DSYSLOGLEVEL=@SYSLOGLEVEL@ -LDFLAGS += @LDFLAGS@ - -SRCDIR = @SRCDIR@ -OBJDIR = @OBJDIR@ - -ccsincdir ?= @CCSINCDIR@ -ccslibdir ?= @CCSLIBDIR@ -cmanincdir ?= @CMANINCDIR@ -cmanlibdir ?= @CMANLIBDIR@ -dlmincdir ?= @DLMINCDIR@ -dlmlibdir ?= @DLMLIBDIR@ -logtincdir ?= @LOGTINCDIR@ -logtlibdir ?= @LOGTLIBDIR@ -readlineincdir ?= @READLINEINCDIR@ -readlinelibdir ?= @READLINELIBDIR@ -ncursesincdir ?= @NCURSESINCDIR@ -ncurseslibdir ?= @NCURSESLIBDIR@ -slangincdir ?= @SLANGINCDIR@ -slanglibdir ?= @SLANGLIBDIR@ -experimental_build ?= @ENABLE_CRACK_OF_THE_DAY@ -legacy_code ?= @ENABLE_LEGACY_CODE@ - -THISDIR = $(shell echo $(CURDIR) | sed -e 's|$(OBJDIR)/||g') -S=$(SRCDIR)/$(THISDIR) - -CONFDIR=@CONFDIR@ -CONFFILE=@CONFFILE@ - -UNINSTALL = perl @SRCDIR@/scripts/uninstall.pl -FENCEPARSE = bash @SRCDIR@/scripts/fenceparse diff --git a/make/install.mk b/make/install.mk deleted file mode 100644 index fb93131..0000000 --- a/make/install.mk +++ /dev/null @@ -1,27 +0,0 @@ -install: -ifdef SBINDIRT - install -d ${sbindir} - install -m755 ${SBINDIRT} ${sbindir} -endif -ifdef SBINSYMT - install -d ${sbindir} - cp -a ${SBINSYMT} ${sbindir} -endif -ifdef INITDT - install -d ${initddir} - set -e; \ - for i in ${INITDT}; do \ - if [ -f $$i ]; then \ - install -m755 $$i ${initddir}; \ - else \ - install -m755 $(S)/$$i ${initddir}; \ - fi; \ - done -endif -ifdef DOCS - install -d ${docdir} - set -e; \ - for i in ${DOCS}; do \ - install -m644 $(S)/$$i ${docdir}; \ - done -endif diff --git a/make/man.mk b/make/man.mk deleted file mode 100644 index 26f6401..0000000 --- a/make/man.mk +++ /dev/null @@ -1,18 +0,0 @@ -all: - -install: - set -e; \ - for i in ${TARGET}; do \ - p=`echo $$i | sed -e 's#.*\.##g'`; \ - install -d ${mandir}/man$$p; \ - install -m644 $(S)/$$i ${mandir}/man$$p; \ - done - -uninstall: - set -e; \ - for i in ${TARGET}; do \ - p=`echo $$i | sed -e 's#.*\.##g'`; \ - ${UNINSTALL} $$i ${mandir}/man$$p; \ - done - -clean: diff --git a/make/official_release_version b/make/official_release_version deleted file mode 100644 index e69de29..0000000 diff --git a/make/passthrough.mk b/make/passthrough.mk deleted file mode 100644 index 979a86c..0000000 --- a/make/passthrough.mk +++ /dev/null @@ -1,7 +0,0 @@ -all: ${SUBDIRS} - -%: - set -e && \ - for i in ${SUBDIRS}; do \ - ${MAKE} -C $$i $@; \ - done diff --git a/make/uninstall.mk b/make/uninstall.mk deleted file mode 100644 index a8f5b3a..0000000 --- a/make/uninstall.mk +++ /dev/null @@ -1,13 +0,0 @@ -uninstall: -ifdef SBINDIRT - ${UNINSTALL} ${SBINDIRT} ${sbindir} -endif -ifdef SBINSYMT - ${UNINSTALL} ${SBINSYMT} ${sbindir} -endif -ifdef INITDT - ${UNINSTALL} ${INITDT} ${initddir} -endif -ifdef DOCS - ${UNINSTALL} ${DOCS} ${docdir} -endif diff --git a/rgmanager/ChangeLog b/rgmanager/ChangeLog deleted file mode 100644 index 917500f..0000000 --- a/rgmanager/ChangeLog +++ /dev/null @@ -1,634 +0,0 @@ -2008-04-16 Fabio M. Di Nitto - * src/utils/clustat.c: Fix variable init - -2008-03-04 Lon Hohberger - * src/resources/ASEHAagent.sh, Makefile: Add Sybase failover agent - * src/resources/oracledb.sh, Makefile: Add Oracle 10g failover agent - -2008-02-26 Lon Hohberger - * src/resources/ip.sh: Fix netmask handling in ip.sh - * src/utils/clustat.c: Don't show estranged nodes if they're down -2008-02-01 Lon Hohberger - * src/daemons/rg_state.c, slang_event.c, groups.c, restart_counter.c, - include/restart_counter.h, resgroup.h, - src/resources/default_event_script.sl: Allow restart counters to - correctly work with central_processing. (#400211 / #431130) - -2008-01-25 Lon Hohberger - * src/daemons/rg_thread.c: Fix case that broke 'clusvcadm -e - -n ' case #430220 - * src/daemons/rg_state.c: Don't enable migrate-to-self (#430272) - -2008-01-02 Fabio M. Di Nitto - * src/resources/ocf-shellfuncs: Add interpreter. - -2007-12-30 Fabio M. Di Nitto - * src/daemons/rg_state.c, include/resgroup.h, src/clulib/alloc.c: - Fix building when -DDEBUG is defined. - -2007-12-24 Fabio M. Di Nitto - * src/clulib/vft.c: Change ifdef to fix build on parisc. - -2007-12-19 Lon Hohberger - * include/res-ocf.h: Fix typo - * src/daemons/restree.c: Export reference counts to resource agents. - * src/resources/clusterfs.sh: Use reference counts to ensure we - don't unmount a GFS file system if it's in use by multiple services - on the same node. #254111 - * src/resources/service.sh, default_event_script.sl: Add support for - "soft" dependencies if central_processing is enabled - -2007-12-14 Lon Hohberger - (Misc central_events fixes) - * Add return code for inability to run because of exclusive - tag - * Only initialize state once - * Fix master-node failover. - * Correctly return node after enable if request was forwarded - -2007-12-12 Lon Hohberger - * Misc changes; add missing ds.h - * src/resources/default*.sl: Make clusvcadm -r go to a different - node. Don't notice() that we're starting a service if it's - disabled. - * src/daemons/groups.c: Make clustat not interfere with startup - when central processing is enabled - * src/daemons/slang_event.c: Make clusvcadm correctly report - service owner after relocate/restart/enable requests. - -2007-11-30 Lon Hohberger - * Commit RIND / S-Lang script engine [untested] - -[RHEL5 merged ChangeLog Entries] -2007-11-30 Lon Hohberger - * src/resources/clusterfs.sh: Retry mount up to 3 times to avoid - race condition during another process mounting a GFS volume - * src/resources/vm.sh, service.sh: Add defaults for values. - Make vm.sh work with more service attrs (max restarts) - * src/utils/clustat.c: Make output of clustat terminal-width - dependent - -2007-11-26 Lon Hohberger - * include/reslist.h: Add restart counters to resource node structure - (intended for top-level resources, i.e. services, vms...) - * include/restart_counter.h: Add header file for restart counter - * src/daemons/Makefile: Fix build to include restart counters - * src/daemons/restart_counter.c: Implement restart counters #247139 - * src/daemons/fo_domain.c, groups.c, restart_counter.c, resrules.c, - restree.c, test.c: Glue for restart counters. - * src/daemons/reslist.c: Glue for restart counters. Make expand_time - parser more robust to allow things like '1h30m' as a time value. - * src/daemons/main.c: Mark quorum disk offline in the correct - place to avoid extraneous log messages - * src/daemons/rg_state.c: Allow marking service as stopped if - stuck in recover state. Make service which failed to start - go to stopped state. Glue for restart counters. - * src/resources/service.sh, vm.sh: Add parameters for restart - counters #247139 - -2007-11-14 Lon Hohberger - * src/utils/clulog.c: Make clulog honor rgmanager log levels - (#289501) - * src/clulib/vft.c: Fix #303981 - crash on rgmanager restart in some - cases - * man/clusvcadm.8: Remove references to clushutdown from man page; - resolves #324151 - * src/resources/netfs.sh: Apply patch from Marco Ceci to fix #358161 - * src/resources/vm.sh: Make default migration policy live instead - of pause for Xen virtual machines. Also make it configurable instead - of static. Resolves #345871 - -2007-11-13 Lon Hohberger - * src/resources/clusterfs.sh: Add support for self_fence operation - to clusterfs resource agent - * src/resources/service.sh: Add default values to service.sh - -2007-10-26 Lon Hohberger - * src/daemons/main.c, src/utils/clustat.c, clusvcadm.c: - Fix #354391 - -2007-09-25 Lon Hohberger - * src/daemons/restree.c: Apply patch to fix side case re: 229650 - Patch from Simone Gotti. Resolves: #229650 -[End RHEL5 merged changes] - -2007-08-30 Lon Hohberger - * src/daemons/restree.c, rg_state.c: Fix tree-restart bug - This is another part of #229650 - -2007-08-22 Fabio M. Di Nitto - * include/list.h: Fix build with gcc-4.2. - -2007-08-15 Lon Hohberger - * src/utils/clustat.c: Remove uninitialized var & fix logic / - spotted by Ryan McCabe - -2007-08-09 Fabio M. Di Nitto - * rgmanager/src/clulib/alloc.c: Undefine DEBUG when building on - PARISC. __builtin_address needs the same love as IA64. - -2007-08-02 Lon Hohberger - * general: More fixes around #248727 - * include/reslist.h, src/daemons/restree.c: Make last-value be - returned or resources which have been checked recently - * src/daemons/groups.c: Make VMs use migrate semantics instead of - relocate semantics when employing failover domain rules - * src/daemons/nodeevent.c: Fix VMs ending up on wrong nodes when - simultaneous boot occurs - * src/daemons/rg_forward.c: Fix erroneous timeout - * src/daemons/rg_state.c: Handle RG_STATE_MIGRATE in svc_advise_* - Handle certain migration failures. - * src/resources/vm.sh: Handle certain migration failures - -2007-07-31 Lon Hohberger - * general: Make VMs not change state when added/removed from the - cluster config or bounce services/VMs when minor config changes - are made. (#248727) - * include/res-ocf.h: Add reconfigure operation - * include/reslist.h: Add flags allowing reconfigurable options in - resource agent metadata, and per-agent flags which allow resources - to be added w/o initialization / removed w/o kill. - * src/clulib/rg_strings.c: Add string definition for reconfigure op - * src/daemons/groups.c: Allow no-init-on-add and no-kill-on-delete - flags to work - * src/daemons/reslist.c: Allow resource comparison to take into - account reconfig flags and return a new value if the resource is - reconfigurable - * src/daemons/resrules.c: Code to support new flags - * src/daemons/restree.c: Code to support reconfiguration operation - * src/daemons/test.c: Code to support testing new reconfig ops and - behaviors - * src/resources/*: Add new flags to service and VM resource agents. - -2007-07-23 Lon Hohberger - * general: make threads exit with pthread_exit() so we can wrap/track them. - Add internal statedump (SIGUSR1) support. - * src/clulib/msg_cluster.c: Fix rare deadlock condition. Add dump support. - * src/clulib/tmgr.c: Add thread wrappers so we can report threads in - internal state dumps. - * src/clulib/vft.c: Fix rare crash if vf_resolve_views gets called with - NULL. Add dump support. - * src/daemons/main.c: Fix minor memory leak in membership_update(). Fix - crash-on-exit race. Don't exit if someone requests foreground mode. - * src/daemons/rg_forward.c: Clean up forwarding logic and handle missed - case (forward-to-self -> ERROR!) - * src/daemons/rg_state.c: Move closing / free of contexts out of - send_ret/send_response to the caller (where they belong). Don't let - people relocate disabled services. - * src/daemons/rg_thread.c: Don't loop forever if the thread exits before - we notice that it's started. - * src/daemons/clusvcadm.c: Fix error codes if you try to relocate when - rgmanager isn't running - -2007-07-12 Marek Grac - * src/resources/Makefile: Fix #245178 - install RA for named - -2007-07-10 Lon Hohberger - * src/daemons/rg_thread.c, groups.c: Make status queue max 1 instead - of unbounded (resolves: 247488) - -2007-06-29 Lon Hohberger - * src/daemons/groups.c, rg_state.c: Make all test cases for #237144 - work correctly - -2007-06-27 Lon Hohberger - * Merge from RHEL5 branch. - * src/daemons/vm.sh: Un-break migrate (#231692). Make status - checks happen every 30 seconds instead of 30 minutes. - * include/resgroup.h: Move inline recovery flags to a header file, - add RG_STATUS_INQUIRY for locating virtual machines which may have - migrated. - * include/reslist.h: Change res_exec() back to using agent_op_str() - inline so we can squelch errors while performing RG_STATUS_INQUIRY - * src/clulib/rg_strings.c: Add new strings for new error code / - request types - * src/daemons/groups.c: Change group_migrate() to use the correct - calling semantics - * src/daemons/main.c, nodeevent.c: Clean up cases which could cause - #244143 - * src/daemons/resrules.c: Clear up noise - * src/daemons/restree.c: Squelch errors during RG_STATUS_INQUIRY - Patch up inline service recovery (#229650) - * src/daemons/rg_state.c: Don't let migrations or relocations to a - node running exclusive services occur in the first place and return - a useful error. (goes with #237144). Locate virtual machines (or - generally, services with the 'migrate' ability) elsewhere in the - cluster prior to trying to start one. Detect if someone migrates - such a service without using the cluster tools (#232300) - * src/daemons/test.c: Make rg_test do the right thing for migrate - operations - -2007-06-21 Fabio M. Di Nitto - * rgmanager/src/clulib/alloc.c: Undefine DEBUG when building on IA64. - The __builtin_address functionality should be taken from libunwind - but porting requires some work. For now use this workaround and - also make sure to wrap STACKSIZE withing DEBUG. - -2007-06-14 Lon Hohberger - * include/resgroup.h: Fix size incompatibility on 32/64 bit mixed - clusters. Put in stubs for intelligent handling of state sizes - during a cluster upgrade. - -2007-06-14 Marek Grac - * src/daemons/main.c, rg_state.c, rg_thread.c, - src/utils/clusvcadm.c - * #211469 - RFE: Flag (-F) for clusvcadm to respect failover domain - * 'clusvcadm -e service00' works same as in RHEL4 (differs from RHEL5.0) - * -F for freeze was changed to -Z - -2007-06-13 Lon Hohberger - * src/daemons/restree.c: Fix #229650 uninitialized bug - -2007-05-31 Lon Hohberger - * src/daemons/resrules.c: Fix #234249 - ignore obvious backup files - in /usr/share/cluster when processing resource rules - * src/daemons/restree.c, src/daemons/groups.c, include/reslist.h: - Implement independent subtrees, per bug #229650 - -2007-05-22 Lon Hohberger - * src/resources/SAPInstance, SAPDatabase: Add primary attrs - -2007-05-09 Lon Hohberger - * src/resources/Makefile: Install SAP agents - -2007-05-08 Lon Hohberger - * src/resources/SAPInstance, SAPDatabase: Add SAP resource agents - from Alexander Krauth - -2007-04-27 Lon Hohberger - * include/resgroup.h, src/clulib/rg_strings.c src/daemons/groups.c, - rg_state.c, rg_thread.c, src/utils/clustat.c, clusvcadm.c: Apply - patch to implement service freeze/unfreeze from Simone Gotti - * src/daemons/sbuf.c: Add simple buffer handlers for future use - by svc_status_inquiry - -2007-04-27 Fabio M. Di Nitto - * src/clulib/vft.c: Change ifdef to fix build on parisc. - -2007-04-26 Lon Hohberger - * src/daemons/reslist.c: Try all direct ancestors while - performing run-time inheritance resolution #231521 - -2007-04-26 Fabio M. Di Nitto - * src/daemons/Makefile: use resrules-noccs in dtest build - target. - -2007-04-19 Lon Hohberger - * src/daemons/groups.c, rg_state.c: Apply patch from Andrey - Mirkin to fix bug #237144; prevents exclusive services from - being accidentally (or intentionally) being started on the - same node - * src/resources/clusterfs.sh: Apply patch from Simone - Gotti to fix logging errors in clusterfs.sh - * src/daemons/main.c: Fix qdiskd being treated as an online - cluster node - -2007-04-12 Lon Hohberger - * src/daemons/main.c: Fix watchdog race condition causing - reboot; patch from Andrey Mirkin; bugzilla #236204 - -2007-03-27 Lon Hohberger - * Merge patch from Crosswalk development team: - * Scott Cannata - * Henry Harris - * Leonard Maiorani - -===== - -2006-10-25 Lon Hohberger - * src/resources/clusterfs.sh: Fix unmounting problem (#212074) - -2006-10-23 Lon Hohberger - * src/resources/xenvm.sh: Gone; replaced with vm.sh. - * The C code parts: Fix deadlocks incurred while testing - rgmanager on larger node counts. #211701 - -2006-10-06 Lon Hohberger - * src/daemons/main.c: Fix #202492: provide rgmanager's view of - who is running rgmanager to clustat. - * src/daemons/groups.c: Fix tiny memory leak during configuration - changes - * include/resgroup.h: #202492: Flip unused RG_STATUS_INQUIRY to - RG_STATUS_NODE. - * src/utils/clustat.c: #202492: Send RG_STATUS_NODE to clurgmgrd - in order to obtain rgmanager "group" status information - -2006-09-27 Lon Hohberger - * src/daemons/rg_state.c: Fix #208011 - failed->disabled state - transition. Fix node ID type. - * include/members.h: Add a third state to note that a node does - not need to be fenced as a result of rgmanager crashing. Add protos - for memb_set_state and member_online functions. - * include/reslist.h: Fix type error; node IDs are 32-bit ints, not - 64-bit ints. - * src/clulib/members.c: Add member_set_state/online functions for - quick checks and sets of the protected member list. Zero out - the node structure prior to calling cman_get_nodeid so that we - don't get ENOENT (fixed clustat bug where clustat didn't report - the "local" flag). Fix node ID type. - * src/daemons/fo_domain.c: Fix node ID type, fix shadow declaration - of member_online - * src/daemons/groups.c: Unfix logic error that wasn't broken in the - first place. - * src/daemons/main.c: Fix node ID types. Add fourth ("clean") - param to node_event* to decide whether a node death is clean or not. - Nodes get marked clean if we get an RG_EXITING message, otherwise, - they are unclean, and we wait for fencing. - * src/daemons/nodeevent.c: Add fourth param to node_event* to help - decide if we need to wait for a node to be fenced or not. Fix - node ID type. - * src/utils/clustat.c: Fix logic error preventing nodes from properly - being flagged. Apply patch from Fabio M. Di Nitto to fix bug where - clustat -s foo wasn't getting expanded to service:foo - * src/daemons/rg_forward.c, rg_thread.c: Make forwarding of enable - to specified target node work (#202498) - -2006-09-01 Lon Hohberger - * include/resgroup.h: Add proto for rg_strerror - * include/vf.h: Add proto for vf_invalidate (flushes vf cache) - * src/clulib/rg_strings.c: Add rg_strerror function, define - human-readable strings for rgmanager error values - * src/clulib/vft.c: Add vf_invalidate (separate from vf_shutdown) - * src/daemons/groups.c: Fix obvious logic error - * src/daemons/main.c: Fix rg_doall() message during loss of quorum. - Invalidate local VF cache and kill resource configurations on - loss of quorum (#202497). Send RG_EQUORUM back to clustat/clusvcadm - so that they report why they can't get information. Don't queue - status checks if we've lost quorum. Add command line parameter to - disable internal crash watchdog - * src/utils/clustat.c, clusvcadm.c: Handle SIGPIPE, and produce - useful errors if possible. - -2006-08-31 Marek Gr????c - * src/daemons/restree.c: Fix #203720. Do not run backup copies (ends - with ~) of resource agents. - * src/resources/apache.*, mysql.*: Add Apache & MySQL resource agents - * src/resources/utils/*: Add utility scripts for resource agents - -2006-08-21 Lon Hohberger - * src/daemons/main.c: Fix #202500 - simultaneous starts confuse - rgmanager. This happened due to the fact that rgmanager was not - correctly determining port listening status of other nodes on the - first pass, and subsequent attempts to determine status of other - nodes were not tried. - -2006-08-18 Lon Hohberger - * include/resgroup.h: Change ordering and add magic field to - rgmanager state field (warning: breaks compatibility from 08/08 CVS!) - * src/clulib/ckpt_state.c, src/daemons/rg_state.c: Fix bug - preventing correct operation of ckpt operation after initial boot. - Get rid of debug info. - * src/daemons/groups,c, main.c: Fix #202499 - shutdown while handling - transitions sometimes allows services to restart (due to not locking - RGs locally) - * src/resources/clusterfs.sh, fs.sh, nfsclient.sh: Add proper - warning messages if status check fails - * src/resources/ra-api-1-modified.dtd: Allow 'migrate' option - * include/clulog.h, src/daemons/clulog.c: Fix default log levels so - that they're LOG_NOTICE, and only one default is used (#200776) - -2006-08-08 Lon Hohberger - * src/clulib/members.c: Fix gained/lost list creation so that the - count is actually nonzero (#201713) - * src/daemons/main.c: Fix typo in debug information. Kill CMAN handle - before doing a member list update. Don't call memb_online; just - check the cn_member field (optimization). Don't process node event - until the node actually closes port (#201713). - * src/utils/clusvcadm.c: Fix relocation issues (#201711). - -2006-08-07 Lon Hohberger - * src/clulib/ckpt_state.c: Preliminary implementation of replacement - for VF using AIS CKPT B.02.01 (w/ built-in test program) - * include/cman-private.h: Clean up APIs (cman APIs return - cman_handle_t, which is void*, should be using void ** all over) - * include/message.h: Bump context count to 128, add destination - node ID in header of packets. - * src/clulib/alloc.c: If we alloc the same size, return the same - block - * src/clulib/cman.c: API cleanups - * src/clulib/message.c: Add error checking to msg_print - * src/clulib/msg_cluster.c: Check destination in header before - processing message remove dup #define for MAX_CONTEXTS, add - proto_error() macro for displaying protocol errors. Use 'max' - instead of 'fd' for select(). Use correct var when assigning - contexts. Fix CMAN handles. Return correct size from msg_send() - requests. - * src/clulib/msgtest.c: Fix CMAN handles - * src/clulib/vft.c: Don't handle VF_CURRENT inside comms thread - * src/daemons/main.c: Check to see if nodes are listening on our - port before we consider them running. Handle VF_CURRENT requests - from other nodes. Fail if we can't determine local node ID - * src/daemons/rg_forward.c: Give 10 minutes for responses to - forwarded requests. - * src/daemons/rg_state.c: Shorten RG state names. Fix 'Uncertain' - output line. - * src/utils/clustat.c: Fix ccs_member_list() function. - -2006-05-23 Lon Hohberger - * src/daemons/members.c: Zap pad fields on copy-out - * src/daemons/main.c: Give notice if skipping an event because of - locked services. Call the self-watchdog init function - * src/daemons/watchdog.c: Add Stanko Kupcevic's self-watchdog from - CVS head (fixes #193247) - * src/daemons/groups.c: Add debug messages. Actually count - resgroups during node transition handling - * src/daemons/rg_state.c: allow failover of stopping services if - the owner died (#193255) - * src/utils/clustat.c: fix typo, misc. usability problems (#192999) - -2006-05-16 Lon Hohberger - * src/resources/nfsclient.sh: Fix 189218 - nfsclient not matching - wildcards correctly when checking status. Allow disabling of - recovery for services where the nfs clients are ordered (this will - cause a full service restart, but works) - * src/resources/clusterfs.sh, fs.sh, svclib_nfslock, service.sh: - Implement rudimentary atomic bomb-style NFS lock reclaim handling - Needs compatible and correctly configured version of nfs-utils - installed and running on the system. For clusterfs.sh, ensure - that we flush buffers during service tear-down - regardless of - whether or not we unmount the file system. - * src/utils/clunfslock.sh: HA-callout program (/usr/sbin/clunfslock) - for use with the rpc.statd -H parameter. Copies the client to all - cluster-managed mounted file systems so that it will get lock - reclaim notification on failover. - -2006-05-09 Lon Hohberger - * include/list.h: Prevent dereferencing curr if it's null for some - reason - * include/resgroup.h: Clean up alignment, add rgmanager lock/unlock - message types - * src/daemons/Makefile: Add nodeevent.o to the build for rgmanager - * src/clulib/msgsimple.c: Misc code path cleanups - * src/clulib/vft.c: Add local reads for fast clustat operation. - * src/daemons/groups.c: Count all resource groups for all nodes - in one pass, rather than one node per pass. Split queueing of - status checks off so we never block the main thread. Mark services - which have autostart=0 in the config as "disabled" to help remove - confusion between "disabled", "stopped", and the no-longer-needed - "stopped but behave like disabled" states. bz #182454 / - #190234 / #190408 - * src/daemons/fo_domain.c: Add patch from Josef Whiter to - implement no-failback option for a given FO domain - bz #189841 - * src/daemons/main.c: Queue node events for another thread to - handle, so we never block the main thread. Also, implement - cluster-wide service lock/unlock feature from clumanager 1.2.x - - bz #175010 - * src/daemons/nodeevent.c: Split out node event queueing / handling - in to a separate thread so the main thread does not block - * src/daemons/rg_state.c: Return error codes if resource groups - are locked. - * src/daemons/rg_thread.c: Fix assertion failure causing segfault - in extremely rare cases. Quash the rg queue during shutdown. - - bz #181539 - * src/daemons/rg_state.c: Add fast local service state query to - reduce unnecessary lock contention - * src/daemons/groups.c: Handle request for expedited information - from clustat. - * src/daemons/main.c: Pass arg1 to send_rg_states() to enable fast - clustat operation. - * src/resources/fs.sh: Implement user/group quota support if - enabled in the file system options - * src/utils/clustat.c: Misc. error handling. Add single service / - member output and add -Q to the help information. #185952. - Added -f flag. - * src/utils/clusvcadm.c: Implement client-side of #175010 - * src/utils/clustat.c: show transition time in clustat -x - - bz #191398 - * src/resources/fs.sh: enable user/group quotas if enabled in the - options attribute - bz #191182 - * init.d/rgmanager: fix typo - bz #191205 - - -------------- - -2005-03-21 Lon Hohberger - * init.d/rgmanager, Makefile: Fix up init script and add Makefile - so that the init script is properly installed #142754 - * src/daemons/*: Fixes for #150344, #151187: Relocate to same node - returns failure, hang during shutdown if user relocate is in-flight. - Fix service state getting stuck in "recoverable" on fail-to-start - scenarios where other nodes failed (or no other node was available) - Rename "resourcegroup" to "service" to be consistent with UI - * src/resources/fs.sh, clusterfs.sh: Fix #151077: Force unmount broken - * src/resources/netfs.sh: Fix #151091: netfs status broken - * src/resources/resourcegroup.sh, service.sh: Remove resourcegroup, - rename to service.sh - -2005-03-14 Lon Hohberger - * src/resources/clusterfs.sh, fs.sh: Make clusterfs actually work. - Clean up fs.sh + clusterfs.sh "status" when mount reports none/ - devpets/usbdev/etc. - * src/daemons/test.c: Add a 'rules' test function for printing - resource rules to stdout. - * src/daemons/reslist.c: Fix 151095 - -2005-03-07 Lon Hohberger - * include/resgroup.h: Add STOP_USER so we can handle user - STOP (instead of just DISABLE) requests. #150333 - * src/resources/fs.sh: umount should umount mount points, not - devices. Handle symlinks to file system block devices. #150481 - * src/clulib/rg_strings.c: Add user stop string. - * src/clulib/gettid.c: errno fix from trunk - * src/clulib/vft.c: Connect timeout extension for VF - * src/daemons/main.c: Separate connect + login. GuLM doesn't know - about SGs. - * src/daemons/rg_state.c: Change stop handling. Add generic recover - function. - * src/daemons/rg_thread.c: Add support for RESTART, USER_STOP. - #150330, #150333 - * src/utils/clusvcadm.c: Use USER_STOP to signal a user-called stop. - #150333 - -2005-03-02 Lon Hohberger - * include/clulog.h: Change default log level to INFO - * include/resgroup.h: Add proto for "best_target_node" - * src/clulib/clulog.c: Change log facility to LOG_DAEMON to match - other cluster daemons (e.g. lock_gulmd) - * src/daemons/groups.c: Add best_target_node, count_resource_groups. - Implement missing autostart-disable feature and requested exclusive - resource group feature. Store configuration view number so we can - tell when the configuration changes. - * src/daemons/main.c: Print node state transition messages before - calling node_event(). Use do_status_checks() so we don't try to - check services we're not running. Bump periodic status event - queueing to 10 seconds instead of 5. Poll ccsd for config updates - since we have no other way to find them. Fix bug preventing - status checks when clustat -i 1 is running. - * src/daemons/rg_state.c: Fix handle_relocate_req so that it uses - best_target_node() correctly. Leave services which failed on all - current nodes as 'stopped', so the next node transition will cause - us to try to restart it automagically. Consider recovery policy - when taking recovery action. - * src/daemons/rg_thread.c: Use recovery routine instead of start. - * src/daemons/restree.c: Fix tree delta updates. - * src/resources/resourcegroup.sh: Add 'exclusive' parameter. Change - 'autostart' to a boolean instead of string. Add recovery policy - parameter. - * src/utils/clusvcadm.c: Make "relocate to node X" work. - -2005-02-28 Lon Hohberger - * errors.txt: Remove random whitespace at the bottom. - * include/resgroup.h: Add do_status_checks proto - * include/rg_queue.h: Remove __ definitions so as not to conflict - with glibc internals. - * include/vf.h: Increase VF_COORD_TIMEOUT to something reasonable. - * src/daemons/groups.c: Add do_status_checks(). We were previously - queueing status checks for RGs that we didn't own. Not useful. - * src/daemons/main.c: Fix for #149410. - * src/daemons/rg_state.c: Fix various failover service problems. - * src/resources/script.sh: Remove "recover" from generic script - wrapper. - -======================================================================= - -2004-09-23 Lon Hohberger - * include/reslist.h: Add needstart/needstop/common flags for - reconfiguration. Added RS_CONDSTART/CONDSTOP to perform "stop - if needed/start if needed" operations after a resource [group] - reconfiguration. Cleaned up structures. Added NO_CCS define for - testing. - * src/daemons/fo_domain.c: Added NO_CCS defines for testing. - * src/daemons/main.c: Added reconfigure() stub function. Added - testing support. - * src/daemons/reslist.c: Added comparsion + primary-attr functions - for resources. Add printout of needstart/stop in resource dump. - * src/daemons/restree.c: Added resource list comparsion + - resource tree comparison functions. Added condstart/stop to ops - list. Added CONDSTART/CONDSTOP handling in res_op. - * src/daemons/rg_locks.c: Added NO_CCS support for testing. - -2004-09-13 Lon Hohberger - * include/resgroup.h: Add a default check interval. - * include/reslist.h: Add a recover operation, and put operations - and checks together in each instantiated resource structure. - * src/daemons/groups.c: Don't use the old rg_status() func -- - its internals have changed. - * src/daemons/reslist.c: Duplicate the action structure of a - parent resource type into an instantiated resource. - * src/daemons/resrules.c: Find the actions with the correct - path. - * src/daemons/restree.c: Add depth parameter to res_exec. Add - do_status - find the highest check/status level to perform given - the elapsed time since another status operation was performed. - Add a reference count each time a resource is started on a node. - * src/daemons/rg_thread.c: Implement periodic status checks. - Currently (in contrast to clumanager 1.2), these status checks - are automatic and not configurable. - * src/resources/*: Misc updates re: check intervals, new - parameters, etc. - -2004-09-07 Lon Hohberger - * src/resources/group.sh: Add 'autostart' parameter to group - entity - * src/daemons/*: Add support for OCF 'action' specifications. - -2004-08-30 Lon Hohberger - * src/resources/*: Add status/monitor actions to metadata - * include/list.h: Update to fix compiler warnings. This is not - complete; it's better to add a 'field' to structures requiring - list specs. - * src/clulib/vft.c: Remove unnecessary pthread locks. - * src/daemons/*: Misc. code cleanups. - -2004-08-12 Lon Hohberger - * global: prepare for RPM build diff --git a/rgmanager/Makefile b/rgmanager/Makefile deleted file mode 100644 index 8f730e3..0000000 --- a/rgmanager/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../make/defines.mk -include $(OBJDIR)/make/passthrough.mk - -SUBDIRS=src man init.d diff --git a/rgmanager/Makefile.am b/rgmanager/Makefile.am new file mode 100644 index 0000000..97d7e39 --- /dev/null +++ b/rgmanager/Makefile.am @@ -0,0 +1,11 @@ +MAINTAINERCLEANFILES = Makefile.in + +# init.d +SUBDIRS = src \ + include \ + examples \ + man + +dist_doc_DATA = errors.txt \ + event-script.txt \ + README diff --git a/rgmanager/examples/Makefile.am b/rgmanager/examples/Makefile.am new file mode 100644 index 0000000..54a87eb --- /dev/null +++ b/rgmanager/examples/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +dist_doc_DATA = cluster.conf diff --git a/rgmanager/include/Makefile.am b/rgmanager/include/Makefile.am new file mode 100644 index 0000000..8ce6042 --- /dev/null +++ b/rgmanager/include/Makefile.am @@ -0,0 +1,30 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_HEADERS = cman-private.h \ + daemon_init.h \ + ds.h \ + event.h \ + fdops.h \ + findproc.h \ + fo_domain.h \ + gettid.h \ + groups.h \ + list.h \ + lock.h \ + logging.h \ + members.h \ + message.h \ + msgsimple.h \ + platform.h \ + pthread_dbg.h \ + resgroup.h \ + reslist.h \ + res-ocf.h \ + restart_counter.h \ + rg_locks.h \ + rg_queue.h \ + rg_types.h \ + rmtab.h \ + sets.h \ + signals.h \ + vf.h diff --git a/rgmanager/include/reslist.h b/rgmanager/include/reslist.h index 20f205d..5600cf5 100644 --- a/rgmanager/include/reslist.h +++ b/rgmanager/include/reslist.h @@ -35,11 +35,7 @@ #define RES_STARTED (1) #define RES_FAILED (2) -#ifndef SHAREDIR -#define SHAREDIR "/usr/share/rgmanager" -#endif - -#define RESOURCE_ROOTDIR SHAREDIR +#define RESOURCE_ROOTDIR CLUSTERDATA #define RESOURCE_TREE_ROOT "/cluster/rm" #define RESOURCE_BASE RESOURCE_TREE_ROOT "/resources" #define RESOURCE_ROOT_FMT RESOURCE_TREE_ROOT "/%s[%d]" diff --git a/rgmanager/init.d/Makefile b/rgmanager/init.d/Makefile deleted file mode 100644 index 4c9a44f..0000000 --- a/rgmanager/init.d/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -TARGET= rgmanager - -INITDT=$(TARGET) - -all: $(TARGET) - -include ../../make/defines.mk -include $(OBJDIR)/make/clean.mk -include $(OBJDIR)/make/install.mk -include $(OBJDIR)/make/uninstall.mk - -$(TARGET): $(S)/$(TARGET).in - cat $(S)/$(TARGET).in | sed \ - -e 's#@SBINDIR@#${sbindir}#g' \ - -e 's#@INITDDIR@#${initddir}#g' \ - > $(TARGET) - -clean: generalclean - -check: diff --git a/rgmanager/man/Makefile b/rgmanager/man/Makefile deleted file mode 100644 index d965432..0000000 --- a/rgmanager/man/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -TARGET= clubufflush.8 \ - clufindhostname.8 \ - clulog.8 \ - clurgmgrd.8 \ - clurmtabd.8 \ - clustat.8 \ - clusvcadm.8 - -include ../../make/defines.mk -include $(OBJDIR)/make/man.mk - -check: diff --git a/rgmanager/man/Makefile.am b/rgmanager/man/Makefile.am new file mode 100644 index 0000000..63ffcdd --- /dev/null +++ b/rgmanager/man/Makefile.am @@ -0,0 +1,12 @@ +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = cluarp.8 \ + clunfsops.8 + +dist_man_MANS = clubufflush.8 \ + clufindhostname.8 \ + clulog.8 \ + clurgmgrd.8 \ + clurmtabd.8 \ + clustat.8 \ + clusvcadm.8 diff --git a/rgmanager/src/Makefile b/rgmanager/src/Makefile deleted file mode 100644 index 94f3bce..0000000 --- a/rgmanager/src/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -include ../../make/defines.mk -include $(OBJDIR)/make/passthrough.mk - -SUBDIRS=clulib daemons utils diff --git a/rgmanager/src/Makefile.am b/rgmanager/src/Makefile.am new file mode 100644 index 0000000..534b029 --- /dev/null +++ b/rgmanager/src/Makefile.am @@ -0,0 +1,3 @@ +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = clulib daemons utils diff --git a/rgmanager/src/clulib/Makefile b/rgmanager/src/clulib/Makefile deleted file mode 100644 index 52cd438..0000000 --- a/rgmanager/src/clulib/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -TARGET1= libclulib.a -TARGET2= msgtest - -all: ${TARGET1} ${TARGET2} - -include ../../../make/defines.mk -include $(OBJDIR)/make/cobj.mk -include $(OBJDIR)/make/clean.mk -include $(OBJDIR)/make/install.mk -include $(OBJDIR)/make/uninstall.mk - -OBJS1= logging.o daemon_init.o signals.o msgsimple.o \ - gettid.o rg_strings.o message.o members.o fdops.o \ - lock.o cman.o vft.o msg_cluster.o msg_socket.o \ - wrap_lock.o sets.o - -OBJS2= msgtest.o - -CFLAGS += -Werror -Wstrict-prototypes -Wshadow -fPIC -D_GNU_SOURCE -CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${dlmincdir} -CFLAGS += -I${logtincdir} -CFLAGS += -I$(S)/../../include -CFLAGS += -I${incdir} - -LDFLAGS += -L${cmanlibdir} -lcman -LDFLAGS += -L. -lclulib -LDFLAGS += -lpthread -LDFLAGS += -L${logtlibdir} -llogthread -LDFLAGS += -L${libdir} - -${TARGET1}: ${OBJS1} - ${AR} cru $@ $^ - ${RANLIB} $@ - -${TARGET2}: ${OBJS2} ${TARGET1} - $(CC) -o $@ $^ $(LDFLAGS) - -clean: generalclean - --include $(OBJS1:.o=.d) --include $(OBJS2:.o=.d) diff --git a/rgmanager/src/clulib/Makefile.am b/rgmanager/src/clulib/Makefile.am new file mode 100644 index 0000000..13d112c --- /dev/null +++ b/rgmanager/src/clulib/Makefile.am @@ -0,0 +1,42 @@ +MAINTAINERCLEANFILES = Makefile.in + +noinst_LTLIBRARIES = libclulib.la + +EXTRA_DIST = ckpt_state.c \ + locktest.c \ + tmgr.c + +libclulib_la_SOURCES = cman.c \ + daemon_init.c \ + fdops.c \ + gettid.c \ + lock.c \ + logging.c \ + members.c \ + message.c \ + msg_cluster.c \ + msgsimple.c \ + msg_socket.c \ + rg_strings.c \ + sets.c \ + signals.c \ + vft.c \ + wrap_lock.c + +libclulib_la_CPPFLAGS = -D_GNU_SOURCE \ + -I$(top_srcdir)/rgmanager/include + +libclulib_la_CFLAGS = $(cman_CFLAGS) $(logt_CFLAGS) + +libclulib_la_LDFLAGS = $(cman_LIBS) $(logt_LIBS) -lpthread + +noinst_PROGRAMS = msgtest + +msgtest_CPPFLAGS = -D_GNU_SOURCE \ + -I$(top_srcdir)/rgmanager/include + +msgtest_CFLAGS = $(cman_CFLAGS) + +msgtest_LDFLAGS = $(cman_LIBS) -lpthread + +msgtest_LDADD = $(top_builddir)/rgmanager/src/clulib/libclulib.la diff --git a/rgmanager/src/clulib/ckpt_state.c b/rgmanager/src/clulib/ckpt_state.c index fd85aee..27891d0 100644 --- a/rgmanager/src/clulib/ckpt_state.c +++ b/rgmanager/src/clulib/ckpt_state.c @@ -2,6 +2,8 @@ /** @file * Distributed states using saCkpt interface */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/cman.c b/rgmanager/src/clulib/cman.c index 841e43c..4f11290 100644 --- a/rgmanager/src/clulib/cman.c +++ b/rgmanager/src/clulib/cman.c @@ -1,6 +1,8 @@ /** pthread mutex wrapper for a global CMAN handle */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/daemon_init.c b/rgmanager/src/clulib/daemon_init.c index e9adeed..5d1fc64 100644 --- a/rgmanager/src/clulib/daemon_init.c +++ b/rgmanager/src/clulib/daemon_init.c @@ -12,6 +12,8 @@ * * Also need to add file locking for the pid file. */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/fdops.c b/rgmanager/src/clulib/fdops.c index c7857c6..f8f76f9 100644 --- a/rgmanager/src/clulib/fdops.c +++ b/rgmanager/src/clulib/fdops.c @@ -2,6 +2,8 @@ * Wrapper functions around read/write/select to retry in the event * of interrupts. */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/gettid.c b/rgmanager/src/clulib/gettid.c index ba571c6..c699467 100644 --- a/rgmanager/src/clulib/gettid.c +++ b/rgmanager/src/clulib/gettid.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/lock.c b/rgmanager/src/clulib/lock.c index be542c1..6784a16 100644 --- a/rgmanager/src/clulib/lock.c +++ b/rgmanager/src/clulib/lock.c @@ -1,6 +1,8 @@ /** @file * Locking. */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/locktest.c b/rgmanager/src/clulib/locktest.c index c0d37b7..8dbd9c7 100644 --- a/rgmanager/src/clulib/locktest.c +++ b/rgmanager/src/clulib/locktest.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/logging.c b/rgmanager/src/clulib/logging.c index 51c28b9..4707951 100644 --- a/rgmanager/src/clulib/logging.c +++ b/rgmanager/src/clulib/logging.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #define SYSLOG_NAMES diff --git a/rgmanager/src/clulib/members.c b/rgmanager/src/clulib/members.c index 5f98708..96f9c19 100644 --- a/rgmanager/src/clulib/members.c +++ b/rgmanager/src/clulib/members.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/message.c b/rgmanager/src/clulib/message.c index 3eb7b2f..237cf33 100644 --- a/rgmanager/src/clulib/message.c +++ b/rgmanager/src/clulib/message.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #define _MESSAGE_BUILD #include #include diff --git a/rgmanager/src/clulib/msg_cluster.c b/rgmanager/src/clulib/msg_cluster.c index 136b376..8a0422d 100644 --- a/rgmanager/src/clulib/msg_cluster.c +++ b/rgmanager/src/clulib/msg_cluster.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #define _MESSAGE_BUILD #include #include diff --git a/rgmanager/src/clulib/msg_socket.c b/rgmanager/src/clulib/msg_socket.c index 130cbd7..7c8ba2e 100644 --- a/rgmanager/src/clulib/msg_socket.c +++ b/rgmanager/src/clulib/msg_socket.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #define _MESSAGE_BUILD #include #include diff --git a/rgmanager/src/clulib/msgsimple.c b/rgmanager/src/clulib/msgsimple.c index 0681619..764e32c 100644 --- a/rgmanager/src/clulib/msgsimple.c +++ b/rgmanager/src/clulib/msgsimple.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/msgtest.c b/rgmanager/src/clulib/msgtest.c index 4b46d6c..cd90848 100644 --- a/rgmanager/src/clulib/msgtest.c +++ b/rgmanager/src/clulib/msgtest.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/rg_strings.c b/rgmanager/src/clulib/rg_strings.c index 35c570d..895cd0a 100644 --- a/rgmanager/src/clulib/rg_strings.c +++ b/rgmanager/src/clulib/rg_strings.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include diff --git a/rgmanager/src/clulib/sets.c b/rgmanager/src/clulib/sets.c index f4873c4..2ef6621 100644 --- a/rgmanager/src/clulib/sets.c +++ b/rgmanager/src/clulib/sets.c @@ -3,6 +3,8 @@ (designed for integer types; a la int, uint64_t, etc...) @author Lon Hohberger */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/signals.c b/rgmanager/src/clulib/signals.c index 1d49ee5..ceb1beb 100644 --- a/rgmanager/src/clulib/signals.c +++ b/rgmanager/src/clulib/signals.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/tmgr.c b/rgmanager/src/clulib/tmgr.c index a86d258..eed2646 100644 --- a/rgmanager/src/clulib/tmgr.c +++ b/rgmanager/src/clulib/tmgr.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #ifdef WRAP_THREADS #include #include diff --git a/rgmanager/src/clulib/vft.c b/rgmanager/src/clulib/vft.c index eefba2f..7be816a 100644 --- a/rgmanager/src/clulib/vft.c +++ b/rgmanager/src/clulib/vft.c @@ -8,6 +8,8 @@ * model like NFS and have clients restate their resource group states * after a server failure. */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/clulib/wrap_lock.c b/rgmanager/src/clulib/wrap_lock.c index 0bd47e6..ccb08ab 100644 --- a/rgmanager/src/clulib/wrap_lock.c +++ b/rgmanager/src/clulib/wrap_lock.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #ifdef WRAP_LOCKS #include #include diff --git a/rgmanager/src/daemons/Makefile b/rgmanager/src/daemons/Makefile deleted file mode 100644 index 0d42a26..0000000 --- a/rgmanager/src/daemons/Makefile +++ /dev/null @@ -1,115 +0,0 @@ -TARGET1= rgmanager -TARGET2= rg_test -TARGET3= dtest -TARGET4= clurgmgrd - -SBINDIRT=$(TARGET1) $(TARGET2) -SBINSYMT=$(TARGET4) - -all: depends ${TARGET1} ${TARGET2} ${TARGET4} - -include ../../../make/defines.mk -include $(OBJDIR)/make/cobj.mk -include $(OBJDIR)/make/clean.mk -include $(OBJDIR)/make/install.mk -include $(OBJDIR)/make/uninstall.mk - -OBJS1= fo_domain.o \ - groups.o \ - main.o \ - reslist.o \ - resrules.o \ - restree.o \ - restart_counter.o \ - rg_event.o \ - rg_forward.o \ - rg_locks.o \ - rg_queue.o \ - rg_state.o \ - rg_thread.o \ - service_op.o \ - slang_event.o \ - event_config.o \ - watchdog.o - -OBJS2= test-noccs.o - -OBJS3= dtest-noccs.o - -SHAREDOBJS= fo_domain-noccs.o \ - restart_counter.o \ - reslist-noccs.o \ - resrules-noccs.o \ - restree-noccs.o \ - rg_locks-noccs.o \ - event_config-noccs.o - -CFLAGS += -DSHAREDIR=\"${sharedir}\" -CFLAGS += -Werror -Wstrict-prototypes -Wshadow -fPIC -CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${dlmincdir} -I${logtincdir} -CFLAGS += `xml2-config --cflags` -I${readlineincdir} -I${slangincdir} -CFLAGS += -I$(S)/../../include -CFLAGS += -I${incdir} - -NOCCS_CFLAGS += -DNO_CCS - -LDFLAGS += -L../clulib -lclulib -LDFLAGS += -L${libdir} - -CCS_LDFLAGS += -L${ccslibdir} -lccs -CMAN_LDFLAGS += -L${cmanlibdir} -lcman -LOGSYS_LDFLAGS += -L${logtlibdir} -llogthread -DLM_LDFLAGS += -L${dlmlibdir} -ldlm -XML2_LDFLAGS += `xml2-config --libs` -SLANG_LDFLAGS += -L${slanglibdir} -lslang -EXTRA_LDFLAGS += -lpthread -READLINE_LDFLAGS += -L${readlinelibdir} -lreadline - -LDDEPS += ../clulib/libclulib.a - -${TARGET1}: ${OBJS1} ${LDDEPS} - $(CC) -o $@ $^ $(CCS_LDFLAGS) $(CMAN_LDFLAGS) \ - $(DLM_LDFLAGS) $(XML2_LDFLAGS) \ - $(SLANG_LDFLAGS) $(EXTRA_LDFLAGS) \ - $(LOGSYS_LDFLAGS) $(LD_FLAGS) - -# -# Our test program links against the local allocator so that -# we can see if our program is leaking memory during XML parsing, tree -# delta calculations, building/teardown of resource lists, etc. -# If it's leaking memory, the 'make check' will fail. Also, we can -# use it to test known-good configurations for regressions. -# -# The data in the 'tests' directory is hand-crafted; so running 'gentests.sh' -# will require that the developer hand-verify the correctness of the -# resulting output prior to committing back to CVS. -# -# This is NOT meant to be an installed binary. Rather, RPMs and/or other -# packages should run 'make check' as part of the build process. -# -${TARGET2}: ${SHAREDOBJS} ${OBJS2} ${LDDEPS} - $(CC) -o $@ $^ $(CMAN_LDFLAGS) $(EXTRA_LDFLAGS) \ - $(XML2_LDFLAGS) $(LOGSYS_LDFLAGS) $(LDFLAGS) - -${TARGET3}: ${SHAREDOBJS} ${OBJS3} ${LDDEPS} - $(CC) -o $@ $^ $(CCS_LDFLAGS) $(CMAN_LDFLAGS) \ - $(EXTRA_LDFLAGS) $(XML2_LDFLAGS) \ - $(READLINE_LDFLAGS) $(LOGSYS_LDFLAGS) $(LDFLAGS) - -${TARGET4}: ${TARGET1} - ln -sf ${TARGET1} ${TARGET4} - -check: rg_test - cd tests && ./runtests.sh - -depends: - $(MAKE) -C ../clulib all - -clean: generalclean - rm -f tests/*.out* - --include $(OBJS1:.o=.d) --include $(OBJS2:.o=.d) --include $(OBJS3:.o=.d) --include $(OBJS4:.o=.d) --include $(SHAREDOBJS:.o=.d) diff --git a/rgmanager/src/daemons/Makefile.am b/rgmanager/src/daemons/Makefile.am new file mode 100644 index 0000000..5e45e31 --- /dev/null +++ b/rgmanager/src/daemons/Makefile.am @@ -0,0 +1,61 @@ +MAINTAINERCLEANFILES = Makefile.in + +SUBDIRS = tests + +sbin_PROGRAMS = rgmanager \ + rg_test + +rgmanager_SOURCES = fo_domain.c \ + groups.c \ + main.c \ + reslist.c \ + resrules.c \ + restree.c \ + restart_counter.c \ + rg_event.c \ + rg_forward.c \ + rg_locks.c \ + rg_queue.c \ + rg_state.c \ + rg_thread.c \ + service_op.c \ + slang_event.c \ + event_config.c \ + watchdog.c + +rgmanager_CPPFLAGS = -I$(top_srcdir)/rgmanager/include + +rgmanager_CFLAGS = $(ccs_CFLAGS) $(cman_CFLAGS) $(dlm_CFLAGS) \ + $(xml_CFLAGS) $(slang_CFLAGS) $(logt_CFLAGS) + +rgmanager_LDFLAGS = $(ccs_LIBS) $(cman_LIBS) $(dlm_LIBS) \ + $(xml_LIBS) $(slang_LIBS) $(logt_LIBS) \ + -lpthread + +rgmanager_LDADD = $(top_builddir)/rgmanager/src/clulib/libclulib.la + +rg_test_SOURCES = fo_domain.c \ + restart_counter.c \ + reslist.c \ + resrules.c \ + restree.c \ + rg_locks.c \ + event_config.c \ + test.c + +rg_test_CPPFLAGS = -DNO_CCS \ + -I$(top_srcdir)/rgmanager/include + +rg_test_CFLAGS = $(cman_CFLAGS) $(xml_CFLAGS) $(logt_CFLAGS) + +rg_test_LDFLAGS = $(cman_LIBS) $(xml_LIBS) $(logt_LIBS) \ + -lpthread + +rg_test_LDADD = $(top_builddir)/rgmanager/src/clulib/libclulib.la + +# this fails because it expects RAs in the tree. Needs fixing +#check-local: rg_test +# cd tests && bash ./runtests.sh + +clean-local: + rm -f tests/*.out* diff --git a/rgmanager/src/daemons/event_config.c b/rgmanager/src/daemons/event_config.c index 3523a6d..8dc6193 100644 --- a/rgmanager/src/daemons/event_config.c +++ b/rgmanager/src/daemons/event_config.c @@ -1,6 +1,8 @@ /** @file * CCS event parsing, based on failover domain parsing */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/fo_domain.c b/rgmanager/src/daemons/fo_domain.c index 08590d2..3955158 100644 --- a/rgmanager/src/daemons/fo_domain.c +++ b/rgmanager/src/daemons/fo_domain.c @@ -5,6 +5,8 @@ * April 2006 - Nofailback option added to restrict failover behavior in ordered * + restricted failover domains by Josef Whiter */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/groups.c b/rgmanager/src/daemons/groups.c index 1d58041..573a973 100644 --- a/rgmanager/src/daemons/groups.c +++ b/rgmanager/src/daemons/groups.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + //#define DEBUG #include #include diff --git a/rgmanager/src/daemons/main.c b/rgmanager/src/daemons/main.c index 88970f1..c47a326 100644 --- a/rgmanager/src/daemons/main.c +++ b/rgmanager/src/daemons/main.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/reslist.c b/rgmanager/src/daemons/reslist.c index 96336e4..b77d545 100644 --- a/rgmanager/src/daemons/reslist.c +++ b/rgmanager/src/daemons/reslist.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/resrules.c b/rgmanager/src/daemons/resrules.c index 7c68ce0..d197685 100644 --- a/rgmanager/src/daemons/resrules.c +++ b/rgmanager/src/daemons/resrules.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/restart_counter.c b/rgmanager/src/daemons/restart_counter.c index 8789987..5e70387 100644 --- a/rgmanager/src/daemons/restart_counter.c +++ b/rgmanager/src/daemons/restart_counter.c @@ -1,4 +1,5 @@ /* Time-based restart counters for rgmanager */ +#include "clusterautoconfig.h" #include #include diff --git a/rgmanager/src/daemons/restree.c b/rgmanager/src/daemons/restree.c index 5afbc5c..4c8225a 100644 --- a/rgmanager/src/daemons/restree.c +++ b/rgmanager/src/daemons/restree.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/rg_event.c b/rgmanager/src/daemons/rg_event.c index d03f4e3..cded743 100644 --- a/rgmanager/src/daemons/rg_event.c +++ b/rgmanager/src/daemons/rg_event.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/rg_forward.c b/rgmanager/src/daemons/rg_forward.c index bb42922..72920f0 100644 --- a/rgmanager/src/daemons/rg_forward.c +++ b/rgmanager/src/daemons/rg_forward.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + //#define DEBUG #include #include diff --git a/rgmanager/src/daemons/rg_locks.c b/rgmanager/src/daemons/rg_locks.c index f2d1050..937c8d9 100644 --- a/rgmanager/src/daemons/rg_locks.c +++ b/rgmanager/src/daemons/rg_locks.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/rg_queue.c b/rgmanager/src/daemons/rg_queue.c index 758f5e4..96b343e 100644 --- a/rgmanager/src/daemons/rg_queue.c +++ b/rgmanager/src/daemons/rg_queue.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c index 16204e1..7eea6ba 100644 --- a/rgmanager/src/daemons/rg_state.c +++ b/rgmanager/src/daemons/rg_state.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/rg_thread.c b/rgmanager/src/daemons/rg_thread.c index 5d22968..fa166c2 100644 --- a/rgmanager/src/daemons/rg_thread.c +++ b/rgmanager/src/daemons/rg_thread.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/sbuf.c b/rgmanager/src/daemons/sbuf.c index d98617f..09d75a3 100644 --- a/rgmanager/src/daemons/sbuf.c +++ b/rgmanager/src/daemons/sbuf.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/service_op.c b/rgmanager/src/daemons/service_op.c index aa36f41..fe94916 100644 --- a/rgmanager/src/daemons/service_op.c +++ b/rgmanager/src/daemons/service_op.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/slang_event.c b/rgmanager/src/daemons/slang_event.c index 3f93039..2a2d509 100644 --- a/rgmanager/src/daemons/slang_event.c +++ b/rgmanager/src/daemons/slang_event.c @@ -1,6 +1,8 @@ /** @file S/Lang event handling & intrinsic functions + vars */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/test.c b/rgmanager/src/daemons/test.c index 3c487c9..b4f41df 100644 --- a/rgmanager/src/daemons/test.c +++ b/rgmanager/src/daemons/test.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/daemons/tests/Makefile.am b/rgmanager/src/daemons/tests/Makefile.am new file mode 100644 index 0000000..f03e71d --- /dev/null +++ b/rgmanager/src/daemons/tests/Makefile.am @@ -0,0 +1,96 @@ +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = delta-test001-test002.expected \ + delta-test002-test003.expected \ + delta-test003-test004.expected \ + delta-test004-test005.expected \ + delta-test005-test006.expected \ + delta-test006-test007.expected \ + delta-test007-test008.expected \ + delta-test008-test009.expected \ + delta-test009-test010.expected \ + delta-test010-test011.expected \ + delta-test011-test012.expected \ + delta-test012-test013.expected \ + delta-test013-test014.expected \ + delta-test014-test015.expected \ + delta-test015-test016.expected \ + delta-test016-test017.expected \ + deptest1.conf \ + deptest1.in \ + deptest2.conf \ + deptest2.in \ + gentests.sh \ + runtests.sh \ + test001.conf \ + test001.expected \ + test001.start.expected \ + test001.stop.expected \ + test002.conf \ + test002.expected \ + test002.start.expected \ + test002.stop.expected \ + test003.conf \ + test003.expected \ + test003.start.expected \ + test003.stop.expected \ + test004.conf \ + test004.expected \ + test004.start.expected \ + test004.stop.expected \ + test005.conf \ + test005.expected \ + test005.start.expected \ + test005.stop.expected \ + test006.conf \ + test006.expected \ + test006.start.expected \ + test006.stop.expected \ + test007.conf \ + test007.expected \ + test007.start.expected \ + test007.stop.expected \ + test008.conf \ + test008.expected \ + test008.start.expected \ + test008.stop.expected \ + test009.conf \ + test009.expected \ + test009.start.expected \ + test009.stop.expected \ + test010.conf \ + test010.expected \ + test010.start.expected \ + test010.stop.expected \ + test011.conf \ + test011.expected \ + test011.start.expected \ + test011.stop.expected \ + test012.conf \ + test012.expected \ + test012.start.expected \ + test012.stop.expected \ + test013.conf \ + test013.expected \ + test013.start.expected \ + test013.stop.expected \ + test014.conf \ + test014.expected \ + test014.start.expected \ + test014.stop.expected \ + test015.conf \ + test015.expected \ + test015.start.expected \ + test015.stop.expected \ + test016.conf \ + test016.expected \ + test016.start.expected \ + test016.stop.expected \ + test017.conf \ + test017.expected \ + test017.start.expected \ + test017.stop.expected \ + test018.conf \ + test018.start.expected \ + test018.stop.expected \ + testlist diff --git a/rgmanager/src/daemons/watchdog.c b/rgmanager/src/daemons/watchdog.c index 6efd655..24789a8 100644 --- a/rgmanager/src/daemons/watchdog.c +++ b/rgmanager/src/daemons/watchdog.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/utils/Makefile b/rgmanager/src/utils/Makefile deleted file mode 100644 index 0e01c73..0000000 --- a/rgmanager/src/utils/Makefile +++ /dev/null @@ -1,75 +0,0 @@ -TARGET1= clubufflush -TARGET2= clufindhostname -TARGET3= clustat -TARGET4= clusvcadm -TARGET5= clulog -TARGET6= clunfslock - -SBINDIRT=$(TARGET1) $(TARGET2) $(TARGET3) $(TARGET4) $(TARGET5) $(TARGET6) - -all: depends ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6} - -include ../../../make/defines.mk -include $(OBJDIR)/make/cobj.mk -include $(OBJDIR)/make/clean.mk -include $(OBJDIR)/make/install.mk -include $(OBJDIR)/make/uninstall.mk - -DISABLEDTARGETS= cluarp - -CFLAGS += -Werror -Wstrict-prototypes -Wshadow -fPIC -D_GNU_SOURCE -CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${dlmincdir} -CFLAGS += -I${logtincdir} -I${ncursesincdir} -CFLAGS += -I$(S)/../../include -CFLAGS += -I${incdir} - -LDFLAGS += -L../clulib -lclulib -LDFLAGS += -L${libdir} - -LDDEPS += ../clulib/libclulib.a - -CCS_LDFLAGS += -L${ccslibdir} -lccs -CMAN_LDFLAGS += -L${cmanlibdir} -lcman -LOGSYS_LDFLAGS += -L${logtlibdir} -llogthread -NCURSES_LDFLAGS += -L${ncurseslibdir} -lncurses -PTHREAD_LDFLAGS += -lpthread - -OBJS1= $(TARGET1).o -OBJS2= $(TARGET2).o -OBJS3= $(TARGET3).o -OBJS4= $(TARGET4).o -OBJS5= $(TARGET5).o - -${TARGET1}: ${OBJS1} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -${TARGET2}: ${OBJS2} ${LDDEPS} - $(CC) -o $@ $^ $(LDFLAGS) - -${TARGET3}: ${OBJS3} ${LDDEPS} - $(CC) -o $@ $^ $(CCS_LDFLAGS) $(CMAN_LDFLAGS) \ - $(NCURSES_LDFLAGS) $(PTHREAD_LDFLAGS) \ - $(LOGSYS_LDFLAGS) $(LDFLAGS) - -${TARGET4}: ${OBJS4} ${LDDEPS} - $(CC) -o $@ $^ $(CMAN_LDFLAGS) $(PTHREAD_LDFLAGS) \ - $(LOGSYS_LDFLAGS) $(LDFLAGS) - -${TARGET5}: ${OBJS5} ${LDDEPS} - $(CC) -o $@ $^ $(CCS_LDFLAGS) \ - $(LOGSYS_LDFLAGS) $(LDFLAGS) - -${TARGET6}: - cp $(S)/${TARGET6}.sh ${TARGET6} - chmod 755 ${TARGET6} - -depends: - $(MAKE) -C ../clulib all - -clean: generalclean - --include $(OBJS1:.o=.d) --include $(OBJS2:.o=.d) --include $(OBJS3:.o=.d) --include $(OBJS4:.o=.d) --include $(OBJS5:.o=.d) diff --git a/rgmanager/src/utils/Makefile.am b/rgmanager/src/utils/Makefile.am new file mode 100644 index 0000000..268b6f1 --- /dev/null +++ b/rgmanager/src/utils/Makefile.am @@ -0,0 +1,43 @@ +MAINTAINERCLEANFILES = Makefile.in + +EXTRA_DIST = cluarp.c \ + clunfsops.c \ + clunfslock + +noinst_HEADER = syscall.h + +sbin_PROGRAMS = clubufflush \ + clufindhostname \ + clustat \ + clusvcadm \ + clulog + +sbin_SCRIPTS = clunfslock + +AM_CPPFLAGS = -I$(top_srcdir)/rgmanager/include + +clulib = $(top_builddir)/rgmanager/src/clulib/libclulib.la + +clubufflush_LDADD = $(clulib) + +clufindhostname_LDADD = $(clulib) + +clustat_CFLAGS = $(ccs_CFLAGS) $(cman_CFLAGS) $(ncurses_CFLAGS) \ + $(logt_CFLAGS) + +clustat_LDFLAGS = $(ccs_LIBS) $(cman_LIBS) $(ncurses_LIBS) \ + $(logt_LIBS) -lpthread + +clustat_LDADD = $(clulib) + +clusvcadm_CFLAGS = $(cman_CFLAGS) $(logt_CFLAGS) + +clusvcadm_LDFLAGS = $(cman_LIBS) $(logt_LIBS) -lpthread + +clusvcadm_LDADD = $(clulib) + +clulog_CFLAGS = $(ccs_CFLAGS) $(logt_CFLAGS) + +clulog_LIBS = $(ccs_LIBS) $(logt_LIBS) + +clulog_LDADD = $(clulib) diff --git a/rgmanager/src/utils/cluarp.c b/rgmanager/src/utils/cluarp.c index 08f123e..f22fa60 100644 --- a/rgmanager/src/utils/cluarp.c +++ b/rgmanager/src/utils/cluarp.c @@ -1,6 +1,7 @@ /** @file * Utility to generate a gratuitous ARP request on a given interface. */ +#include "clusterautoconfig.h" #include #include diff --git a/rgmanager/src/utils/clubufflush.c b/rgmanager/src/utils/clubufflush.c index 3eaed48..92fc042 100644 --- a/rgmanager/src/utils/clubufflush.c +++ b/rgmanager/src/utils/clubufflush.c @@ -5,11 +5,7 @@ * * invalidatebuffers.c */ - -/* - * Version string that is filled in by CVS - */ -static const char *version __attribute__ ((unused)) = "$Revision$"; +#include "clusterautoconfig.h" /* * System includes diff --git a/rgmanager/src/utils/clufindhostname.c b/rgmanager/src/utils/clufindhostname.c index 42e1691..72fde04 100644 --- a/rgmanager/src/utils/clufindhostname.c +++ b/rgmanager/src/utils/clufindhostname.c @@ -4,6 +4,8 @@ * Author: Richard Rabbat * IPv6 support added 7/2006 */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/utils/clulog.c b/rgmanager/src/utils/clulog.c index 627c5b0..c65c909 100644 --- a/rgmanager/src/utils/clulog.c +++ b/rgmanager/src/utils/clulog.c @@ -4,6 +4,8 @@ * Author: Lon Hohberger * Based on original code by: Jeff Moyer */ +#include "clusterautoconfig.h" + #include #include #include diff --git a/rgmanager/src/utils/clunfslock b/rgmanager/src/utils/clunfslock new file mode 100644 index 0000000..67b2d6d --- /dev/null +++ b/rgmanager/src/utils/clunfslock @@ -0,0 +1,69 @@ +#!/bin/bash +# +# rpc.statd -H $0 to enable. This provides the HA-callout capability +# for RHCS-managed NFS services. Note that you must edit +# /etc/sysconfig/nfs in order to make this work; clumanager/rgmanager +# will not interfere with a running nfs statd. +# +# Arg 3 (server as known to client) does not work; it's always 127.0.0.1 +# so we traverse all cluster mount points. +# + +clustered_mounts() +{ + declare dev mp + + while read dev mp; do + if [ "${dev:0:4}" != "/dev" ]; then + continue + fi + + # XXX Need clumanager to create this on mount + if [ -d "$mp/.clumanager" ]; then + echo $dev $mp + fi + done < <(cat /proc/mounts | awk '{print $1,$2}') +} + + +add-client() +{ + declare dev mp + + while read dev mp; do + [ -d "$mp/.clumanager/statd/sm" ] || \ + mkdir -p $mp/.clumanager/statd/sm + touch $mp/.clumanager/statd/sm/$1 + done < <(clustered_mounts) +} + + +del-client() +{ + while read $dev $mp; do + [ -d "$mp/.clumanager/statd/sm" ] || \ + mkdir -p $mp/.clumanager/statd/sm + rm -f $mp/.clumanager/statd/sm/$1 + done < <(clustered_mounts) +} + +case "$1" in + add-client) + : + ;; + del-client) + : + ;; + *) + echo "Usage: $0 [server]" + exit 0 +esac + + +if [ -z "$2" ]; then + echo "Usage: $0 [server]" + exit 1 +fi + +$1 $2 $3 +exit 0 diff --git a/rgmanager/src/utils/clunfslock.sh b/rgmanager/src/utils/clunfslock.sh deleted file mode 100644 index 67b2d6d..0000000 --- a/rgmanager/src/utils/clunfslock.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -# -# rpc.statd -H $0 to enable. This provides the HA-callout capability -# for RHCS-managed NFS services. Note that you must edit -# /etc/sysconfig/nfs in order to make this work; clumanager/rgmanager -# will not interfere with a running nfs statd. -# -# Arg 3 (server as known to client) does not work; it's always 127.0.0.1 -# so we traverse all cluster mount points. -# - -clustered_mounts() -{ - declare dev mp - - while read dev mp; do - if [ "${dev:0:4}" != "/dev" ]; then - continue - fi - - # XXX Need clumanager to create this on mount - if [ -d "$mp/.clumanager" ]; then - echo $dev $mp - fi - done < <(cat /proc/mounts | awk '{print $1,$2}') -} - - -add-client() -{ - declare dev mp - - while read dev mp; do - [ -d "$mp/.clumanager/statd/sm" ] || \ - mkdir -p $mp/.clumanager/statd/sm - touch $mp/.clumanager/statd/sm/$1 - done < <(clustered_mounts) -} - - -del-client() -{ - while read $dev $mp; do - [ -d "$mp/.clumanager/statd/sm" ] || \ - mkdir -p $mp/.clumanager/statd/sm - rm -f $mp/.clumanager/statd/sm/$1 - done < <(clustered_mounts) -} - -case "$1" in - add-client) - : - ;; - del-client) - : - ;; - *) - echo "Usage: $0 [server]" - exit 0 -esac - - -if [ -z "$2" ]; then - echo "Usage: $0 [server]" - exit 1 -fi - -$1 $2 $3 -exit 0 diff --git a/rgmanager/src/utils/clunfsops.c b/rgmanager/src/utils/clunfsops.c index 2a2d16a..27d8042 100644 --- a/rgmanager/src/utils/clunfsops.c +++ b/rgmanager/src/utils/clunfsops.c @@ -7,7 +7,8 @@ * File Origin - this command was reverse-engineered by starting with the * GPL syscall interfaces defined in . */ - +#include "clusterautoconfig.h" + #ifdef X86_64 #define __ASM_SYSTEM_H #define __ASM_X86_64_PROCESSOR_H diff --git a/rgmanager/src/utils/clustat.c b/rgmanager/src/utils/clustat.c index f638727..9905510 100644 --- a/rgmanager/src/utils/clustat.c +++ b/rgmanager/src/utils/clustat.c @@ -1,3 +1,5 @@ +#include "clusterautoconfig.h" + #include #include #include @@ -12,10 +14,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include -#endif - #define FLAG_UP 0x1 #define FLAG_LOCAL 0x2 #define FLAG_RGMGR 0x4 @@ -1076,7 +1074,7 @@ main(int argc, char **argv) goto cleanup; case VERSION_ONLY: printf("%s version %s\n", basename(argv[0]), - RELEASE_VERSION); + VERSION); if (!ch) break; goto cleanup; diff --git a/rgmanager/src/utils/clusvcadm.c b/rgmanager/src/utils/clusvcadm.c index 8fe7599..e977b3d 100644 --- a/rgmanager/src/utils/clusvcadm.c +++ b/rgmanager/src/utils/clusvcadm.c @@ -2,6 +2,8 @@ * The New And Improved Cluster Service Admin Utility. * TODO Clean up the code. */ +#include "clusterautoconfig.h" + #include #include #include @@ -15,11 +17,6 @@ #include #include -#ifdef HAVE_CONFIG_H -#include -#endif - - static void build_message(SmMessageSt *msgp, int action, char *svcName, int target, int arg1, int arg2) @@ -297,7 +294,7 @@ main(int argc, char **argv) node_specified = 1; break; case 'v': - printf("%s\n", RELEASE_VERSION); + printf("%s\n", VERSION); return 0; case 'Z': actionstr = "freezing"; diff --git a/scripts/fenceparse b/scripts/fenceparse deleted file mode 100644 index 8b00698..0000000 --- a/scripts/fenceparse +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -set -e - -definefile="$1" -define="$2" -release="$3" -srcdir="$4" -infile="$5" - -definedata="$(cat $definefile | grep "^\#define $define" | sed -e 's/.*'$define' //')" - -realinfile="$(ls $srcdir/$infile.*)" - -interpreter="$(cat $realinfile | head -n 1 | awk -F "/" '{print $NF}')" -interpreter="$(echo $interpreter)" - -case "$interpreter" in - perl) - start="\$" - end=";" - ;; - *) - start="" - end="" - ;; -esac - -awk "{print}(\$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $realinfile -echo ${start}RELEASE_VERSION=\"${release}\"${end} -echo ${start}REDHAT_COPYRIGHT=${definedata}${end} -echo ${start}BUILD_DATE=\"\(built $(date)\)\"${end} -awk -v p=0 "(\$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $realinfile - -exit 0 diff --git a/scripts/uninstall.pl b/scripts/uninstall.pl deleted file mode 100644 index 4326e85..0000000 --- a/scripts/uninstall.pl +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/perl - -## Description: Basically the reverse of the install program, except it -## only supports a list of files and a directory as arguments - -$| = 1; - -use Getopt::Std; - -# list all valid options here. User will get errors if invalid options are -# specified on the command line -getopts('hD'); - -$args = 1; - -# We need at least two arguments to uninstall -if(!defined($ARGV[1])) { - $args = 0; -} - -# if the user set the help flag or didn't provide enough args, print help -# and die. -if(defined($opt_h) || ($args == 0)) { - $msg = "usage: $0 [OPTIONS] TARGET DIRECTORY\n"; - $msg = $msg . "\t-D\tRemove specified directory if empty\n"; - $msg = $msg . "\t-h\tDisplay this help message\n"; - die $msg; -} - -# find out how many command line arguments we have -$length = $#ARGV; -# We need a special case if there is only one file specified -if($length > 1) { - @filelist = @ARGV; - $#filelist = $length - 1; -} -else { - @filelist = @ARGV[0]; -} - -# the last argument is the directory -$dir = @ARGV[$length]; - -# prepend the directory name to all files in the filelist -$i = 0; -print "Attempting to remove the following files from directory $dir/:\n"; -while($i < $length) { - print "@filelist[$i] "; - @filelist[$i] = "$dir/" . @filelist[$i]; - $i++; -} -print "\n"; - -#print "Files:@filelist\n"; -#print "Directory: $dir\n"; - -# delete the files in filelist -$unlinked = unlink @filelist; -if($unlinked < $length) { - print "Error! Unable to remove all files in $dir:\n\tYou may have to manually delete some of them.\n" -} -# if user specifed they want the directory deleted, try to delete it. Print -# error message if not able to delete directory, including error. -if(defined($opt_D)) { - $result = rmdir($dir); - if($result == FALSE) { - print "Error! Unable to remove directory $dir/:\n\t$!\n"; - } -} - - From fabbione@fedoraproject.org Wed Jul 8 07:59:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Wed, 08 Jul 2009 07:59:00 -0000 Subject: rgmanager: master - build: remove duplication in makefile.am Message-ID: <20090708075838.02B1212036B@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/rgmanager.git?p=rgmanager.git;a=commitdiff;h=b97a67f6ea847cfd1bc9d346869eca5f72bf90e9 Commit: b97a67f6ea847cfd1bc9d346869eca5f72bf90e9 Parent: 31d270c5ebfb4d287c2665062825a4df9d83bacb Author: Fabio M. Di Nitto AuthorDate: Wed Jul 8 09:58:18 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Wed Jul 8 09:58:18 2009 +0200 build: remove duplication in makefile.am Signed-off-by: Fabio M. Di Nitto --- rgmanager/src/clulib/Makefile.am | 5 +---- rgmanager/src/daemons/Makefile.am | 13 +++++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/rgmanager/src/clulib/Makefile.am b/rgmanager/src/clulib/Makefile.am index 13d112c..1a08e1f 100644 --- a/rgmanager/src/clulib/Makefile.am +++ b/rgmanager/src/clulib/Makefile.am @@ -23,7 +23,7 @@ libclulib_la_SOURCES = cman.c \ vft.c \ wrap_lock.c -libclulib_la_CPPFLAGS = -D_GNU_SOURCE \ +AM_CPPFLAGS = -D_GNU_SOURCE \ -I$(top_srcdir)/rgmanager/include libclulib_la_CFLAGS = $(cman_CFLAGS) $(logt_CFLAGS) @@ -32,9 +32,6 @@ libclulib_la_LDFLAGS = $(cman_LIBS) $(logt_LIBS) -lpthread noinst_PROGRAMS = msgtest -msgtest_CPPFLAGS = -D_GNU_SOURCE \ - -I$(top_srcdir)/rgmanager/include - msgtest_CFLAGS = $(cman_CFLAGS) msgtest_LDFLAGS = $(cman_LIBS) -lpthread diff --git a/rgmanager/src/daemons/Makefile.am b/rgmanager/src/daemons/Makefile.am index 5e45e31..5f9a3e5 100644 --- a/rgmanager/src/daemons/Makefile.am +++ b/rgmanager/src/daemons/Makefile.am @@ -5,6 +5,10 @@ SUBDIRS = tests sbin_PROGRAMS = rgmanager \ rg_test +AM_CPPFLAGS = -I$(top_srcdir)/rgmanager/include + +clulib = $(top_builddir)/rgmanager/src/clulib/libclulib.la + rgmanager_SOURCES = fo_domain.c \ groups.c \ main.c \ @@ -23,8 +27,6 @@ rgmanager_SOURCES = fo_domain.c \ event_config.c \ watchdog.c -rgmanager_CPPFLAGS = -I$(top_srcdir)/rgmanager/include - rgmanager_CFLAGS = $(ccs_CFLAGS) $(cman_CFLAGS) $(dlm_CFLAGS) \ $(xml_CFLAGS) $(slang_CFLAGS) $(logt_CFLAGS) @@ -32,7 +34,7 @@ rgmanager_LDFLAGS = $(ccs_LIBS) $(cman_LIBS) $(dlm_LIBS) \ $(xml_LIBS) $(slang_LIBS) $(logt_LIBS) \ -lpthread -rgmanager_LDADD = $(top_builddir)/rgmanager/src/clulib/libclulib.la +rgmanager_LDADD = $(clulib) rg_test_SOURCES = fo_domain.c \ restart_counter.c \ @@ -43,15 +45,14 @@ rg_test_SOURCES = fo_domain.c \ event_config.c \ test.c -rg_test_CPPFLAGS = -DNO_CCS \ - -I$(top_srcdir)/rgmanager/include +rg_test_CPPFLAGS = $(AM_CPPFLAGS) -DNO_CCS rg_test_CFLAGS = $(cman_CFLAGS) $(xml_CFLAGS) $(logt_CFLAGS) rg_test_LDFLAGS = $(cman_LIBS) $(xml_LIBS) $(logt_LIBS) \ -lpthread -rg_test_LDADD = $(top_builddir)/rgmanager/src/clulib/libclulib.la +rg_test_LDADD = $(clulib) # this fails because it expects RAs in the tree. Needs fixing #check-local: rg_test From lon@fedoraproject.org Wed Jul 8 16:40:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Wed, 08 Jul 2009 16:40:00 -0000 Subject: cluster: STABLE3 - config: Update cluster.ldif Message-ID: <20090708163701.768F6120282@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=b150a76a70d1a5ed76ab0ec11819cb72919c3301 Commit: b150a76a70d1a5ed76ab0ec11819cb72919c3301 Parent: 561b8eaf01e7937d30b8c80643fa263ee2891778 Author: Lon Hohberger AuthorDate: Wed Jul 8 12:10:41 2009 -0400 Committer: Lon Hohberger CommitterDate: Wed Jul 8 12:10:41 2009 -0400 config: Update cluster.ldif Signed-off-by: Lon Hohberger --- config/plugins/ldap/99cluster.ldif | 80 ++++++++++++++++++++++++------------ config/plugins/ldap/ldap-base.csv | 16 ++++++- 2 files changed, 68 insertions(+), 28 deletions(-) diff --git a/config/plugins/ldap/99cluster.ldif b/config/plugins/ldap/99cluster.ldif index e3d60b2..c23af02 100644 --- a/config/plugins/ldap/99cluster.ldif +++ b/config/plugins/ldap/99cluster.ldif @@ -1,4 +1,4 @@ -# Auto-generated from ../../tools/xml/cluster.rng +# Auto-generated from cluster.rng dn: cn=schema attributeTypes: ( 1.3.6.1.4.1.2312.8.1.1.1 NAME 'rhcsConfig-version' @@ -55,6 +55,18 @@ attributeTypes: ( SINGLE-VALUE ) attributeTypes: ( + 1.3.6.1.4.1.2312.8.1.1.228 NAME 'rhcsBroadcast' + EQUALITY integerMatch + SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 + SINGLE-VALUE + ) +attributeTypes: ( + 1.3.6.1.4.1.2312.8.1.1.229 NAME 'rhcsDisable-openais' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 + SINGLE-VALUE + ) +attributeTypes: ( 1.3.6.1.4.1.2312.8.1.1.20 NAME 'rhcsAddr' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 @@ -487,6 +499,30 @@ attributeTypes: ( SINGLE-VALUE ) attributeTypes: ( + 1.3.6.1.4.1.2312.8.1.1.230 NAME 'rhcsRingnumber' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 + SINGLE-VALUE + ) +attributeTypes: ( + 1.3.6.1.4.1.2312.8.1.1.231 NAME 'rhcsBindnetaddr' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 + SINGLE-VALUE + ) +attributeTypes: ( + 1.3.6.1.4.1.2312.8.1.1.232 NAME 'rhcsMcastaddr' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 + SINGLE-VALUE + ) +attributeTypes: ( + 1.3.6.1.4.1.2312.8.1.1.233 NAME 'rhcsMcastport' + EQUALITY caseExactIA5Match + SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 + SINGLE-VALUE + ) +attributeTypes: ( 1.3.6.1.4.1.2312.8.1.1.87 NAME 'rhcsLog-level' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 @@ -1021,61 +1057,49 @@ attributeTypes: ( SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.176 NAME 'rhcsMemory' - EQUALITY caseExactIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 - SINGLE-VALUE - ) -attributeTypes: ( 1.3.6.1.4.1.2312.8.1.1.177 NAME 'rhcsMigration-mapping' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.178 NAME 'rhcsBootloader' + 1.3.6.1.4.1.2312.8.1.1.234 NAME 'rhcsUse-virsh' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.179 NAME 'rhcsRootdisk-physical' + 1.3.6.1.4.1.2312.8.1.1.235 NAME 'rhcsXmlfile' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.180 NAME 'rhcsRootdisk-virtual' - EQUALITY caseExactIA5Match - SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 - SINGLE-VALUE - ) -attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.181 NAME 'rhcsSwapdisk-physical' + 1.3.6.1.4.1.2312.8.1.1.184 NAME 'rhcsMigrate' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.182 NAME 'rhcsSwapdisk-virtual' + 1.3.6.1.4.1.2312.8.1.1.185 NAME 'rhcsSnapshot' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.183 NAME 'rhcsVif' + 1.3.6.1.4.1.2312.8.1.1.236 NAME 'rhcsHypervisor' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.184 NAME 'rhcsMigrate' + 1.3.6.1.4.1.2312.8.1.1.237 NAME 'rhcsHypervisor-uri' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.185 NAME 'rhcsSnapshot' + 1.3.6.1.4.1.2312.8.1.1.238 NAME 'rhcsMigration-uri' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE @@ -1267,13 +1291,13 @@ attributeTypes: ( SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.217 NAME 'rhcsForce-fsck' + 1.3.6.1.4.1.2312.8.1.1.227 NAME 'rhcsQuick-status' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.227 NAME 'rhcsQuick-status' + 1.3.6.1.4.1.2312.8.1.1.217 NAME 'rhcsForce-fsck' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE @@ -1338,7 +1362,7 @@ objectClasses: ( ) objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.3 NAME 'rhcsCman' SUP top STRUCTURAL - MAY( rhcsPort $ rhcsDebug-mask $ rhcsCcsd-poll $ rhcsShutdown-timeout $ rhcsQuorum-dev-poll $ rhcsExpected-votes $ rhcsTwo-node ) + MAY( rhcsDisable-openais $ rhcsBroadcast $ rhcsPort $ rhcsDebug-mask $ rhcsCcsd-poll $ rhcsShutdown-timeout $ rhcsQuorum-dev-poll $ rhcsExpected-votes $ rhcsTwo-node ) ) objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.8 NAME 'rhcsMulticast' SUP top STRUCTURAL @@ -1403,6 +1427,10 @@ objectClasses: ( MAY( rhcsKeyfile $ rhcsSecauth $ rhcsRrp-mode $ rhcsToken-retransmits-before-loss-const $ rhcsToken $ rhcsJoin $ rhcsConsensus ) ) objectClasses: ( + 1.3.6.1.4.1.2312.8.1.2.56 NAME 'rhcsInterface' SUP top STRUCTURAL + MAY( rhcsBroadcast $ rhcsMcastport $ rhcsMcastaddr $ rhcsBindnetaddr $ rhcsRingnumber ) + ) +objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.21 NAME 'rhcsRm' SUP top STRUCTURAL MAY( rhcsLog-facility $ rhcsCentral-processing $ rhcsTransition-throttling $ rhcsStatus-poll-interval $ rhcsStatusmax $ rhcsLog-level ) ) @@ -1447,7 +1475,7 @@ objectClasses: ( ) objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.31 NAME 'rhcsService' SUP top STRUCTURAL - MAY( rhcs--enforce-timeouts $ rhcs--independent-subtree $ rhcsRestart-expire-time $ rhcsMax-restarts $ rhcsDepend-mode $ rhcsDepend $ rhcsRecovery $ rhcsNfs-client-cache $ rhcsNfslock $ rhcsExclusive $ rhcsHardrecovery $ rhcsAutostart $ rhcsDomain $ name $ rhcsRef ) + MAY( rhcs--enforce-timeouts $ rhcs--independent-subtree $ rhcsPriority $ rhcsRestart-expire-time $ rhcsMax-restarts $ rhcsDepend-mode $ rhcsDepend $ rhcsRecovery $ rhcsNfs-client-cache $ rhcsNfslock $ rhcsExclusive $ rhcsHardrecovery $ rhcsAutostart $ rhcsDomain $ name $ rhcsRef ) ) objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.32 NAME 'rhcsIp' SUP top STRUCTURAL @@ -1507,7 +1535,7 @@ objectClasses: ( ) objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.46 NAME 'rhcsVm' SUP top STRUCTURAL - MAY( rhcs--enforce-timeouts $ rhcs--independent-subtree $ rhcsRestart-expire-time $ rhcsMax-restarts $ rhcsDepend-mode $ rhcsDepend $ rhcsSnapshot $ rhcsMigrate $ rhcsVif $ rhcsSwapdisk-virtual $ rhcsSwapdisk-physical $ rhcsRootdisk-virtual $ rhcsRootdisk-physical $ rhcsPath $ rhcsBootloader $ rhcsMigration-mapping $ rhcsMemory $ rhcsRecovery $ rhcsExclusive $ rhcsHardrecovery $ rhcsAutostart $ rhcsDomain $ name $ rhcsRef ) + MAY( rhcs--enforce-timeouts $ rhcs--independent-subtree $ rhcsMigration-uri $ rhcsHypervisor-uri $ rhcsHypervisor $ rhcsRestart-expire-time $ rhcsMax-restarts $ rhcsDepend-mode $ rhcsDepend $ rhcsSnapshot $ rhcsMigrate $ rhcsXmlfile $ rhcsUse-virsh $ rhcsMigration-mapping $ rhcsRecovery $ rhcsExclusive $ rhcsHardrecovery $ rhcsAutostart $ rhcsDomain $ name $ rhcsRef ) ) objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.47 NAME 'rhcsSAPInstance' SUP top STRUCTURAL @@ -1527,7 +1555,7 @@ objectClasses: ( ) objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.51 NAME 'rhcsFs' SUP top STRUCTURAL - MAY( rhcs--enforce-timeouts $ rhcs--independent-subtree $ rhcsQuick-status $ rhcsOptions $ rhcsForce-fsck $ rhcsFsid $ rhcsNfslock $ rhcsSelf-fence $ rhcsForce-unmount $ rhcsFstype $ rhcsDevice $ rhcsMountpoint $ name $ rhcsRef ) + MAY( rhcs--enforce-timeouts $ rhcs--independent-subtree $ rhcsOptions $ rhcsForce-fsck $ rhcsFsid $ rhcsNfslock $ rhcsSelf-fence $ rhcsQuick-status $ rhcsForce-unmount $ rhcsFstype $ rhcsDevice $ rhcsMountpoint $ name $ rhcsRef ) ) objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.52 NAME 'rhcsOracledb' SUP top STRUCTURAL diff --git a/config/plugins/ldap/ldap-base.csv b/config/plugins/ldap/ldap-base.csv index d6221e7..b90c39f 100644 --- a/config/plugins/ldap/ldap-base.csv +++ b/config/plugins/ldap/ldap-base.csv @@ -1,5 +1,5 @@ -# Max attribute value: 227 -# Max object class value: 55 +# Max attribute value: 238 +# Max object class value: 56 obj,rhcsCluster,cluster,1 obj,rhcsCman,cman,3 obj,rhcsTotem,totem,4 @@ -281,3 +281,15 @@ attr,rhcsBlade,blade,224 attr,rhcsLpan,lpan,225 attr,rhcsPserver,pserver,226 attr,rhcsQuick-status,quick_status,227 +attr,rhcsBroadcast,broadcast,228 +attr,rhcsDisable-openais,disable_openais,229 +obj,rhcsInterface,interface,56 +attr,rhcsRingnumber,ringnumber,230 +attr,rhcsBindnetaddr,bindnetaddr,231 +attr,rhcsMcastaddr,mcastaddr,232 +attr,rhcsMcastport,mcastport,233 +attr,rhcsUse-virsh,use_virsh,234 +attr,rhcsXmlfile,xmlfile,235 +attr,rhcsHypervisor,hypervisor,236 +attr,rhcsHypervisor-uri,hypervisor_uri,237 +attr,rhcsMigration-uri,migration_uri,238 From lon@fedoraproject.org Wed Jul 8 16:40:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Wed, 08 Jul 2009 16:40:00 -0000 Subject: cluster: STABLE3 - config: Fix misnamed statusmax -> status_child_max Message-ID: <20090708163703.8EBCF1201FB@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5713c7a68e9c1b22fb54b19faf17af3dc00ea6d9 Commit: 5713c7a68e9c1b22fb54b19faf17af3dc00ea6d9 Parent: b150a76a70d1a5ed76ab0ec11819cb72919c3301 Author: Lon Hohberger AuthorDate: Wed Jul 8 12:35:12 2009 -0400 Committer: Lon Hohberger CommitterDate: Wed Jul 8 12:35:12 2009 -0400 config: Fix misnamed statusmax -> status_child_max Signed-off-by: Lon Hohberger --- config/plugins/ldap/99cluster.ldif | 4 ++-- config/plugins/ldap/ldap-base.csv | 2 +- config/tools/xml/cluster.rng | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/plugins/ldap/99cluster.ldif b/config/plugins/ldap/99cluster.ldif index c23af02..72e2d57 100644 --- a/config/plugins/ldap/99cluster.ldif +++ b/config/plugins/ldap/99cluster.ldif @@ -529,7 +529,7 @@ attributeTypes: ( SINGLE-VALUE ) attributeTypes: ( - 1.3.6.1.4.1.2312.8.1.1.88 NAME 'rhcsStatusmax' + 1.3.6.1.4.1.2312.8.1.1.88 NAME 'rhcsStatus-child-max' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE @@ -1432,7 +1432,7 @@ objectClasses: ( ) objectClasses: ( 1.3.6.1.4.1.2312.8.1.2.21 NAME 'rhcsRm' SUP top STRUCTURAL - MAY( rhcsLog-facility $ rhcsCentral-processing $ rhcsTransition-throttling $ rhcsStatus-poll-interval $ rhcsStatusmax $ rhcsLog-level ) + MAY( rhcsLog-facility $ rhcsCentral-processing $ rhcsTransition-throttling $ rhcsStatus-poll-interval $ rhcsStatus-child-max $ rhcsLog-level ) ) ### Placeholder for rhcsFailoverdomains ### This object class currently has no attributes diff --git a/config/plugins/ldap/ldap-base.csv b/config/plugins/ldap/ldap-base.csv index b90c39f..5dfde80 100644 --- a/config/plugins/ldap/ldap-base.csv +++ b/config/plugins/ldap/ldap-base.csv @@ -107,7 +107,7 @@ attr,rhcsSecauth,secauth,85 attr,rhcsKeyfile,keyfile,86 obj,rhcsRm,rm,21 attr,rhcsLog-level,log_level,87 -attr,rhcsStatusmax,statusmax,88 +attr,rhcsStatus-child-max,status_child_max,88 attr,rhcsStatus-poll-interval,status_poll_interval,89 attr,rhcsTransition-throttling,transition_throttling,90 attr,rhcsCentral-processing,central_processing,91 diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index 56d4ff6..ad5ef0f 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -815,7 +815,7 @@ To validate your cluster.conf against this schema, run: - + From lon@fedoraproject.org Wed Jul 8 16:40:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Wed, 08 Jul 2009 16:40:00 -0000 Subject: cluster: STABLE3 - config: Update cluster.rng with new RA params Message-ID: <20090708163659.550A3120209@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=561b8eaf01e7937d30b8c80643fa263ee2891778 Commit: 561b8eaf01e7937d30b8c80643fa263ee2891778 Parent: 66b0782a517329a7eda37fd9c77f60a560a60db9 Author: Lon Hohberger AuthorDate: Wed Jul 8 12:04:42 2009 -0400 Committer: Lon Hohberger CommitterDate: Wed Jul 8 12:05:00 2009 -0400 config: Update cluster.rng with new RA params Signed-off-by: Lon Hohberger --- config/tools/xml/cluster.rng | 40 +++++++++++++++++----------------------- 1 files changed, 17 insertions(+), 23 deletions(-) diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index 23678bf..56d4ff6 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -1065,6 +1065,9 @@ To validate your cluster.conf against this schema, run: + + + @@ -1650,31 +1653,13 @@ To validate your cluster.conf against this schema, run: - - - - - - - - - - - - - - - - + - - - - + @@ -1694,6 +1679,15 @@ To validate your cluster.conf against this schema, run: + + + + + + + + + @@ -1923,6 +1917,9 @@ To validate your cluster.conf against this schema, run: + + + @@ -1937,9 +1934,6 @@ To validate your cluster.conf against this schema, run: - - - From lon@fedoraproject.org Wed Jul 8 16:41:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Wed, 08 Jul 2009 16:41:00 -0000 Subject: cluster: STABLE3 - config: Update relaxng schema for broadcast options Message-ID: <20090708163657.3DB371201FB@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=66b0782a517329a7eda37fd9c77f60a560a60db9 Commit: 66b0782a517329a7eda37fd9c77f60a560a60db9 Parent: 192d4e27c36fb263617ad726795f1c8dbc709497 Author: Lon Hohberger AuthorDate: Wed Jul 8 11:53:37 2009 -0400 Committer: Lon Hohberger CommitterDate: Wed Jul 8 11:53:37 2009 -0400 config: Update relaxng schema for broadcast options Signed-off-by: Lon Hohberger --- config/tools/xml/cluster.rng | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index 717315e..23678bf 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -74,6 +74,14 @@ To validate your cluster.conf against this schema, run: + + + + + + + + @@ -776,6 +784,26 @@ To validate your cluster.conf against this schema, run: + + + + + + + + + + + + + + + + + + + + From fabbione@fedoraproject.org Wed Jul 8 20:19:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Wed, 08 Jul 2009 20:19:00 -0000 Subject: cluster: the annotated tag cluster-3.0.0 has been created Message-ID: <20090708201932.12C34120106@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cc814dea831bbdc3eb45f5d7033979e362ef86a7 Commit: cc814dea831bbdc3eb45f5d7033979e362ef86a7 Parent: 0000000000000000000000000000000000000000 Author: Fabio M. Di Nitto AuthorDate: 2009-07-08 20:19 +0000 Committer: Fabio M. Di Nitto CommitterDate: 2009-07-08 20:19 +0000 annotated tag: cluster-3.0.0 has been created at cc814dea831bbdc3eb45f5d7033979e362ef86a7 (tag) tagging 5713c7a68e9c1b22fb54b19faf17af3dc00ea6d9 (commit) replaces cluster-3.0.0.rc4 cluster-3.0.0 release David Teigland (1): gfs_controld: fix default plock_ownership in compat mode Fabio M. Di Nitto (3): contrib: Remove askant contrib: fix build warnings in libaislock libccs: fix yet another uint -> hdb_handle_t conversion Guido G????nther (1): init scripts: add force-reload targets Lon Hohberger (4): config: Update relaxng schema for broadcast options config: Update cluster.rng with new RA params config: Update cluster.ldif config: Fix misnamed statusmax -> status_child_max From cfeist@fedoraproject.org Wed Jul 8 20:25:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Wed, 08 Jul 2009 20:25:00 -0000 Subject: cluster: the annotated tag gfs_0_1_20 has been created Message-ID: <20090708202514.DFDCC120106@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c1d964cb722d713a7ac908ac910817861877f186 Commit: c1d964cb722d713a7ac908ac910817861877f186 Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-07 16:00 +0000 Committer: Chris Feist CommitterDate: 2009-07-07 16:00 +0000 annotated tag: gfs_0_1_20 has been created at c1d964cb722d713a7ac908ac910817861877f186 (tag) tagging 704f137b77fce75d27621b1571bbb142696d30d6 (commit) replaces gfs2_0_1_60 Bob Peterson (1): gfs_fsck: Segfault in EA leaf repair From jbrassow@fedoraproject.org Wed Jul 8 22:18:00 2009 From: jbrassow@fedoraproject.org (Jonathan Brassow) Date: Wed, 08 Jul 2009 22:18:00 -0000 Subject: cluster: RHEL5 - clogd: Fix for bugs 474174 and 491340 Message-ID: <20090708221745.850F0120108@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c39f57ec2b16c5e98f3214f6ed0374ab455b8084 Commit: c39f57ec2b16c5e98f3214f6ed0374ab455b8084 Parent: 8df780b532e02acef7f0ebc0113cf96515a7a3b6 Author: Jonathan Brassow AuthorDate: Wed Jul 8 17:16:19 2009 -0500 Committer: Jonathan Brassow CommitterDate: Wed Jul 8 17:16:19 2009 -0500 clogd: Fix for bugs 474174 and 491340 Whether to continue mirror recovery or not was being queued off of a variable that was set by doing (x - 1). However, when 'x' was 0 the result was a very large number (unsigned). When this large number was compared against the number of total regions in the mirror, it was determined that recovery was finished. The fix is simply to do: y = x ? (x - 1) : 0; instead of: y = (x - 1); --- cmirror/src/functions.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c index 0523e9c..3e0d15f 100644 --- a/cmirror/src/functions.c +++ b/cmirror/src/functions.c @@ -1518,9 +1518,9 @@ static int clog_is_remote_recovering(struct clog_tfr *tfr) /* * Remember, 'lc->sync_search' is 1 plus the region * currently being recovered. So, we must take off 1 - * to account for that. + * to account for that - UNLESS sync_search IS 0! */ - pkg->in_sync_hint = (lc->sync_search - 1); + pkg->in_sync_hint = lc->sync_search ? (lc->sync_search - 1) : 0; LOG_DBG("[%s] Region is %s: %llu", SHORT_UUID(lc->uuid), (region == lc->recovering_region) ? From jbrassow@fedoraproject.org Wed Jul 8 22:21:00 2009 From: jbrassow@fedoraproject.org (Jonathan Brassow) Date: Wed, 08 Jul 2009 22:21:00 -0000 Subject: cluster: RHEL54 - clogd: Fix for bugs 474174 and 491340 Message-ID: <20090708222046.6C901120108@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6cf7dbc393d206e56a14261af81b1aeeb5bb160a Commit: 6cf7dbc393d206e56a14261af81b1aeeb5bb160a Parent: 704f137b77fce75d27621b1571bbb142696d30d6 Author: Jonathan Brassow AuthorDate: Wed Jul 8 17:16:19 2009 -0500 Committer: Jonathan Brassow CommitterDate: Wed Jul 8 17:19:46 2009 -0500 clogd: Fix for bugs 474174 and 491340 Whether to continue mirror recovery or not was being queued off of a variable that was set by doing (x - 1). However, when 'x' was 0 the result was a very large number (unsigned). When this large number was compared against the number of total regions in the mirror, it was determined that recovery was finished. The fix is simply to do: y = x ? (x - 1) : 0; instead of: y = (x - 1); --- cmirror/src/functions.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c index 45fdc1a..d37c75a 100644 --- a/cmirror/src/functions.c +++ b/cmirror/src/functions.c @@ -1505,9 +1505,9 @@ static int clog_is_remote_recovering(struct clog_tfr *tfr) /* * Remember, 'lc->sync_search' is 1 plus the region * currently being recovered. So, we must take off 1 - * to account for that. + * to account for that - UNLESS sync_search IS 0! */ - pkg->in_sync_hint = (lc->sync_search - 1); + pkg->in_sync_hint = lc->sync_search ? (lc->sync_search - 1) : 0; LOG_DBG("[%s] Region is %s: %llu", SHORT_UUID(lc->uuid), (region == lc->recovering_region) ? From fabbione@fedoraproject.org Thu Jul 9 06:39:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 09 Jul 2009 06:39:00 -0000 Subject: cluster: STABLE3 - build: drop dtest target in rgmanager daemon Makefile Message-ID: <20090709063846.A805D120282@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7bbf2de22435d690b1a84bbd6064cec59c8e98a0 Commit: 7bbf2de22435d690b1a84bbd6064cec59c8e98a0 Parent: 5713c7a68e9c1b22fb54b19faf17af3dc00ea6d9 Author: Fabio M. Di Nitto AuthorDate: Thu Jul 9 08:37:43 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 9 08:37:43 2009 +0200 build: drop dtest target in rgmanager daemon Makefile dtest code has been dropped a long time ago. Cleanup the Makefile. Signed-off-by: Fabio M. Di Nitto --- rgmanager/src/daemons/Makefile | 39 ++++++++++++++------------------------- 1 files changed, 14 insertions(+), 25 deletions(-) diff --git a/rgmanager/src/daemons/Makefile b/rgmanager/src/daemons/Makefile index 7ce5a96..71bbdf7 100644 --- a/rgmanager/src/daemons/Makefile +++ b/rgmanager/src/daemons/Makefile @@ -1,12 +1,11 @@ TARGET1= rgmanager TARGET2= rg_test -TARGET3= dtest -TARGET4= clurgmgrd +TARGET3= clurgmgrd SBINDIRT=$(TARGET1) $(TARGET2) -SBINSYMT=$(TARGET4) +SBINSYMT=$(TARGET3) -all: depends ${TARGET1} ${TARGET2} ${TARGET4} +all: depends ${TARGET1} ${TARGET2} ${TARGET3} include ../../../make/defines.mk include $(OBJDIR)/make/cobj.mk @@ -32,17 +31,14 @@ OBJS1= fo_domain.o \ event_config.o \ watchdog.o -OBJS2= test-noccs.o - -OBJS3= dtest-noccs.o - -SHAREDOBJS= fo_domain-noccs.o \ - restart_counter.o \ - reslist-noccs.o \ - resrules-noccs.o \ - restree-noccs.o \ - rg_locks-noccs.o \ - event_config-noccs.o +OBJS2= test-noccs.o \ + fo_domain-noccs.o \ + restart_counter.o \ + reslist-noccs.o \ + resrules-noccs.o \ + restree-noccs.o \ + rg_locks-noccs.o \ + event_config-noccs.o CFLAGS += -DSHAREDIR=\"${sharedir}\" CFLAGS += -fPIC @@ -87,17 +83,12 @@ ${TARGET1}: ${OBJS1} ${LDDEPS} # This is NOT meant to be an installed binary. Rather, RPMs and/or other # packages should run 'make check' as part of the build process. # -${TARGET2}: ${SHAREDOBJS} ${OBJS2} ${LDDEPS} +${TARGET2}: ${OBJS2} ${LDDEPS} $(CC) -o $@ $^ $(CMAN_LDFLAGS) $(EXTRA_LDFLAGS) \ $(XML2_LDFLAGS) $(LOGSYS_LDFLAGS) $(LDFLAGS) -${TARGET3}: ${SHAREDOBJS} ${OBJS3} ${LDDEPS} - $(CC) -o $@ $^ $(CCS_LDFLAGS) $(CMAN_LDFLAGS) \ - $(EXTRA_LDFLAGS) $(XML2_LDFLAGS) \ - $(READLINE_LDFLAGS) $(LOGSYS_LDFLAGS) $(LDFLAGS) - -${TARGET4}: ${TARGET1} - ln -sf ${TARGET1} ${TARGET4} +${TARGET3}: ${TARGET1} + ln -sf ${TARGET1} ${TARGET3} check: rg_test cd tests && ./runtests.sh @@ -111,5 +102,3 @@ clean: generalclean -include $(OBJS1:.o=.d) -include $(OBJS2:.o=.d) -include $(OBJS3:.o=.d) --include $(OBJS4:.o=.d) --include $(SHAREDOBJS:.o=.d) From fabbione@fedoraproject.org Thu Jul 9 06:59:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 09 Jul 2009 06:59:00 -0000 Subject: cluster: STABLE3 - update copyright file Message-ID: <20090709065919.1C1FC12029B@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a375c372ab5342fb60d4ea067ae8791a3188d6ff Commit: a375c372ab5342fb60d4ea067ae8791a3188d6ff Parent: 2e3e473fb82564c4b340576145eb74564de7fc15 Author: Fabio M. Di Nitto AuthorDate: Thu Jul 9 08:58:38 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 9 08:58:38 2009 +0200 update copyright file Signed-off-by: Fabio M. Di Nitto --- doc/COPYRIGHT | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/doc/COPYRIGHT b/doc/COPYRIGHT index 8c8d6c9..d599d2d 100644 --- a/doc/COPYRIGHT +++ b/doc/COPYRIGHT @@ -120,10 +120,6 @@ rgmanager/src/daemons/main.c: Copyright (C) 2000 Mission Critical Linux Copyright (C) 2002-2009 Red Hat, Inc. All rights reserved. -rgmanager/src/utils/cluarp.c: - Copyright (C) 2000 Mission Critical Linux - Copyright (C) 2002-2009 Red Hat, Inc. All rights reserved. - rgmanager/src/utils/clubufflush.c: Copyright (C) 2000 Mission Critical Linux Copyright (C) 2002-2009 Red Hat, Inc. All rights reserved. From fabbione@fedoraproject.org Thu Jul 9 06:59:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 09 Jul 2009 06:59:00 -0000 Subject: cluster: STABLE3 - rgmanager: drop obsoleted tools Message-ID: <20090709065917.03016120282@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2e3e473fb82564c4b340576145eb74564de7fc15 Commit: 2e3e473fb82564c4b340576145eb74564de7fc15 Parent: 7bbf2de22435d690b1a84bbd6064cec59c8e98a0 Author: Fabio M. Di Nitto AuthorDate: Thu Jul 9 08:46:34 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 9 08:46:34 2009 +0200 rgmanager: drop obsoleted tools Signed-off-by: Fabio M. Di Nitto --- rgmanager/man/cluarp.8 | 15 --- rgmanager/man/clunfsops.8 | 14 -- rgmanager/src/resources/nfsexport.sh | 7 - rgmanager/src/utils/Makefile | 2 - rgmanager/src/utils/cluarp.c | 158 ------------------------ rgmanager/src/utils/clunfsops.c | 224 ---------------------------------- rgmanager/src/utils/syscall.h | 165 ------------------------- 7 files changed, 0 insertions(+), 585 deletions(-) diff --git a/rgmanager/man/cluarp.8 b/rgmanager/man/cluarp.8 deleted file mode 100644 index 5bc912e..0000000 --- a/rgmanager/man/cluarp.8 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "cluarp" "8" "Jan 2005" "" "Red Hat Cluster Suite Internal Commands" -.SH "NAME" -cluarp \- Send a gratuitous ARP -.SH "WARNING" -Use of this command can cause the cluster to malfunction. Do not run this -without instructions from Red Hat Support. -.SH "DESCRIPTION" -.PP -The -.B cluarp -command is an internal command used to broadcast new ARP information when -a service IP address is configured by the Service Manager. - -.SH "SEE ALSO" -arp(8) diff --git a/rgmanager/man/clunfsops.8 b/rgmanager/man/clunfsops.8 deleted file mode 100644 index ba768e4..0000000 --- a/rgmanager/man/clunfsops.8 +++ /dev/null @@ -1,14 +0,0 @@ -.TH "clunfsops" "8" "Jan 2005" "" "Red Hat Cluster Suite Internal Commands" -.SH "NAME" -clunfsops \- Manipulate NFS -.SH "WARNING" -Use of this command can cause the cluster to malfunction. Do not run this -without instructions from Red Hat Support. -.SH "DESCRIPTION" -.PP -The -.B clunfsops -command is an internal command used to manipulate clustered NFS services. - -.SH "SEE ALSO" -nfs(5), rpc.nfsd(8) diff --git a/rgmanager/src/resources/nfsexport.sh b/rgmanager/src/resources/nfsexport.sh index cd5bfdf..b013a5e 100644 --- a/rgmanager/src/resources/nfsexport.sh +++ b/rgmanager/src/resources/nfsexport.sh @@ -235,11 +235,4 @@ validate-all) ;; esac -# -# Flush NFS request queue. This might be done in the ip resource in the -# future, but keep this around for now. -# -# clunfsops $nfsop_arg -d ${OCF_RESKEY_device} -# - exit $rv diff --git a/rgmanager/src/utils/Makefile b/rgmanager/src/utils/Makefile index 48f3885..b2073c3 100644 --- a/rgmanager/src/utils/Makefile +++ b/rgmanager/src/utils/Makefile @@ -15,8 +15,6 @@ include $(OBJDIR)/make/clean.mk include $(OBJDIR)/make/install.mk include $(OBJDIR)/make/uninstall.mk -DISABLEDTARGETS= cluarp - CFLAGS += -fPIC -D_GNU_SOURCE CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${dlmincdir} CFLAGS += -I${logtincdir} -I${ncursesincdir} diff --git a/rgmanager/src/utils/cluarp.c b/rgmanager/src/utils/cluarp.c deleted file mode 100644 index 08f123e..0000000 --- a/rgmanager/src/utils/cluarp.c +++ /dev/null @@ -1,158 +0,0 @@ -/** @file - * Utility to generate a gratuitous ARP request on a given interface. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define IP_ADDR_LEN 4 -#define DEFAULT_DEVICE "eth0" -#define SA_DATA_LEN 14 /* Taken from include/linux/socket.h */ - -/** - * ARP frame structure. - */ -struct arp_frame { - u_char ether_dest_hw_addr[ETH_ALEN]; - u_char ether_src_hw_addr[ETH_ALEN]; - u_short ether_packet_type; - u_short arp_hw_type; - u_short arp_proto_type; - u_char arp_hlen; - u_char arp_plen; - u_short op; - u_char arp_sender_ha[ETH_ALEN]; - u_char arp_sender_ip[IP_ADDR_LEN]; - u_char arp_target_ha[ETH_ALEN]; - u_char arp_target_ip[IP_ADDR_LEN]; - u_char padding[18]; -}; - - -/** - * Display usage information. - */ -void usage(void) -{ - fprintf(stdout, - "myarp [device]\n"); -} - - -/** - * Change a hardware ethernet address into an array of characters. - * Warning: Unchecked bounds in copy_to. - * - * @param addr_string NULL-terminated string in the format: - * "aa:bb:cc:dd:ee:ff" - * @param copy_to Pre-allocated array of at least 6 bytes, - * preferrably set to 0. - */ -void -parse_hw_addr(char *addr_string, u_char *copy_to) -{ - char *c = addr_string, p, result=' '; - int i; - - for (i = 0; i < ETH_ALEN; i++) { - /* first digit */ - if (*c == ':') - c++; - p = tolower(*c++); - if (isdigit(p)) - result = p - '0'; - else if (p >= 'a' && p <= 'z') - result = p - 'a' + 10; - *copy_to = result << 4; - /* second digit */ - if (*c == ':') - c++; - p = tolower(*c++); - if (isdigit(p)) - result = p - '0'; - else if (p >= 'a' && p <= 'z') - result = p - 'a' + 10; - *copy_to++ |= result; - } - return; -} - - -/** - * Change an IP address into an array of characters. - * Warning: Unchecked bounds in copy_to. - * - * @param addr_string NULL-terminated string in the format: - * "10.1.2.3" (standard IPv4 dotted-quad). - * @param copy_to Pre-allocated array of at least 4 bytes, - * preferrably set to 0. - */ -void -parse_ip_addr(char *addr_string, u_char *copy_to) -{ - unsigned long inaddr; - - inaddr = inet_addr(addr_string); - memcpy(copy_to, &inaddr, IP_ADDR_LEN); - -} - - -/** - * Driver for cluarp. - * - * @return 0 on success, 1 on any failure. - */ -int -main(int argc, char **argv) -{ - - int s; - struct arp_frame arp_packet; - struct sockaddr sockaddr; -/* unsigned long inaddr; */ - - if ((argc != 5) && (argc != 6)) { - usage(); - exit(1); - } - - bzero(&arp_packet, sizeof(struct arp_frame)); - - parse_ip_addr(argv[1], arp_packet.arp_sender_ip); - parse_hw_addr(argv[2], arp_packet.ether_src_hw_addr); - parse_hw_addr(argv[2], arp_packet.arp_sender_ha); - parse_ip_addr(argv[3], arp_packet.arp_target_ip); - parse_hw_addr(argv[4], arp_packet.ether_dest_hw_addr); - parse_hw_addr(argv[4], arp_packet.arp_target_ha); - - arp_packet.ether_packet_type = htons(ETH_P_ARP); - arp_packet.arp_hw_type = htons(ETH_P_802_3); - arp_packet.arp_proto_type = htons(ETH_P_IP); - arp_packet.arp_hlen = ETH_ALEN; - arp_packet.arp_plen = IP_ADDR_LEN; - arp_packet.op = htons(ARPOP_REPLY); - - s = socket(AF_PACKET,SOCK_PACKET,htons(ETH_P_RARP)); - - if (argc == 5) - strncpy(sockaddr.sa_data, DEFAULT_DEVICE, SA_DATA_LEN); - else - strncpy(sockaddr.sa_data, argv[5], SA_DATA_LEN); - - if (sendto(s, &arp_packet, sizeof(struct arp_frame), 0, - &sockaddr, sizeof(struct sockaddr)) < 0) { - perror("sendto"); - exit(1); - } - exit(0); -} - - diff --git a/rgmanager/src/utils/clunfsops.c b/rgmanager/src/utils/clunfsops.c deleted file mode 100644 index 2a2d16a..0000000 --- a/rgmanager/src/utils/clunfsops.c +++ /dev/null @@ -1,224 +0,0 @@ -/** @file - * This program simply parses command line args and then calls the - * corresponding system call. - * These operations are for NFS failover semantics in an attempt to - * shield clients from unnecessary stale file handle errors. - * - * File Origin - this command was reverse-engineered by starting with the - * GPL syscall interfaces defined in . - */ - -#ifdef X86_64 -#define __ASM_SYSTEM_H -#define __ASM_X86_64_PROCESSOR_H -#endif - - -#define _LVM_H_INCLUDE /* XXX */ -#include -#include -#undef _LVM_H_INCLUDE -#include -#include - -#ifdef S390 -#define __ssize_t_defined -#endif - -#include -/* - * lhh - someone thought it would be cute to remove the #ifdef __KERNEL__ - * around some of the system includes. Now we have to fudge the #inclusion - * of linux/types.h _AS_ sys/types.h just to compile. - */ -#define _SYS_TYPES_H -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* XXX - should be this file, -#include - */ -/* - * But, temporarily include this file to simplify the build on - * systems which aren't yet installed and therefore don't have the - * header file w/ updated defines for new nfs syscalls. - */ -#include "syscall.h" - -/* - * Cluster include - */ -#include - - -/* Forward routine declarations. */ -static void usage(const char * cmd); -int validateDevice(char *name); -int nfsctl(int cmd, struct nfsctl_arg * argp, void * resp); - -/* Program Globals */ -static int verbose = 0; -static char *cmdname; - -static void -usage(const char * cmd) -{ - fprintf(stderr, "\n"); - fprintf(stderr, "usage: %s [-ehsv] " - "[-d deviceName] " - "\n", cmd); - fprintf(stderr, "Options:\n"); - fprintf(stderr, "-e\t\tInitiate flush of pending requests.\n"); - fprintf(stderr, "-h\t\tPrints this help message.\n"); - fprintf(stderr, "-s\t\tCancel pending flush of pending requests.\n"); - fprintf(stderr, "-v\t\tIncreases verbose debugging level.\n"); - fprintf(stderr, "\n"); - fprintf(stderr, "NOTE: this command will only successfully run\n"); - fprintf(stderr, " if the correspoinding NFS kernel patches\n"); - fprintf(stderr, " are built into the kernel.\n"); - fprintf(stderr, "\n"); - exit(1); -} - -int -main(int argc, char** argv) -{ - extern char * optarg; - extern int optind, opterr, optopt; - int errors = 0; - int errno_save = 0; - int nfsSyscallNum = 0; - char *nfsSyscallString = "BOGUS"; - char *deviceName = NULL; - int c; - struct nfsctl_arg nfsctlarg; - int retval; - - if (geteuid() != (uid_t)0) { - logt_print_and_print(LOG_ERR, "%s must be run as the root user.\n", - argv[0]); - exit(1); - } - if ((cmdname = strrchr(argv[0], '/')) == NULL) { - cmdname = argv[0]; - } - else{ - ++cmdname; - } - - while ((c = getopt(argc, argv, "d:ehsv")) != -1) { - switch(c) { - case 'd': deviceName = optarg; - break; - case 'e': - nfsSyscallNum = NFSCTL_FODROP; - nfsSyscallString = "NFSCTL_FODROP"; - break; - case 'h': usage(cmdname); - break; - case 's': - nfsSyscallNum = NFSCTL_STOPFODROP; - nfsSyscallString = "NFSCTL_STOPFODROP"; - break; - case 'v': ++verbose; - break; - default: ++errors; - break; - } - } - if (nfsSyscallNum == 0) { - logt_print_and_print(LOG_ERR, "%s: No NFS syscall has been " - "specified.\n",cmdname); - ++errors; - } - if (deviceName == NULL) { - logt_print_and_print(LOG_ERR, "%s: No device name has been " - "specified.\n", cmdname); - ++errors; - } - if (validateDevice(deviceName)) { - ++errors; - } - if (errors) { - usage(cmdname); - } - if (verbose) { - printf("Calling: nfsSyscall = %s, deviceName = %s.\n", - nfsSyscallString, deviceName); - } - /* - * Setup the data structure expected by the kernel. - */ - memset(&nfsctlarg, 0, sizeof(struct nfsctl_arg)); - nfsctlarg.ca_version = NFSCTL_VERSION; - strncpy(nfsctlarg.ca_fodrop.fo_dev, deviceName, - sizeof(nfsctlarg.ca_fodrop.fo_dev)); - nfsctlarg.ca_fodrop.fo_timeout = 1000; /* range 600-1200 */ - /* - * Jump into the kernel syscall. - */ - retval = nfsctl(nfsSyscallNum, &nfsctlarg, NULL); - if (retval != 0) { - /* logt_print_and_print calls syslog(), which modifies errno */ - errno_save = errno; - logt_print_and_print(LOG_WARNING, "#72: %s: NFS syscall %s failed: " - "%s.\n", cmdname, nfsSyscallString, - strerror(errno_save)); - if (errno_save == EINVAL) { - logt_print_and_print(LOG_WARNING, - "#73: %s: Kernel may not " - "have NFS failover enhancements.\n", - cmdname); - } - exit(errno_save); - } - else { - if (verbose) { - printf("SUCCESS: nfsSyscall = %s, deviceName = %s.\n", - nfsSyscallString, deviceName); - } - } - exit(0); -} - -/* - * Validate the device parameter. Make sure it refers to a block - * device special file. - * Returns: 0=success, nonzero=error. - */ -int -validateDevice(char *name) { - struct stat stat_st, *stat_ptr; - stat_ptr = &stat_st; - - if (stat(name, stat_ptr) < 0) { - logt_print_and_print(LOG_ERR, "%s: Unable to stat %s.\n", cmdname, name); - return(1); - } - /* - * Verify that its a block or character special file. - */ - if (S_ISBLK(stat_st.st_mode) == 0) { - logt_print_and_print(LOG_ERR, "%s: %s is not a block special file.\n", cmdname, name); - return(1); - } - return(0); // success -} - -/* - * Routine to format make appropriate NFS syscall. - * Leveraged from nfs-utils. - */ -int -nfsctl(int cmd, struct nfsctl_arg * argp, void * resp) -{ - return syscall (__NR_nfsservctl, cmd, argp, resp); -} - diff --git a/rgmanager/src/utils/syscall.h b/rgmanager/src/utils/syscall.h deleted file mode 100644 index 4c2541e..0000000 --- a/rgmanager/src/utils/syscall.h +++ /dev/null @@ -1,165 +0,0 @@ -/** @file - * Taken from: /usr/include/linux/nfsd/syscall.h (we hope). - * - * This file holds all declarations for the knfsd syscall interface. - */ - -#ifndef NFSD_SYSCALL_H -#define NFSD_SYSCALL_H - -#include -# include -# include -# include -#include -#include -#include -// TIMXXX - took out to pacify user level compilation. -//#include -#include - -/* - * Version of the syscall interface - */ -#define NFSCTL_VERSION 0x0201 - -/* - * These are the commands understood by nfsctl(). - */ -#define NFSCTL_SVC 0 /* This is a server process. */ -#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */ -#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */ -#define NFSCTL_EXPORT 3 /* export a file system. */ -#define NFSCTL_UNEXPORT 4 /* unexport a file system. */ -#define NFSCTL_UGIDUPDATE 5 /* update a client's uid/gid map. */ -#define NFSCTL_GETFH 6 /* get an fh by ino (used by mountd) */ -#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ -#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ -#define NFSCTL_FODROP 50 /* drop requests during failover */ -#define NFSCTL_STOPFODROP 51 /* stop dropping requests */ -#define NFSCTL_FOLOCKS 52 /* drop locks for failover */ -#define NFSCTL_FOGRACE 53 /* set grace period for failover */ -#define NFSCTL_FOSERV 54 /* remove service mon for failover */ -#define NFSCTL_FO_MIN NFSCTL_FODROP -#define NFSCTL_FO_MAX NFSCTL_FOSERV - -/* SVC */ -struct nfsctl_svc { - unsigned short svc_port; - int svc_nthreads; -}; - -/* ADDCLIENT/DELCLIENT */ -struct nfsctl_client { - char cl_ident[NFSCLNT_IDMAX+1]; - int cl_naddr; - struct in_addr cl_addrlist[NFSCLNT_ADDRMAX]; - int cl_fhkeytype; - int cl_fhkeylen; - unsigned char cl_fhkey[NFSCLNT_KEYMAX]; -}; - -/* EXPORT/UNEXPORT */ -struct nfsctl_export { - char ex_client[NFSCLNT_IDMAX+1]; - char ex_path[NFS_MAXPATHLEN+1]; - __kernel_dev_t ex_dev; - __kernel_ino_t ex_ino; - int ex_flags; - __kernel_uid_t ex_anon_uid; - __kernel_gid_t ex_anon_gid; -}; - -/* UGIDUPDATE */ -struct nfsctl_uidmap { - char * ug_ident; - __kernel_uid_t ug_uidbase; - int ug_uidlen; - __kernel_uid_t * ug_udimap; - __kernel_gid_t ug_gidbase; - int ug_gidlen; - __kernel_gid_t * ug_gdimap; -}; - -/* GETFH */ -struct nfsctl_fhparm { - struct sockaddr gf_addr; - __kernel_dev_t gf_dev; - __kernel_ino_t gf_ino; - int gf_version; -}; - -/* GETFD */ -struct nfsctl_fdparm { - struct sockaddr gd_addr; - char gd_path[NFS_MAXPATHLEN+1]; - int gd_version; -}; - -/* GETFS - GET Filehandle with Size */ -struct nfsctl_fsparm { - struct sockaddr gd_addr; - char gd_path[NFS_MAXPATHLEN+1]; - int gd_maxlen; -}; - -/* FODROP/STOPFODROP */ -struct nfsctl_fodrop { - char fo_dev[NFS_MAXPATHLEN+1]; - __u32 fo_timeout; -}; - -/* - * This is the argument union. - */ -struct nfsctl_arg { - int ca_version; /* safeguard */ - union { - struct nfsctl_svc u_svc; - struct nfsctl_client u_client; - struct nfsctl_export u_export; - struct nfsctl_uidmap u_umap; - struct nfsctl_fhparm u_getfh; - struct nfsctl_fdparm u_getfd; - struct nfsctl_fsparm u_getfs; - struct nfsctl_fodrop u_fodrop; - } u; -#define ca_svc u.u_svc -#define ca_client u.u_client -#define ca_export u.u_export -#define ca_umap u.u_umap -#define ca_getfh u.u_getfh -#define ca_getfd u.u_getfd -#define ca_getfs u.u_getfs -#define ca_authd u.u_authd -#define ca_fodrop u.u_fodrop -}; - -// TIMXXX - took out to pacify user level compilation. -//union nfsctl_res { - //__u8 cr_getfh[NFS_FHSIZE]; - //struct knfsd_fh cr_getfs; -//}; - -#ifdef __KERNEL__ -/* - * Kernel syscall implementation. - */ -#if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE) -extern asmlinkage long sys_nfsservctl(int, void *, void *); -#else -#define sys_nfsservctl sys_ni_syscall -#endif -extern int exp_addclient(struct nfsctl_client *ncp); -extern int exp_delclient(struct nfsctl_client *ncp); -extern int exp_export(struct nfsctl_export *nxp); -extern int exp_unexport(struct nfsctl_export *nxp); -extern int exp_fodrop(struct nfsctl_fodrop *nfp); -extern int exp_stopfodrop(struct nfsctl_fodrop *nfp); -extern int nfsd_lockd_founlock(struct nfsctl_fodrop *nfp); -extern int nfsd_lockd_fograce(struct nfsctl_fodrop *nfp); -extern int nfsd_lockd_foservice(struct nfsctl_fodrop *nfp); - -#endif /* __KERNEL__ */ - -#endif /* NFSD_SYSCALL_H */ From fabbione@fedoraproject.org Thu Jul 9 07:32:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 09 Jul 2009 07:32:00 -0000 Subject: rgmanager: master - drop obsoleted tools Message-ID: <20090709073126.E660B120373@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/rgmanager.git?p=rgmanager.git;a=commitdiff;h=ac4e2e66d202d9cfc0071e44a32f7d27281a4449 Commit: ac4e2e66d202d9cfc0071e44a32f7d27281a4449 Parent: b97a67f6ea847cfd1bc9d346869eca5f72bf90e9 Author: Fabio M. Di Nitto AuthorDate: Thu Jul 9 09:31:11 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 9 09:31:11 2009 +0200 drop obsoleted tools Signed-off-by: Fabio M. Di Nitto --- doc/COPYRIGHT | 4 - rgmanager/man/Makefile.am | 3 - rgmanager/man/cluarp.8 | 15 --- rgmanager/man/clunfsops.8 | 14 --- rgmanager/src/utils/Makefile.am | 6 +- rgmanager/src/utils/cluarp.c | 159 --------------------------- rgmanager/src/utils/clunfsops.c | 225 --------------------------------------- rgmanager/src/utils/syscall.h | 165 ---------------------------- 8 files changed, 1 insertions(+), 590 deletions(-) diff --git a/doc/COPYRIGHT b/doc/COPYRIGHT index a4ba954..b95cc7e 100644 --- a/doc/COPYRIGHT +++ b/doc/COPYRIGHT @@ -56,10 +56,6 @@ rgmanager/src/daemons/main.c: Copyright (C) 2000 Mission Critical Linux Copyright (C) 2002-2009 Red Hat, Inc. All rights reserved. -rgmanager/src/utils/cluarp.c: - Copyright (C) 2000 Mission Critical Linux - Copyright (C) 2002-2009 Red Hat, Inc. All rights reserved. - rgmanager/src/utils/clubufflush.c: Copyright (C) 2000 Mission Critical Linux Copyright (C) 2002-2009 Red Hat, Inc. All rights reserved. diff --git a/rgmanager/man/Makefile.am b/rgmanager/man/Makefile.am index 63ffcdd..b53b7c4 100644 --- a/rgmanager/man/Makefile.am +++ b/rgmanager/man/Makefile.am @@ -1,8 +1,5 @@ MAINTAINERCLEANFILES = Makefile.in -EXTRA_DIST = cluarp.8 \ - clunfsops.8 - dist_man_MANS = clubufflush.8 \ clufindhostname.8 \ clulog.8 \ diff --git a/rgmanager/man/cluarp.8 b/rgmanager/man/cluarp.8 deleted file mode 100644 index 5bc912e..0000000 --- a/rgmanager/man/cluarp.8 +++ /dev/null @@ -1,15 +0,0 @@ -.TH "cluarp" "8" "Jan 2005" "" "Red Hat Cluster Suite Internal Commands" -.SH "NAME" -cluarp \- Send a gratuitous ARP -.SH "WARNING" -Use of this command can cause the cluster to malfunction. Do not run this -without instructions from Red Hat Support. -.SH "DESCRIPTION" -.PP -The -.B cluarp -command is an internal command used to broadcast new ARP information when -a service IP address is configured by the Service Manager. - -.SH "SEE ALSO" -arp(8) diff --git a/rgmanager/man/clunfsops.8 b/rgmanager/man/clunfsops.8 deleted file mode 100644 index ba768e4..0000000 --- a/rgmanager/man/clunfsops.8 +++ /dev/null @@ -1,14 +0,0 @@ -.TH "clunfsops" "8" "Jan 2005" "" "Red Hat Cluster Suite Internal Commands" -.SH "NAME" -clunfsops \- Manipulate NFS -.SH "WARNING" -Use of this command can cause the cluster to malfunction. Do not run this -without instructions from Red Hat Support. -.SH "DESCRIPTION" -.PP -The -.B clunfsops -command is an internal command used to manipulate clustered NFS services. - -.SH "SEE ALSO" -nfs(5), rpc.nfsd(8) diff --git a/rgmanager/src/utils/Makefile.am b/rgmanager/src/utils/Makefile.am index 268b6f1..5af2fcd 100644 --- a/rgmanager/src/utils/Makefile.am +++ b/rgmanager/src/utils/Makefile.am @@ -1,10 +1,6 @@ MAINTAINERCLEANFILES = Makefile.in -EXTRA_DIST = cluarp.c \ - clunfsops.c \ - clunfslock - -noinst_HEADER = syscall.h +EXTRA_DIST = clunfslock sbin_PROGRAMS = clubufflush \ clufindhostname \ diff --git a/rgmanager/src/utils/cluarp.c b/rgmanager/src/utils/cluarp.c deleted file mode 100644 index f22fa60..0000000 --- a/rgmanager/src/utils/cluarp.c +++ /dev/null @@ -1,159 +0,0 @@ -/** @file - * Utility to generate a gratuitous ARP request on a given interface. - */ -#include "clusterautoconfig.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define IP_ADDR_LEN 4 -#define DEFAULT_DEVICE "eth0" -#define SA_DATA_LEN 14 /* Taken from include/linux/socket.h */ - -/** - * ARP frame structure. - */ -struct arp_frame { - u_char ether_dest_hw_addr[ETH_ALEN]; - u_char ether_src_hw_addr[ETH_ALEN]; - u_short ether_packet_type; - u_short arp_hw_type; - u_short arp_proto_type; - u_char arp_hlen; - u_char arp_plen; - u_short op; - u_char arp_sender_ha[ETH_ALEN]; - u_char arp_sender_ip[IP_ADDR_LEN]; - u_char arp_target_ha[ETH_ALEN]; - u_char arp_target_ip[IP_ADDR_LEN]; - u_char padding[18]; -}; - - -/** - * Display usage information. - */ -void usage(void) -{ - fprintf(stdout, - "myarp [device]\n"); -} - - -/** - * Change a hardware ethernet address into an array of characters. - * Warning: Unchecked bounds in copy_to. - * - * @param addr_string NULL-terminated string in the format: - * "aa:bb:cc:dd:ee:ff" - * @param copy_to Pre-allocated array of at least 6 bytes, - * preferrably set to 0. - */ -void -parse_hw_addr(char *addr_string, u_char *copy_to) -{ - char *c = addr_string, p, result=' '; - int i; - - for (i = 0; i < ETH_ALEN; i++) { - /* first digit */ - if (*c == ':') - c++; - p = tolower(*c++); - if (isdigit(p)) - result = p - '0'; - else if (p >= 'a' && p <= 'z') - result = p - 'a' + 10; - *copy_to = result << 4; - /* second digit */ - if (*c == ':') - c++; - p = tolower(*c++); - if (isdigit(p)) - result = p - '0'; - else if (p >= 'a' && p <= 'z') - result = p - 'a' + 10; - *copy_to++ |= result; - } - return; -} - - -/** - * Change an IP address into an array of characters. - * Warning: Unchecked bounds in copy_to. - * - * @param addr_string NULL-terminated string in the format: - * "10.1.2.3" (standard IPv4 dotted-quad). - * @param copy_to Pre-allocated array of at least 4 bytes, - * preferrably set to 0. - */ -void -parse_ip_addr(char *addr_string, u_char *copy_to) -{ - unsigned long inaddr; - - inaddr = inet_addr(addr_string); - memcpy(copy_to, &inaddr, IP_ADDR_LEN); - -} - - -/** - * Driver for cluarp. - * - * @return 0 on success, 1 on any failure. - */ -int -main(int argc, char **argv) -{ - - int s; - struct arp_frame arp_packet; - struct sockaddr sockaddr; -/* unsigned long inaddr; */ - - if ((argc != 5) && (argc != 6)) { - usage(); - exit(1); - } - - bzero(&arp_packet, sizeof(struct arp_frame)); - - parse_ip_addr(argv[1], arp_packet.arp_sender_ip); - parse_hw_addr(argv[2], arp_packet.ether_src_hw_addr); - parse_hw_addr(argv[2], arp_packet.arp_sender_ha); - parse_ip_addr(argv[3], arp_packet.arp_target_ip); - parse_hw_addr(argv[4], arp_packet.ether_dest_hw_addr); - parse_hw_addr(argv[4], arp_packet.arp_target_ha); - - arp_packet.ether_packet_type = htons(ETH_P_ARP); - arp_packet.arp_hw_type = htons(ETH_P_802_3); - arp_packet.arp_proto_type = htons(ETH_P_IP); - arp_packet.arp_hlen = ETH_ALEN; - arp_packet.arp_plen = IP_ADDR_LEN; - arp_packet.op = htons(ARPOP_REPLY); - - s = socket(AF_PACKET,SOCK_PACKET,htons(ETH_P_RARP)); - - if (argc == 5) - strncpy(sockaddr.sa_data, DEFAULT_DEVICE, SA_DATA_LEN); - else - strncpy(sockaddr.sa_data, argv[5], SA_DATA_LEN); - - if (sendto(s, &arp_packet, sizeof(struct arp_frame), 0, - &sockaddr, sizeof(struct sockaddr)) < 0) { - perror("sendto"); - exit(1); - } - exit(0); -} - - diff --git a/rgmanager/src/utils/clunfsops.c b/rgmanager/src/utils/clunfsops.c deleted file mode 100644 index 27d8042..0000000 --- a/rgmanager/src/utils/clunfsops.c +++ /dev/null @@ -1,225 +0,0 @@ -/** @file - * This program simply parses command line args and then calls the - * corresponding system call. - * These operations are for NFS failover semantics in an attempt to - * shield clients from unnecessary stale file handle errors. - * - * File Origin - this command was reverse-engineered by starting with the - * GPL syscall interfaces defined in . - */ -#include "clusterautoconfig.h" - -#ifdef X86_64 -#define __ASM_SYSTEM_H -#define __ASM_X86_64_PROCESSOR_H -#endif - - -#define _LVM_H_INCLUDE /* XXX */ -#include -#include -#undef _LVM_H_INCLUDE -#include -#include - -#ifdef S390 -#define __ssize_t_defined -#endif - -#include -/* - * lhh - someone thought it would be cute to remove the #ifdef __KERNEL__ - * around some of the system includes. Now we have to fudge the #inclusion - * of linux/types.h _AS_ sys/types.h just to compile. - */ -#define _SYS_TYPES_H -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* XXX - should be this file, -#include - */ -/* - * But, temporarily include this file to simplify the build on - * systems which aren't yet installed and therefore don't have the - * header file w/ updated defines for new nfs syscalls. - */ -#include "syscall.h" - -/* - * Cluster include - */ -#include - - -/* Forward routine declarations. */ -static void usage(const char * cmd); -int validateDevice(char *name); -int nfsctl(int cmd, struct nfsctl_arg * argp, void * resp); - -/* Program Globals */ -static int verbose = 0; -static char *cmdname; - -static void -usage(const char * cmd) -{ - fprintf(stderr, "\n"); - fprintf(stderr, "usage: %s [-ehsv] " - "[-d deviceName] " - "\n", cmd); - fprintf(stderr, "Options:\n"); - fprintf(stderr, "-e\t\tInitiate flush of pending requests.\n"); - fprintf(stderr, "-h\t\tPrints this help message.\n"); - fprintf(stderr, "-s\t\tCancel pending flush of pending requests.\n"); - fprintf(stderr, "-v\t\tIncreases verbose debugging level.\n"); - fprintf(stderr, "\n"); - fprintf(stderr, "NOTE: this command will only successfully run\n"); - fprintf(stderr, " if the correspoinding NFS kernel patches\n"); - fprintf(stderr, " are built into the kernel.\n"); - fprintf(stderr, "\n"); - exit(1); -} - -int -main(int argc, char** argv) -{ - extern char * optarg; - extern int optind, opterr, optopt; - int errors = 0; - int errno_save = 0; - int nfsSyscallNum = 0; - char *nfsSyscallString = "BOGUS"; - char *deviceName = NULL; - int c; - struct nfsctl_arg nfsctlarg; - int retval; - - if (geteuid() != (uid_t)0) { - logt_print_and_print(LOG_ERR, "%s must be run as the root user.\n", - argv[0]); - exit(1); - } - if ((cmdname = strrchr(argv[0], '/')) == NULL) { - cmdname = argv[0]; - } - else{ - ++cmdname; - } - - while ((c = getopt(argc, argv, "d:ehsv")) != -1) { - switch(c) { - case 'd': deviceName = optarg; - break; - case 'e': - nfsSyscallNum = NFSCTL_FODROP; - nfsSyscallString = "NFSCTL_FODROP"; - break; - case 'h': usage(cmdname); - break; - case 's': - nfsSyscallNum = NFSCTL_STOPFODROP; - nfsSyscallString = "NFSCTL_STOPFODROP"; - break; - case 'v': ++verbose; - break; - default: ++errors; - break; - } - } - if (nfsSyscallNum == 0) { - logt_print_and_print(LOG_ERR, "%s: No NFS syscall has been " - "specified.\n",cmdname); - ++errors; - } - if (deviceName == NULL) { - logt_print_and_print(LOG_ERR, "%s: No device name has been " - "specified.\n", cmdname); - ++errors; - } - if (validateDevice(deviceName)) { - ++errors; - } - if (errors) { - usage(cmdname); - } - if (verbose) { - printf("Calling: nfsSyscall = %s, deviceName = %s.\n", - nfsSyscallString, deviceName); - } - /* - * Setup the data structure expected by the kernel. - */ - memset(&nfsctlarg, 0, sizeof(struct nfsctl_arg)); - nfsctlarg.ca_version = NFSCTL_VERSION; - strncpy(nfsctlarg.ca_fodrop.fo_dev, deviceName, - sizeof(nfsctlarg.ca_fodrop.fo_dev)); - nfsctlarg.ca_fodrop.fo_timeout = 1000; /* range 600-1200 */ - /* - * Jump into the kernel syscall. - */ - retval = nfsctl(nfsSyscallNum, &nfsctlarg, NULL); - if (retval != 0) { - /* logt_print_and_print calls syslog(), which modifies errno */ - errno_save = errno; - logt_print_and_print(LOG_WARNING, "#72: %s: NFS syscall %s failed: " - "%s.\n", cmdname, nfsSyscallString, - strerror(errno_save)); - if (errno_save == EINVAL) { - logt_print_and_print(LOG_WARNING, - "#73: %s: Kernel may not " - "have NFS failover enhancements.\n", - cmdname); - } - exit(errno_save); - } - else { - if (verbose) { - printf("SUCCESS: nfsSyscall = %s, deviceName = %s.\n", - nfsSyscallString, deviceName); - } - } - exit(0); -} - -/* - * Validate the device parameter. Make sure it refers to a block - * device special file. - * Returns: 0=success, nonzero=error. - */ -int -validateDevice(char *name) { - struct stat stat_st, *stat_ptr; - stat_ptr = &stat_st; - - if (stat(name, stat_ptr) < 0) { - logt_print_and_print(LOG_ERR, "%s: Unable to stat %s.\n", cmdname, name); - return(1); - } - /* - * Verify that its a block or character special file. - */ - if (S_ISBLK(stat_st.st_mode) == 0) { - logt_print_and_print(LOG_ERR, "%s: %s is not a block special file.\n", cmdname, name); - return(1); - } - return(0); // success -} - -/* - * Routine to format make appropriate NFS syscall. - * Leveraged from nfs-utils. - */ -int -nfsctl(int cmd, struct nfsctl_arg * argp, void * resp) -{ - return syscall (__NR_nfsservctl, cmd, argp, resp); -} - diff --git a/rgmanager/src/utils/syscall.h b/rgmanager/src/utils/syscall.h deleted file mode 100644 index 4c2541e..0000000 --- a/rgmanager/src/utils/syscall.h +++ /dev/null @@ -1,165 +0,0 @@ -/** @file - * Taken from: /usr/include/linux/nfsd/syscall.h (we hope). - * - * This file holds all declarations for the knfsd syscall interface. - */ - -#ifndef NFSD_SYSCALL_H -#define NFSD_SYSCALL_H - -#include -# include -# include -# include -#include -#include -#include -// TIMXXX - took out to pacify user level compilation. -//#include -#include - -/* - * Version of the syscall interface - */ -#define NFSCTL_VERSION 0x0201 - -/* - * These are the commands understood by nfsctl(). - */ -#define NFSCTL_SVC 0 /* This is a server process. */ -#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */ -#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */ -#define NFSCTL_EXPORT 3 /* export a file system. */ -#define NFSCTL_UNEXPORT 4 /* unexport a file system. */ -#define NFSCTL_UGIDUPDATE 5 /* update a client's uid/gid map. */ -#define NFSCTL_GETFH 6 /* get an fh by ino (used by mountd) */ -#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ -#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ -#define NFSCTL_FODROP 50 /* drop requests during failover */ -#define NFSCTL_STOPFODROP 51 /* stop dropping requests */ -#define NFSCTL_FOLOCKS 52 /* drop locks for failover */ -#define NFSCTL_FOGRACE 53 /* set grace period for failover */ -#define NFSCTL_FOSERV 54 /* remove service mon for failover */ -#define NFSCTL_FO_MIN NFSCTL_FODROP -#define NFSCTL_FO_MAX NFSCTL_FOSERV - -/* SVC */ -struct nfsctl_svc { - unsigned short svc_port; - int svc_nthreads; -}; - -/* ADDCLIENT/DELCLIENT */ -struct nfsctl_client { - char cl_ident[NFSCLNT_IDMAX+1]; - int cl_naddr; - struct in_addr cl_addrlist[NFSCLNT_ADDRMAX]; - int cl_fhkeytype; - int cl_fhkeylen; - unsigned char cl_fhkey[NFSCLNT_KEYMAX]; -}; - -/* EXPORT/UNEXPORT */ -struct nfsctl_export { - char ex_client[NFSCLNT_IDMAX+1]; - char ex_path[NFS_MAXPATHLEN+1]; - __kernel_dev_t ex_dev; - __kernel_ino_t ex_ino; - int ex_flags; - __kernel_uid_t ex_anon_uid; - __kernel_gid_t ex_anon_gid; -}; - -/* UGIDUPDATE */ -struct nfsctl_uidmap { - char * ug_ident; - __kernel_uid_t ug_uidbase; - int ug_uidlen; - __kernel_uid_t * ug_udimap; - __kernel_gid_t ug_gidbase; - int ug_gidlen; - __kernel_gid_t * ug_gdimap; -}; - -/* GETFH */ -struct nfsctl_fhparm { - struct sockaddr gf_addr; - __kernel_dev_t gf_dev; - __kernel_ino_t gf_ino; - int gf_version; -}; - -/* GETFD */ -struct nfsctl_fdparm { - struct sockaddr gd_addr; - char gd_path[NFS_MAXPATHLEN+1]; - int gd_version; -}; - -/* GETFS - GET Filehandle with Size */ -struct nfsctl_fsparm { - struct sockaddr gd_addr; - char gd_path[NFS_MAXPATHLEN+1]; - int gd_maxlen; -}; - -/* FODROP/STOPFODROP */ -struct nfsctl_fodrop { - char fo_dev[NFS_MAXPATHLEN+1]; - __u32 fo_timeout; -}; - -/* - * This is the argument union. - */ -struct nfsctl_arg { - int ca_version; /* safeguard */ - union { - struct nfsctl_svc u_svc; - struct nfsctl_client u_client; - struct nfsctl_export u_export; - struct nfsctl_uidmap u_umap; - struct nfsctl_fhparm u_getfh; - struct nfsctl_fdparm u_getfd; - struct nfsctl_fsparm u_getfs; - struct nfsctl_fodrop u_fodrop; - } u; -#define ca_svc u.u_svc -#define ca_client u.u_client -#define ca_export u.u_export -#define ca_umap u.u_umap -#define ca_getfh u.u_getfh -#define ca_getfd u.u_getfd -#define ca_getfs u.u_getfs -#define ca_authd u.u_authd -#define ca_fodrop u.u_fodrop -}; - -// TIMXXX - took out to pacify user level compilation. -//union nfsctl_res { - //__u8 cr_getfh[NFS_FHSIZE]; - //struct knfsd_fh cr_getfs; -//}; - -#ifdef __KERNEL__ -/* - * Kernel syscall implementation. - */ -#if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE) -extern asmlinkage long sys_nfsservctl(int, void *, void *); -#else -#define sys_nfsservctl sys_ni_syscall -#endif -extern int exp_addclient(struct nfsctl_client *ncp); -extern int exp_delclient(struct nfsctl_client *ncp); -extern int exp_export(struct nfsctl_export *nxp); -extern int exp_unexport(struct nfsctl_export *nxp); -extern int exp_fodrop(struct nfsctl_fodrop *nfp); -extern int exp_stopfodrop(struct nfsctl_fodrop *nfp); -extern int nfsd_lockd_founlock(struct nfsctl_fodrop *nfp); -extern int nfsd_lockd_fograce(struct nfsctl_fodrop *nfp); -extern int nfsd_lockd_foservice(struct nfsctl_fodrop *nfp); - -#endif /* __KERNEL__ */ - -#endif /* NFSD_SYSCALL_H */ From fabbione@fedoraproject.org Thu Jul 9 09:27:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 09 Jul 2009 09:27:00 -0000 Subject: cluster: STABLE3 - build: drop dependency on readline Message-ID: <20090709092634.61E5612030D@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3da1f7f4ffc11c95cb492500f1fc9d01d745cf8d Commit: 3da1f7f4ffc11c95cb492500f1fc9d01d745cf8d Parent: a375c372ab5342fb60d4ea067ae8791a3188d6ff Author: Fabio M. Di Nitto AuthorDate: Thu Jul 9 11:26:05 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 9 11:26:05 2009 +0200 build: drop dependency on readline the last user has gone away... Signed-off-by: Fabio M. Di Nitto --- configure | 14 -------------- make/defines.mk.input | 2 -- rgmanager/src/daemons/Makefile | 3 +-- 3 files changed, 1 insertions(+), 18 deletions(-) diff --git a/configure b/configure index da3c862..765bff7 100755 --- a/configure +++ b/configure @@ -51,8 +51,6 @@ my %options = ( ncurseslibdir => \$ncurseslibdir, slangincdir => \$slangincdir, slanglibdir => \$slanglibdir, - readlineincdir => \$readlineincdir, - readlinelibdir => \$readlinelibdir, corosyncincdir => \$corosyncincdir, corosynclibdir => \$corosynclibdir, openaisincdir => \$openaisincdir, @@ -139,8 +137,6 @@ my $err = &GetOptions (\%options, 'ncurseslibdir=s', 'slangincdir=s', 'slanglibdir=s', - 'readlineincdir=s', - 'readlinelibdir=s', 'corosyncincdir=s', 'corosynclibdir=s', 'openaisincdir=s', @@ -250,8 +246,6 @@ if ($help || !$err) { print "--ncurseslibdir=\tthe base directory for ncurses libraries. (Default: {libdir})\n"; print "--slangincdir=\tthe base directory for S-Lang include files. (Default: {incdir})\n"; print "--slanglibdir=\tthe base directory for S-Lang libraries. (Default: {libdir})\n"; - print "--readlineincdir=\tthe base directory for readline include files. (Default: {incdir})\n"; - print "--readlinelibdir=\tthe base directory for readline libraries. (Default: {libdir})\n"; print "--corosyncincdir=\tthe base directory for corosync include files. (Default: {incdir})\n"; print "--corosynclibdir=\tthe base directory for corosync libraries. (Default: {libdir}/corosync)\n"; print "--openaisincdir=\tthe base directory for openais include files. (Default: {incdir})\n"; @@ -484,12 +478,6 @@ if (!$logtincdir) { if (!$logtlibdir) { $logtlibdir="${objdir}/common/liblogthread"; } -if (!$readlineincdir) { - $readlineincdir="${incdir}"; -} -if (!$readlinelibdir) { - $readlinelibdir="${libdir}"; -} if (!$ncursesincdir) { $ncursesincdir="${incdir}"; } @@ -733,8 +721,6 @@ while () { $_ =~ s/\@FENCELIBDIR\@/$fencelibdir/; $_ =~ s/\@LOGTINCDIR\@/$logtincdir/; $_ =~ s/\@LOGTLIBDIR\@/$logtlibdir/; - $_ =~ s/\@READLINEINCDIR\@/$readlineincdir/; - $_ =~ s/\@READLINELIBDIR\@/$readlinelibdir/; $_ =~ s/\@NCURSESINCDIR\@/$ncursesincdir/; $_ =~ s/\@NCURSESLIBDIR\@/$ncurseslibdir/; $_ =~ s/\@SLANGINCDIR\@/$slangincdir/; diff --git a/make/defines.mk.input b/make/defines.mk.input index 52e9b88..f6c3c82 100644 --- a/make/defines.mk.input +++ b/make/defines.mk.input @@ -47,8 +47,6 @@ fenceincdir ?= @FENCEINCDIR@ fencelibdir ?= @FENCELIBDIR@ logtincdir ?= @LOGTINCDIR@ logtlibdir ?= @LOGTLIBDIR@ -readlineincdir ?= @READLINEINCDIR@ -readlinelibdir ?= @READLINELIBDIR@ ncursesincdir ?= @NCURSESINCDIR@ ncurseslibdir ?= @NCURSESLIBDIR@ slangincdir ?= @SLANGINCDIR@ diff --git a/rgmanager/src/daemons/Makefile b/rgmanager/src/daemons/Makefile index 71bbdf7..de36971 100644 --- a/rgmanager/src/daemons/Makefile +++ b/rgmanager/src/daemons/Makefile @@ -43,7 +43,7 @@ OBJS2= test-noccs.o \ CFLAGS += -DSHAREDIR=\"${sharedir}\" CFLAGS += -fPIC CFLAGS += -I${ccsincdir} -I${cmanincdir} -I${dlmincdir} -I${logtincdir} -CFLAGS += `xml2-config --cflags` -I${readlineincdir} -I${slangincdir} +CFLAGS += `xml2-config --cflags` -I${slangincdir} CFLAGS += -I$(S)/../../include CFLAGS += -I${incdir} @@ -59,7 +59,6 @@ DLM_LDFLAGS += -L${dlmlibdir} -ldlm XML2_LDFLAGS += `xml2-config --libs` SLANG_LDFLAGS += -L${slanglibdir} -lslang EXTRA_LDFLAGS += -lpthread -READLINE_LDFLAGS += -L${readlinelibdir} -lreadline LDDEPS += ../clulib/libclulib.a From fabbione@fedoraproject.org Thu Jul 9 09:41:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 09 Jul 2009 09:41:00 -0000 Subject: rgmanager: master - build: improve slang include path detection Message-ID: <20090709094116.BFA7E12030D@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/rgmanager.git?p=rgmanager.git;a=commitdiff;h=0bfff9e9bec649f4947ef4b9a164ffdd9ecce0f9 Commit: 0bfff9e9bec649f4947ef4b9a164ffdd9ecce0f9 Parent: ac4e2e66d202d9cfc0071e44a32f7d27281a4449 Author: Fabio M. Di Nitto AuthorDate: Thu Jul 9 11:40:41 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 9 11:40:41 2009 +0200 build: improve slang include path detection make it a lot smarter and avoid a stupid special case Signed-off-by: Fabio M. Di Nitto --- configure.ac | 14 +++++--------- rgmanager/src/daemons/Makefile.am | 2 +- rgmanager/src/daemons/slang_event.c | 4 ++++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index f5b1637..f7a75ff 100644 --- a/configure.ac +++ b/configure.ac @@ -94,17 +94,14 @@ fi # external libs (no pkgconfig) check_lib_no_libs pthread pthread_mutex_lock -AC_CHECK_HEADERS([slang/slang.h], [slang_in_slang=yes]) -if test x"${slang_in_slang}" = xyes; then - slang_CFLAGS="-I${oldincludedir}/slang" -else - AC_CHECK_HEADERS([slang.h], [], - [AC_MSG_ERROR([Unable to find slang development files])]) -fi -slang_LIBS="-lslang" +AC_CHECK_HEADERS([slang/slang.h], [], + [AC_CHECK_HEADERS([slang.h], [], + [AC_MSG_ERROR([Unable to find slang development files])])]) check_lib_no_libs slang SLmemcmp +slang_LIBS="-lslang" + # Checks for header files. AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h termios.h unistd.h]) @@ -192,7 +189,6 @@ AC_DEFINE_UNQUOTED([SYSLOGFACILITY], $(eval echo ${SYSLOGFACILITY}), AC_DEFINE_UNQUOTED([SYSLOGLEVEL], $(eval echo ${SYSLOGLEVEL}), [Default syslog level]) -AC_SUBST([slang_CFLAGS]) AC_SUBST([slang_LIBS]) ## *FLAGS handling diff --git a/rgmanager/src/daemons/Makefile.am b/rgmanager/src/daemons/Makefile.am index 5f9a3e5..6381387 100644 --- a/rgmanager/src/daemons/Makefile.am +++ b/rgmanager/src/daemons/Makefile.am @@ -28,7 +28,7 @@ rgmanager_SOURCES = fo_domain.c \ watchdog.c rgmanager_CFLAGS = $(ccs_CFLAGS) $(cman_CFLAGS) $(dlm_CFLAGS) \ - $(xml_CFLAGS) $(slang_CFLAGS) $(logt_CFLAGS) + $(xml_CFLAGS) $(logt_CFLAGS) rgmanager_LDFLAGS = $(ccs_LIBS) $(cman_LIBS) $(dlm_LIBS) \ $(xml_LIBS) $(slang_LIBS) $(logt_LIBS) \ diff --git a/rgmanager/src/daemons/slang_event.c b/rgmanager/src/daemons/slang_event.c index 2a2d509..716d07f 100644 --- a/rgmanager/src/daemons/slang_event.c +++ b/rgmanager/src/daemons/slang_event.c @@ -17,7 +17,11 @@ #include #include +#ifdef HAVE_SLANG_SLANG_H +#include +#else #include +#endif #include #include #include From lon@fedoraproject.org Thu Jul 9 16:05:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Thu, 09 Jul 2009 16:05:00 -0000 Subject: cluster: RHEL5 - rgmanager: Don't allow migrate of frozen services Message-ID: <20090709160458.334191201FE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a06e21bd1c7fc0590f1734db650bf7b6c60594bb Commit: a06e21bd1c7fc0590f1734db650bf7b6c60594bb Parent: c39f57ec2b16c5e98f3214f6ed0374ab455b8084 Author: Lon Hohberger AuthorDate: Thu Jul 9 11:04:35 2009 -0400 Committer: Lon Hohberger CommitterDate: Thu Jul 9 12:02:03 2009 -0400 rgmanager: Don't allow migrate of frozen services Resolves: Red Hat Bugzilla #510017 Signed-off-by: Lon Hohberger --- rgmanager/src/daemons/rg_state.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c index 3660b71..f703583 100644 --- a/rgmanager/src/daemons/rg_state.c +++ b/rgmanager/src/daemons/rg_state.c @@ -934,6 +934,11 @@ svc_migrate(char *svcName, int target) return RG_EFAIL; } + if (svcStatus.rs_flags & RG_FLAG_FROZEN) { + rg_unlock(&lockp); + return RG_EFROZEN; + } + /* LOCK HELD */ svcStatus.rs_owner = target; svcStatus.rs_last_owner = my_id(); From lon@fedoraproject.org Thu Jul 9 16:07:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Thu, 09 Jul 2009 16:07:00 -0000 Subject: cluster: STABLE3 - rgmanager: Don't allow migrate of frozen services Message-ID: <20090709160636.914E41201FE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6b751d048dd2068c5c62019b675d0d3699409a63 Commit: 6b751d048dd2068c5c62019b675d0d3699409a63 Parent: 3da1f7f4ffc11c95cb492500f1fc9d01d745cf8d Author: Lon Hohberger AuthorDate: Thu Jul 9 11:04:35 2009 -0400 Committer: Lon Hohberger CommitterDate: Thu Jul 9 12:02:30 2009 -0400 rgmanager: Don't allow migrate of frozen services Resolves: Red Hat Bugzilla #510017 Signed-off-by: Lon Hohberger --- rgmanager/src/daemons/rg_state.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c index 16204e1..d137f45 100644 --- a/rgmanager/src/daemons/rg_state.c +++ b/rgmanager/src/daemons/rg_state.c @@ -871,6 +871,11 @@ svc_migrate(const char *svcName, int target) return RG_EFAIL; } + if (svcStatus.rs_flags & RG_FLAG_FROZEN) { + rg_unlock(&lockp); + return RG_EFROZEN; + } + /* LOCK HELD */ svcStatus.rs_owner = target; svcStatus.rs_last_owner = my_id(); From lon@fedoraproject.org Thu Jul 9 16:47:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Thu, 09 Jul 2009 16:47:00 -0000 Subject: rgmanager: master - rgmanager: Don't allow migrate of frozen services Message-ID: <20090709164726.072571201FE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/rgmanager.git?p=rgmanager.git;a=commitdiff;h=202c45ed9d52bb5e3e13920b548790fe02c5c044 Commit: 202c45ed9d52bb5e3e13920b548790fe02c5c044 Parent: 0bfff9e9bec649f4947ef4b9a164ffdd9ecce0f9 Author: Lon Hohberger AuthorDate: Thu Jul 9 11:04:35 2009 -0400 Committer: Lon Hohberger CommitterDate: Thu Jul 9 12:47:01 2009 -0400 rgmanager: Don't allow migrate of frozen services Resolves: Red Hat Bugzilla #510017 Signed-off-by: Lon Hohberger --- rgmanager/src/daemons/rg_state.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c index 7eea6ba..45981db 100644 --- a/rgmanager/src/daemons/rg_state.c +++ b/rgmanager/src/daemons/rg_state.c @@ -873,6 +873,11 @@ svc_migrate(const char *svcName, int target) return RG_EFAIL; } + if (svcStatus.rs_flags & RG_FLAG_FROZEN) { + rg_unlock(&lockp); + return RG_EFROZEN; + } + /* LOCK HELD */ svcStatus.rs_owner = target; svcStatus.rs_last_owner = my_id(); From lon@fedoraproject.org Thu Jul 9 17:28:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Thu, 09 Jul 2009 17:28:00 -0000 Subject: resource-agents: master - rgmanager: Add resource agent for DRBD Message-ID: <20090709172802.B15F11201FE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=500f317a798a92527486d8fc9a7cd23a611ccc5c Commit: 500f317a798a92527486d8fc9a7cd23a611ccc5c Parent: 1ae6f5cc3a628ffeb7cd2bf61178f858196703a3 Author: Florian Haas AuthorDate: Thu Jul 2 10:49:39 2009 +0200 Committer: Lon Hohberger CommitterDate: Thu Jul 9 13:27:03 2009 -0400 rgmanager: Add resource agent for DRBD DRBD (www.drbd.org) is a shared-nothing synchronous storage replication capable of acting as a drop-in replacement for shared storage. This resource agent manages a DRBD device by switching it into the Primary and Secondary roles as needed. For a configuration example, please see http://www.drbd.org/users-guide/s-rhcs-failover-clusters.html Signed-off-by: Lon Hohberger --- rgmanager/src/resources/Makefile.am | 4 +- rgmanager/src/resources/drbd.metadata | 51 ++++++++++++ rgmanager/src/resources/drbd.sh | 144 +++++++++++++++++++++++++++++++++ 3 files changed, 197 insertions(+), 2 deletions(-) diff --git a/rgmanager/src/resources/Makefile.am b/rgmanager/src/resources/Makefile.am index ebeb61e..ede5a74 100644 --- a/rgmanager/src/resources/Makefile.am +++ b/rgmanager/src/resources/Makefile.am @@ -9,11 +9,11 @@ RESOURCES = service.sh ip.sh nfsclient.sh nfsexport.sh \ apache.sh openldap.sh samba.sh mysql.sh \ postgres-8.sh tomcat-5.sh lvm.sh \ vm.sh SAPInstance SAPDatabase named.sh \ - ASEHAagent.sh + ASEHAagent.sh drbd.sh METADATA = apache.metadata openldap.metadata samba.metadata \ mysql.metadata postgres-8.metadata \ - tomcat-5.metadata named.metadata lvm.metadata + tomcat-5.metadata named.metadata lvm.metadata drbd.sh EVENT_TARGETS = default_event_script.sl follow-service.sl diff --git a/rgmanager/src/resources/drbd.metadata b/rgmanager/src/resources/drbd.metadata new file mode 100644 index 0000000..30fe122 --- /dev/null +++ b/rgmanager/src/resources/drbd.metadata @@ -0,0 +1,51 @@ + + + 1.0 + + + This is a DRBD resource. The resource must be configured + in the configuration file (/etc/drbd.conf), and the + DRBD kernel module must be loaded. + + + + This is a DRBD resource. + + + + + + Symbolic name for this resource. + + + Cluster resource name + + + + + + The DRBD resource name, as specified in /etc/drbd.conf. + + + DRBD resource name + + + + + + + + + + + + + + + + + + + + + diff --git a/rgmanager/src/resources/drbd.sh b/rgmanager/src/resources/drbd.sh new file mode 100644 index 0000000..4571660 --- /dev/null +++ b/rgmanager/src/resources/drbd.sh @@ -0,0 +1,144 @@ +#!/bin/bash +# +# Copyright LINBIT, 2008 +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, +# MA 02139, USA. +# + +# +# DRBD resource management using the drbdadm utility. +# + +LC_ALL=C +LANG=C +PATH=/bin:/sbin:/usr/bin:/usr/sbin +export LC_ALL LANG PATH + +. $(dirname $0)/ocf-shellfuncs + +drbd_verify_all() +{ + # Do we have the drbdadm utility? + if ! which drbdadm >/dev/null 2>&1 ; then + ocf_log error "drbdadm not installed, not found in PATH ($PATH), or not executable." + return $OCF_ERR_INSTALLED + fi + + # Is drbd loaded? + if ! grep drbd /proc/modules >/dev/null 2>&1; then + ocf_log error "drbd not found in /proc/modules. Do you need to modprobe?" + return $OCF_ERR_INSTALLED + fi + + # Do we have the "resource" parameter? + if [ -n "$OCF_RESKEY_resource" ]; then + + # Can drbdadm parse the resource name? + if ! drbdadm sh-dev $OCF_RESKEY_resource >/dev/null 2>&1; then + ocf_log error "DRBD resource \"$OCF_RESKEY_resource\" not found." + return $OCF_ERR_CONFIGURED + fi + + # Is the backing device a locally available block device? + backing_dev=$(drbdadm sh-ll-dev $OCF_RESKEY_resource) + if [ ! -b $backing_dev ]; then + ocf_log error "Backing device for DRBD resource \"$OCF_RESKEY_resource\" ($backing_dev) not found or not a block device." + return $OCF_ERR_INSTALLED + fi + + fi + + return 0 +} + +drbd_status() { + role=$(drbdadm role $OCF_RESKEY_resource) + case $role in + Primary/*) + return $OCF_RUNNING + ;; + Secondary/*) + return $OCF_NOT_RUNNING + ;; + + esac + return $OCF_ERR_GENERIC +} + +drbd_promote() { + drbdadm primary $OCF_RESKEY_resource || return $? +} + +drbd_demote() { + drbdadm secondary $OCF_RESKEY_resource || return $? +} + + +if [ -z "$OCF_CHECK_LEVEL" ]; then + OCF_CHECK_LEVEL=0 +fi + +# This one doesn't need to pass the verify check +case $1 in + meta-data) + cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'` && exit 0 + exit $OCF_ERR_GENERIC + ;; +esac + +# Everything else does +drbd_verify_all || exit $? +case $1 in + start) + if drbd_status; then + ocf_log debug "DRBD resource ${OCF_RESKEY_resource} already configured" + exit 0 + fi + drbd_promote + if [ $? -ne 0 ]; then + exit $OCF_ERR_GENERIC + fi + + exit $? + ;; + stop) + if drbd_status; then + drbd_demote + if [ $? -ne 0 ]; then + exit $OCF_ERR_GENERIC + fi + else + ocf_log debug "DRBD resource ${OCF_RESKEY_resource} is not configured" + fi + exit 0 + ;; + status|monitor) + drbd_status + exit $? + ;; + restart) + $0 stop || exit $OCF_ERR_GENERIC + $0 start || exit $OCF_ERR_GENERIC + exit 0 + ;; + verify-all) + exit 0 + ;; + *) + echo "usage: $0 {start|stop|status|monitor|restart|meta-data|verify-all}" + exit $OCF_ERR_GENERIC + ;; +esac From lon@fedoraproject.org Thu Jul 9 17:31:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Thu, 09 Jul 2009 17:31:00 -0000 Subject: resource-agents: master - drbd: Fix metadata target Message-ID: <20090709173110.70ABC1201FE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=b3bc0b969f7bb69f5b2dd1ea39be8c9dc7524304 Commit: b3bc0b969f7bb69f5b2dd1ea39be8c9dc7524304 Parent: 500f317a798a92527486d8fc9a7cd23a611ccc5c Author: Lon Hohberger AuthorDate: Thu Jul 9 13:30:52 2009 -0400 Committer: Lon Hohberger CommitterDate: Thu Jul 9 13:30:52 2009 -0400 drbd: Fix metadata target Signed-off-by: Lon Hohberger --- rgmanager/src/resources/Makefile.am | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/rgmanager/src/resources/Makefile.am b/rgmanager/src/resources/Makefile.am index ede5a74..b249591 100644 --- a/rgmanager/src/resources/Makefile.am +++ b/rgmanager/src/resources/Makefile.am @@ -13,7 +13,8 @@ RESOURCES = service.sh ip.sh nfsclient.sh nfsexport.sh \ METADATA = apache.metadata openldap.metadata samba.metadata \ mysql.metadata postgres-8.metadata \ - tomcat-5.metadata named.metadata lvm.metadata drbd.sh + tomcat-5.metadata named.metadata lvm.metadata \ + drbd.metadata EVENT_TARGETS = default_event_script.sl follow-service.sl From lon@fedoraproject.org Thu Jul 9 17:31:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Thu, 09 Jul 2009 17:31:00 -0000 Subject: cluster: STABLE3 - rgmanager: Add resource agent for DRBD Message-ID: <20090709173018.78F0A1201FE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=bd8dc44918a9ee71e3f8aa1c705eacd610a9b7de Commit: bd8dc44918a9ee71e3f8aa1c705eacd610a9b7de Parent: 6b751d048dd2068c5c62019b675d0d3699409a63 Author: Florian Haas AuthorDate: Thu Jul 2 10:49:39 2009 +0200 Committer: Lon Hohberger CommitterDate: Thu Jul 9 13:29:59 2009 -0400 rgmanager: Add resource agent for DRBD DRBD (www.drbd.org) is a shared-nothing synchronous storage replication capable of acting as a drop-in replacement for shared storage. This resource agent manages a DRBD device by switching it into the Primary and Secondary roles as needed. For a configuration example, please see http://www.drbd.org/users-guide/s-rhcs-failover-clusters.html Signed-off-by: Lon Hohberger --- rgmanager/src/resources/Makefile | 4 +- rgmanager/src/resources/drbd.metadata | 51 ++++++++++++ rgmanager/src/resources/drbd.sh | 144 +++++++++++++++++++++++++++++++++ 3 files changed, 197 insertions(+), 2 deletions(-) diff --git a/rgmanager/src/resources/Makefile b/rgmanager/src/resources/Makefile index 08d5489..8d79cbe 100644 --- a/rgmanager/src/resources/Makefile +++ b/rgmanager/src/resources/Makefile @@ -12,11 +12,11 @@ RESOURCES=service.sh ip.sh nfsclient.sh nfsexport.sh \ apache.sh openldap.sh samba.sh mysql.sh \ postgres-8.sh tomcat-5.sh lvm.sh \ vm.sh SAPInstance SAPDatabase named.sh \ - ASEHAagent.sh + ASEHAagent.sh drbd.sh METADATA=apache.metadata openldap.metadata samba.metadata \ mysql.metadata postgres-8.metadata tomcat-5.metadata \ - named.metadata lvm.metadata + named.metadata lvm.metadata drbd.metadata EVENT_TARGETS= \ default_event_script.sl \ diff --git a/rgmanager/src/resources/drbd.metadata b/rgmanager/src/resources/drbd.metadata new file mode 100644 index 0000000..30fe122 --- /dev/null +++ b/rgmanager/src/resources/drbd.metadata @@ -0,0 +1,51 @@ + + + 1.0 + + + This is a DRBD resource. The resource must be configured + in the configuration file (/etc/drbd.conf), and the + DRBD kernel module must be loaded. + + + + This is a DRBD resource. + + + + + + Symbolic name for this resource. + + + Cluster resource name + + + + + + The DRBD resource name, as specified in /etc/drbd.conf. + + + DRBD resource name + + + + + + + + + + + + + + + + + + + + + diff --git a/rgmanager/src/resources/drbd.sh b/rgmanager/src/resources/drbd.sh new file mode 100644 index 0000000..4571660 --- /dev/null +++ b/rgmanager/src/resources/drbd.sh @@ -0,0 +1,144 @@ +#!/bin/bash +# +# Copyright LINBIT, 2008 +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2, or (at your option) any +# later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 675 Mass Ave, Cambridge, +# MA 02139, USA. +# + +# +# DRBD resource management using the drbdadm utility. +# + +LC_ALL=C +LANG=C +PATH=/bin:/sbin:/usr/bin:/usr/sbin +export LC_ALL LANG PATH + +. $(dirname $0)/ocf-shellfuncs + +drbd_verify_all() +{ + # Do we have the drbdadm utility? + if ! which drbdadm >/dev/null 2>&1 ; then + ocf_log error "drbdadm not installed, not found in PATH ($PATH), or not executable." + return $OCF_ERR_INSTALLED + fi + + # Is drbd loaded? + if ! grep drbd /proc/modules >/dev/null 2>&1; then + ocf_log error "drbd not found in /proc/modules. Do you need to modprobe?" + return $OCF_ERR_INSTALLED + fi + + # Do we have the "resource" parameter? + if [ -n "$OCF_RESKEY_resource" ]; then + + # Can drbdadm parse the resource name? + if ! drbdadm sh-dev $OCF_RESKEY_resource >/dev/null 2>&1; then + ocf_log error "DRBD resource \"$OCF_RESKEY_resource\" not found." + return $OCF_ERR_CONFIGURED + fi + + # Is the backing device a locally available block device? + backing_dev=$(drbdadm sh-ll-dev $OCF_RESKEY_resource) + if [ ! -b $backing_dev ]; then + ocf_log error "Backing device for DRBD resource \"$OCF_RESKEY_resource\" ($backing_dev) not found or not a block device." + return $OCF_ERR_INSTALLED + fi + + fi + + return 0 +} + +drbd_status() { + role=$(drbdadm role $OCF_RESKEY_resource) + case $role in + Primary/*) + return $OCF_RUNNING + ;; + Secondary/*) + return $OCF_NOT_RUNNING + ;; + + esac + return $OCF_ERR_GENERIC +} + +drbd_promote() { + drbdadm primary $OCF_RESKEY_resource || return $? +} + +drbd_demote() { + drbdadm secondary $OCF_RESKEY_resource || return $? +} + + +if [ -z "$OCF_CHECK_LEVEL" ]; then + OCF_CHECK_LEVEL=0 +fi + +# This one doesn't need to pass the verify check +case $1 in + meta-data) + cat `echo $0 | sed 's/^\(.*\)\.sh$/\1.metadata/'` && exit 0 + exit $OCF_ERR_GENERIC + ;; +esac + +# Everything else does +drbd_verify_all || exit $? +case $1 in + start) + if drbd_status; then + ocf_log debug "DRBD resource ${OCF_RESKEY_resource} already configured" + exit 0 + fi + drbd_promote + if [ $? -ne 0 ]; then + exit $OCF_ERR_GENERIC + fi + + exit $? + ;; + stop) + if drbd_status; then + drbd_demote + if [ $? -ne 0 ]; then + exit $OCF_ERR_GENERIC + fi + else + ocf_log debug "DRBD resource ${OCF_RESKEY_resource} is not configured" + fi + exit 0 + ;; + status|monitor) + drbd_status + exit $? + ;; + restart) + $0 stop || exit $OCF_ERR_GENERIC + $0 start || exit $OCF_ERR_GENERIC + exit 0 + ;; + verify-all) + exit 0 + ;; + *) + echo "usage: $0 {start|stop|status|monitor|restart|meta-data|verify-all}" + exit $OCF_ERR_GENERIC + ;; +esac From fabbione@fedoraproject.org Fri Jul 10 07:06:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Fri, 10 Jul 2009 07:06:00 -0000 Subject: gfs2-utils: master - build: drop build dependency on python Message-ID: <20090710070615.CEF25120380@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=d20b0d2be3ddcd30637ddd158de1eee1b12c7710 Commit: d20b0d2be3ddcd30637ddd158de1eee1b12c7710 Parent: 3b256287f994e564ec7a6c580003d77029a246bf Author: Fabio M. Di Nitto AuthorDate: Fri Jul 10 09:05:46 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Fri Jul 10 09:05:46 2009 +0200 build: drop build dependency on python this was required only for askant Signed-off-by: Fabio M. Di Nitto --- configure.ac | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index 78db886..6b537d4 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,6 @@ AC_INIT([gfs2-utils], [master], [linux-cluster@redhat.com]) AM_INIT_AUTOMAKE([-Wno-portability]) LT_PREREQ([2.2.7]) LT_INIT -AM_PATH_PYTHON AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([group/gfs_controld/config.c]) From rpeterso@fedoraproject.org Fri Jul 10 16:25:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Fri, 10 Jul 2009 16:25:00 -0000 Subject: gfs2-utils: master - fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. Message-ID: <20090710162517.88E041201D8@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=5305e878a987b90caf498f0bc5a92ae7ba8fa57d Commit: 5305e878a987b90caf498f0bc5a92ae7ba8fa57d Parent: d20b0d2be3ddcd30637ddd158de1eee1b12c7710 Author: Bob Peterson AuthorDate: Fri Jul 10 11:15:53 2009 -0500 Committer: Bob Peterson CommitterDate: Fri Jul 10 11:24:57 2009 -0500 fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. bz 510758 This is a gfs2 crosswrite from gfs of commit 8df780b532e02acef7f0ebc0113cf96515a7a3b6 --- gfs2/fsck/metawalk.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c index 64f98e0..da89c93 100644 --- a/gfs2/fsck/metawalk.c +++ b/gfs2/fsck/metawalk.c @@ -634,9 +634,10 @@ static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block, if(error > 0) { return 1; } - error = check_eattr_entries(ip, bh, pass, want_updated); - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass, want_updated); brelse(bh, *want_updated); + } return error; } From rpeterso@fedoraproject.org Fri Jul 10 16:27:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Fri, 10 Jul 2009 16:27:00 -0000 Subject: cluster: STABLE3 - fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. Message-ID: <20090710162702.3608C1201D8@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=05488044454ca7737f52f2d846b54b87ae08813b Commit: 05488044454ca7737f52f2d846b54b87ae08813b Parent: bd8dc44918a9ee71e3f8aa1c705eacd610a9b7de Author: Bob Peterson AuthorDate: Fri Jul 10 11:15:53 2009 -0500 Committer: Bob Peterson CommitterDate: Fri Jul 10 11:15:53 2009 -0500 fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. bz 510758 This is a gfs2 crosswrite from gfs of commit 8df780b532e02acef7f0ebc0113cf96515a7a3b6 --- gfs2/fsck/metawalk.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c index 7088d8f..fda6058 100644 --- a/gfs2/fsck/metawalk.c +++ b/gfs2/fsck/metawalk.c @@ -632,9 +632,10 @@ static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block, if(error > 0) { return 1; } - error = check_eattr_entries(ip, bh, pass, want_updated); - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass, want_updated); brelse(bh, *want_updated); + } return error; } From rpeterso@fedoraproject.org Fri Jul 10 16:36:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Fri, 10 Jul 2009 16:36:00 -0000 Subject: cluster: STABLE2 - fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. Message-ID: <20090710163605.CAAC31201D8@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8956c953c63ff8d4b3c3cb8719a739862e21beb1 Commit: 8956c953c63ff8d4b3c3cb8719a739862e21beb1 Parent: 6f93883fe128c365ced47d78838213d62c61a7eb Author: Bob Peterson AuthorDate: Fri Jul 10 11:36:20 2009 -0500 Committer: Bob Peterson CommitterDate: Fri Jul 10 11:36:20 2009 -0500 fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. bz 510758 This is a gfs2 crosswrite from gfs of commit 8df780b532e02acef7f0ebc0113cf96515a7a3b6 --- gfs2/fsck/metawalk.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c index 69a2caf..99104ea 100644 --- a/gfs2/fsck/metawalk.c +++ b/gfs2/fsck/metawalk.c @@ -568,9 +568,11 @@ static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block, if(error > 0) { return 1; } - check_eattr_entries(ip, bh, pass, want_updated); - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass, want_updated); brelse(bh, *want_updated); + } + return error; } return 0; From chrissie@fedoraproject.org Mon Jul 13 12:04:00 2009 From: chrissie@fedoraproject.org (Christine Caulfield) Date: Mon, 13 Jul 2009 12:04:00 -0000 Subject: cluster: RHEL53 - cman: Fix inconsistent state if a node leaves/joins quickly Message-ID: <20090713120401.98CF11201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2bac6a6e1a24cd56f08bb89299296bf2a9a6ea58 Commit: 2bac6a6e1a24cd56f08bb89299296bf2a9a6ea58 Parent: ac64d03b9f75cff824fabe3ce40177f972936d5f Author: Christine Caulfield AuthorDate: Wed Dec 3 10:46:20 2008 +0000 Committer: Christine Caulfield CommitterDate: Mon Jul 13 13:03:02 2009 +0100 cman: Fix inconsistent state if a node leaves/joins quickly This bug was fixed in STABLE2 some time ago. bz#510510 Signed-off-by: Christine Caulfield --- cman/daemon/commands.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index 945268a..46ab3fd 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -1979,7 +1979,7 @@ void add_ais_node(int nodeid, uint64_t incarnation, int total_members) node->name = strdup(tempname); } - if (node->state == NODESTATE_DEAD) { + if (node->state == NODESTATE_DEAD || node->state == NODESTATE_LEAVING) { gettimeofday(&node->join_time, NULL); node->incarnation = incarnation; node->state = NODESTATE_MEMBER; From marx@fedoraproject.org Mon Jul 13 13:55:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 13 Jul 2009 13:55:00 -0000 Subject: fence-agents: master - fencing: Metadata suitable for automatic man pages generation Message-ID: <20090713135457.BA0AD1201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=122857accf9e20167c2fae3ef76f24979a0d0ca6 Commit: 122857accf9e20167c2fae3ef76f24979a0d0ca6 Parent: 0d3b83cf00ef4c172922d271a6acb34a825561fd Author: Marek 'marx' Grac AuthorDate: Mon Jul 13 15:43:05 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 13 15:43:05 2009 +0200 fencing: Metadata suitable for automatic man pages generation Information about individual options are extended so they are more suitable for creating better metadata. We can use them to produce fresh manual pages. Metadata have to be formatted using XSLT processor (e.h. xsltproc) using template ra2man.xsl in lib/ Example: fence_lpar -o metadata | xsltproc ra2man.xsl - | nroff -mandoc > z man ./z @note: If the default value is array then only string 'list of values' is rendered. As currently it is not possible to enter arrays from getopt/stdin. --- fence/agents/lib/fencing.py.py | 62 +++++++++++++++++++++++++++++++--- fence/agents/lib/ra2man.xsl | 72 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+), 5 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 3829ccc..eaff7a0 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -37,11 +37,15 @@ all_opt = { "getopt" : "h", "longopt" : "help", "help" : "-h, --help Display this help and exit", + "required" : "0", + "shortdesc" : "Display help and exit", "order" : 54 }, "version" : { "getopt" : "V", "longopt" : "version", "help" : "-V, --version Output version information and exit", + "required" : "0", + "shortdesc" : "Display version information and exit", "order" : 53 }, "quiet" : { "getopt" : "q", @@ -58,6 +62,8 @@ all_opt = { "getopt" : "D:", "longopt" : "debug-file", "help" : "-D, --debug-file= Debugging to output file", + "required" : "0", + "shortdesc" : "Write debug information to given file", "order" : 52 }, "agent" : { "getopt" : "", @@ -125,34 +131,44 @@ all_opt = { "getopt" : "m:", "longopt" : "module-name", "help" : "-m, --module-name= DRAC/MC module name", + "required" : "0", + "shortdesc" : "DRAC/MC module name", "order" : 1 }, "drac_version" : { "getopt" : "d:", "longopt" : "drac-version", "help" : "-d, --drac-version= Force DRAC version to use", + "required" : "0", + "shortdesc" : "Force DRAC version to use", "order" : 1 }, "hmc_version" : { "getopt" : "H:", "longopt" : "hmc-version", "help" : "-H, --hmc-version= Force HMC version to use: 3, 4 (default)", + "required" : "0", + "shortdesc" : "Force HMC version to use (3 or 4)", "default" : "4", "order" : 1 }, "ribcl" : { "getopt" : "r:", "longopt" : "ribcl-version", "help" : "-r, --ribcl-version= Force ribcl version to use", + "required" : "0", + "shortdesc" : "Force ribcl version to use", "order" : 1 }, "cmd_prompt" : { "getopt" : "c:", "longopt" : "command-prompt", "help" : "-c, --command-prompt= Force command prompt", + "shortdesc" : "Force command prompt", + "required" : "0", "order" : 1 }, "secure" : { "getopt" : "x", "longopt" : "ssh", "help" : "-x, --ssh Use ssh connection", - "required" : "0", "shortdesc" : "SSH connection", + "required" : "0", "order" : 1 }, "ssl" : { "getopt" : "z", @@ -290,6 +306,8 @@ all_opt = { "longopt" : "separator", "help" : "-C, --separator= Separator for CSV created by 'list' operation", "default" : ",", + "required" : "0", + "shortdesc" : "Separator for CSV created by operation list", "order" : 100 } } @@ -346,14 +364,15 @@ def usage(avail_opt): if len(value["help"]) != 0: print " " + value["help"] -def metadata(avail_opt): +def metadata(avail_opt, options, docs): global all_opt sorted_list = [ (key, all_opt[key]) for key in avail_opt ] sorted_list.sort(lambda x, y: cmp(x[1]["order"], y[1]["order"])) print "" - print "" + print "" + print "" + docs["longdesc"] + "" print "" for option, value in sorted_list: if all_opt[option].has_key("shortdesc"): @@ -362,14 +381,42 @@ def metadata(avail_opt): default = "" if all_opt[option].has_key("default"): default = "default=\""+all_opt[option]["default"]+"\"" + elif options.has_key("-" + all_opt[option]["getopt"][:-1]): + if options["-" + all_opt[option]["getopt"][:-1]]: + try: + default = "default=\"" + options["-" + all_opt[option]["getopt"][:-1]] + "\"" + except TypeError: + ## @todo/@note: Currently there is no clean way how to handle lists + ## we can create a string from it but we can't set it on command line + default = "default=\"list of values\"" + elif options.has_key("-" + all_opt[option]["getopt"]): + default = "default=\"true\" " + + mixed = all_opt[option]["help"] + ## split it between option and help text + res = re.compile("^(.*--\S+)\s+", re.IGNORECASE | re.S).search(mixed) + if (None != res): + mixed = res.group(1) + mixed = mixed.replace("<", "<").replace(">", ">") + print "\t\t" if all_opt[option]["getopt"].count(":") > 0: print "\t\t" else: print "\t\t" + print "\t\t" + all_opt[option]["shortdesc"] + "" print "\t" print "" + print "" + print "\t" + print "\t" + print "\t" + print "\t" + print "\t" + print "\t" + print "\t" + print "" print "" def process_input(avail_opt): @@ -561,8 +608,13 @@ def wait_power_status(tn, options, get_power_fn): return 1 return 0 -def show_docs(options): +def show_docs(options, docs = None): device_opt = options["device_opt"] + + if docs == None: + docs = { } + docs["shortdesc"] = "Fence agent" + docs["longdesc"] = "" ## Process special options (and exit) ##### @@ -571,7 +623,7 @@ def show_docs(options): sys.exit(0) if options.has_key("-o") and options["-o"].lower() == "metadata": - metadata(device_opt) + metadata(device_opt, options, docs) sys.exit(0) if options.has_key("-V"): diff --git a/fence/agents/lib/ra2man.xsl b/fence/agents/lib/ra2man.xsl new file mode 100644 index 0000000..2169e1f --- /dev/null +++ b/fence/agents/lib/ra2man.xsl @@ -0,0 +1,72 @@ + + + + + +.TP +.B +.B +. + + + + +This parameter is always required. +.br +Default Value: + + + +.TP +\fB + + +Power on machine. + + +Power off machine. + + +Reboot machine. + + +Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more). + + +Display the XML metadata describing this resource. + + +List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise. + + +This returns the status of the plug/virtual machine. + + + +The operational behavior of this is not known. + + + + + +.TH FENCE_AGENT 8 2009-01-20 " (Fence Agent)" +.SH NAME + - +.SH DESCRIPTION + accepts options on the command line as well +as from stdin. Fenced sends parameters through stdin when it execs the +agent. can be run by itself with command +line options. This is useful for testing and for turning outlets on or off +from scripts. + + +.SH PARAMETERS +getopt +.SH ACTIONS + +.SH STDIN PARAMETERS +stdin + + + + From marx@fedoraproject.org Mon Jul 13 14:53:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 13 Jul 2009 14:53:00 -0000 Subject: cluster: STABLE3 - fencing: Metadata suitable for automatic man pages generation Message-ID: <20090713145304.D4C151201FF@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=634c700d5781476ed777266950bd84e4952fa4a9 Commit: 634c700d5781476ed777266950bd84e4952fa4a9 Parent: 014fead2ca7adce6b3832a0585498f4abcc3250e Author: Marek 'marx' Grac AuthorDate: Mon Jul 13 16:48:05 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 13 16:48:05 2009 +0200 fencing: Metadata suitable for automatic man pages generation Information about individual options are extended so they are more suitable for creating better metadata. We can use them to produce fresh manual pages. Metadata have to be formatted using XSLT processor (e.h. xsltproc) using template ra2man.xsl in lib/ Example: fence_lpar -o metadata | xsltproc ra2man.xsl - | nroff -mandoc > z man ./z @note: If the default value is array then only string 'list of values' is rendered. As currently it is not possible to enter arrays from getopt/stdin. --- fence/agents/lib/fencing.py.py | 62 ++++++++++++++++++++++++++++++++++++--- 1 files changed, 57 insertions(+), 5 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 3829ccc..eaff7a0 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -37,11 +37,15 @@ all_opt = { "getopt" : "h", "longopt" : "help", "help" : "-h, --help Display this help and exit", + "required" : "0", + "shortdesc" : "Display help and exit", "order" : 54 }, "version" : { "getopt" : "V", "longopt" : "version", "help" : "-V, --version Output version information and exit", + "required" : "0", + "shortdesc" : "Display version information and exit", "order" : 53 }, "quiet" : { "getopt" : "q", @@ -58,6 +62,8 @@ all_opt = { "getopt" : "D:", "longopt" : "debug-file", "help" : "-D, --debug-file= Debugging to output file", + "required" : "0", + "shortdesc" : "Write debug information to given file", "order" : 52 }, "agent" : { "getopt" : "", @@ -125,34 +131,44 @@ all_opt = { "getopt" : "m:", "longopt" : "module-name", "help" : "-m, --module-name= DRAC/MC module name", + "required" : "0", + "shortdesc" : "DRAC/MC module name", "order" : 1 }, "drac_version" : { "getopt" : "d:", "longopt" : "drac-version", "help" : "-d, --drac-version= Force DRAC version to use", + "required" : "0", + "shortdesc" : "Force DRAC version to use", "order" : 1 }, "hmc_version" : { "getopt" : "H:", "longopt" : "hmc-version", "help" : "-H, --hmc-version= Force HMC version to use: 3, 4 (default)", + "required" : "0", + "shortdesc" : "Force HMC version to use (3 or 4)", "default" : "4", "order" : 1 }, "ribcl" : { "getopt" : "r:", "longopt" : "ribcl-version", "help" : "-r, --ribcl-version= Force ribcl version to use", + "required" : "0", + "shortdesc" : "Force ribcl version to use", "order" : 1 }, "cmd_prompt" : { "getopt" : "c:", "longopt" : "command-prompt", "help" : "-c, --command-prompt= Force command prompt", + "shortdesc" : "Force command prompt", + "required" : "0", "order" : 1 }, "secure" : { "getopt" : "x", "longopt" : "ssh", "help" : "-x, --ssh Use ssh connection", - "required" : "0", "shortdesc" : "SSH connection", + "required" : "0", "order" : 1 }, "ssl" : { "getopt" : "z", @@ -290,6 +306,8 @@ all_opt = { "longopt" : "separator", "help" : "-C, --separator= Separator for CSV created by 'list' operation", "default" : ",", + "required" : "0", + "shortdesc" : "Separator for CSV created by operation list", "order" : 100 } } @@ -346,14 +364,15 @@ def usage(avail_opt): if len(value["help"]) != 0: print " " + value["help"] -def metadata(avail_opt): +def metadata(avail_opt, options, docs): global all_opt sorted_list = [ (key, all_opt[key]) for key in avail_opt ] sorted_list.sort(lambda x, y: cmp(x[1]["order"], y[1]["order"])) print "" - print "" + print "" + print "" + docs["longdesc"] + "" print "" for option, value in sorted_list: if all_opt[option].has_key("shortdesc"): @@ -362,14 +381,42 @@ def metadata(avail_opt): default = "" if all_opt[option].has_key("default"): default = "default=\""+all_opt[option]["default"]+"\"" + elif options.has_key("-" + all_opt[option]["getopt"][:-1]): + if options["-" + all_opt[option]["getopt"][:-1]]: + try: + default = "default=\"" + options["-" + all_opt[option]["getopt"][:-1]] + "\"" + except TypeError: + ## @todo/@note: Currently there is no clean way how to handle lists + ## we can create a string from it but we can't set it on command line + default = "default=\"list of values\"" + elif options.has_key("-" + all_opt[option]["getopt"]): + default = "default=\"true\" " + + mixed = all_opt[option]["help"] + ## split it between option and help text + res = re.compile("^(.*--\S+)\s+", re.IGNORECASE | re.S).search(mixed) + if (None != res): + mixed = res.group(1) + mixed = mixed.replace("<", "<").replace(">", ">") + print "\t\t" if all_opt[option]["getopt"].count(":") > 0: print "\t\t" else: print "\t\t" + print "\t\t" + all_opt[option]["shortdesc"] + "" print "\t" print "" + print "" + print "\t" + print "\t" + print "\t" + print "\t" + print "\t" + print "\t" + print "\t" + print "" print "" def process_input(avail_opt): @@ -561,8 +608,13 @@ def wait_power_status(tn, options, get_power_fn): return 1 return 0 -def show_docs(options): +def show_docs(options, docs = None): device_opt = options["device_opt"] + + if docs == None: + docs = { } + docs["shortdesc"] = "Fence agent" + docs["longdesc"] = "" ## Process special options (and exit) ##### @@ -571,7 +623,7 @@ def show_docs(options): sys.exit(0) if options.has_key("-o") and options["-o"].lower() == "metadata": - metadata(device_opt) + metadata(device_opt, options, docs) sys.exit(0) if options.has_key("-V"): From marx@fedoraproject.org Mon Jul 13 14:53:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 13 Jul 2009 14:53:00 -0000 Subject: cluster: STABLE3 - fencing: Create a function that prints documentation Message-ID: <20090713145302.B82AF1201FF@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=014fead2ca7adce6b3832a0585498f4abcc3250e Commit: 014fead2ca7adce6b3832a0585498f4abcc3250e Parent: 05488044454ca7737f52f2d846b54b87ae08813b Author: Marek 'marx' Grac AuthorDate: Mon Jul 13 16:44:38 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 13 16:44:38 2009 +0200 fencing: Create a function that prints documentation This have to be moved because we need access also to agent specific values as they will be presented as defaults in metadata. Prerequisite for man pages generation. 1st part of solution for bz#488959 --- fence/agents/alom/fence_alom.py | 4 ++- fence/agents/apc/fence_apc.py | 2 + fence/agents/apc_snmp/fence_apc_snmp.py | 2 + fence/agents/bladecenter/fence_bladecenter.py | 2 + fence/agents/cisco_mds/fence_cisco_mds.py | 2 + fence/agents/drac/fence_drac5.py | 2 + fence/agents/eps/fence_eps.py | 2 + fence/agents/ibmblade/fence_ibmblade.py | 2 + fence/agents/ifmib/fence_ifmib.py | 2 + fence/agents/ilo/fence_ilo.py | 2 + fence/agents/intelmodular/fence_intelmodular.py | 2 + fence/agents/ldom/fence_ldom.py | 2 + fence/agents/lib/fencing.py.py | 36 ++++++++++++++-------- fence/agents/lpar/fence_lpar.py | 4 ++- fence/agents/rsa/fence_rsa.py | 2 + fence/agents/virsh/fence_virsh.py | 2 + fence/agents/vmware/fence_vmware.py | 2 + fence/agents/wti/fence_wti.py | 2 + 18 files changed, 59 insertions(+), 15 deletions(-) diff --git a/fence/agents/alom/fence_alom.py b/fence/agents/alom/fence_alom.py index 610ec2b..5fe72aa 100644 --- a/fence/agents/alom/fence_alom.py +++ b/fence/agents/alom/fence_alom.py @@ -53,11 +53,13 @@ def main(): # Default command is sc> if (not options.has_key("-c")): - options["-c"] = "sc\>\ " + options["-c"] = "sc\>\ " # Default to ssh options["-x"] = 1 options["telnet_over_ssh"] = 1 + + show_docs(options) # Operate the fencing device conn = fence_login(options) diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py index 13bad67..e4a3e3d 100755 --- a/fence/agents/apc/fence_apc.py +++ b/fence/agents/apc/fence_apc.py @@ -199,6 +199,8 @@ def main(): if 0 == options.has_key("-c"): options["-c"] = "\n>" + show_docs(options) + ## Support for -n [switch]:[plug] notation that was used before if (options.has_key("-n") == 1) and (-1 != options["-n"].find(":")): (switch, plug) = options["-n"].split(":", 1) diff --git a/fence/agents/apc_snmp/fence_apc_snmp.py b/fence/agents/apc_snmp/fence_apc_snmp.py index 6ff1318..91331b5 100644 --- a/fence/agents/apc_snmp/fence_apc_snmp.py +++ b/fence/agents/apc_snmp/fence_apc_snmp.py @@ -187,6 +187,8 @@ def main(): if (not (options.has_key("-s"))): options["-s"]="1" + show_docs(options) + # Operate the fencing device fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status) diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py index d694966..5df4869 100644 --- a/fence/agents/bladecenter/fence_bladecenter.py +++ b/fence/agents/bladecenter/fence_bladecenter.py @@ -103,6 +103,8 @@ def main(): if 0 == options.has_key("-c"): options["-c"] = "system>" + show_docs(options) + ## ## Operate the fencing device ###### diff --git a/fence/agents/cisco_mds/fence_cisco_mds.py b/fence/agents/cisco_mds/fence_cisco_mds.py index 0d57c04..67948e6 100644 --- a/fence/agents/cisco_mds/fence_cisco_mds.py +++ b/fence/agents/cisco_mds/fence_cisco_mds.py @@ -105,6 +105,8 @@ def main(): options = check_input(device_opt, options) + show_docs(options) + if (not (options["-o"] in ["list","monitor"])): port_oid=cisco_port2oid(options["-n"]) diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py index af4a1ed..b669bac 100755 --- a/fence/agents/drac/fence_drac5.py +++ b/fence/agents/drac/fence_drac5.py @@ -96,6 +96,8 @@ def main(): if 0 == options.has_key("-c"): options["-c"] = "\$" + show_docs(options) + ## ## Operate the fencing device ###### diff --git a/fence/agents/eps/fence_eps.py b/fence/agents/eps/fence_eps.py index f751d29..604a481 100644 --- a/fence/agents/eps/fence_eps.py +++ b/fence/agents/eps/fence_eps.py @@ -107,6 +107,8 @@ def main(): if (not options.has_key("-c")): options["-c"]="hidden.htm" + show_docs(options) + #Run fence action. Conn is None, beacause we always need open new http connection fence_action(None, options, set_power_status, get_power_status,get_power_status) diff --git a/fence/agents/ibmblade/fence_ibmblade.py b/fence/agents/ibmblade/fence_ibmblade.py index e6d0dac..7532221 100644 --- a/fence/agents/ibmblade/fence_ibmblade.py +++ b/fence/agents/ibmblade/fence_ibmblade.py @@ -69,6 +69,8 @@ def main(): options=check_input(device_opt,process_input(device_opt)) + show_docs(options) + # Operate the fencing device fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status) diff --git a/fence/agents/ifmib/fence_ifmib.py b/fence/agents/ifmib/fence_ifmib.py index 7473129..a6c452d 100644 --- a/fence/agents/ifmib/fence_ifmib.py +++ b/fence/agents/ifmib/fence_ifmib.py @@ -125,6 +125,8 @@ def main(): options = check_input(device_opt, options) + show_docs(options) + # Operate the fencing device fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status) diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py index c2fd70b..e15052d 100755 --- a/fence/agents/ilo/fence_ilo.py +++ b/fence/agents/ilo/fence_ilo.py @@ -65,6 +65,8 @@ def main(): options["-z"] = 1 LOGIN_TIMEOUT = 10 + show_docs(options) + ## ## Login and get version number #### diff --git a/fence/agents/intelmodular/fence_intelmodular.py b/fence/agents/intelmodular/fence_intelmodular.py index 6b68d0b..492bbc5 100644 --- a/fence/agents/intelmodular/fence_intelmodular.py +++ b/fence/agents/intelmodular/fence_intelmodular.py @@ -74,6 +74,8 @@ def main(): options=check_input(device_opt,process_input(device_opt)) + show_docs(options) + # Operate the fencing device fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status) diff --git a/fence/agents/ldom/fence_ldom.py b/fence/agents/ldom/fence_ldom.py index 021f036..e6bf656 100644 --- a/fence/agents/ldom/fence_ldom.py +++ b/fence/agents/ldom/fence_ldom.py @@ -98,6 +98,8 @@ def main(): options["-x"] = 1 + show_docs(options) + ## ## Operate the fencing device #### diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index feb01f8..3829ccc 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -481,20 +481,10 @@ def check_input(device_opt, opt): else: all_opt["login"]["required"] = "0" - ## Process special options (and exit) + ## In special cases (show help, metadata or version) we don't need to check anything ##### - if options.has_key("-h"): - usage(device_opt) - sys.exit(0) - - if options.has_key("-o") and options["-o"].lower() == "metadata": - metadata(device_opt) - sys.exit(0) - - if options.has_key("-V"): - print RELEASE_VERSION, BUILD_DATE - print REDHAT_COPYRIGHT - sys.exit(0) + if options.has_key("-h") or options.has_key("-V") or (options.has_key("-o") and options["-o"].lower() == "metadata"): + return options; ## Set default values ##### @@ -571,7 +561,27 @@ def wait_power_status(tn, options, get_power_fn): return 1 return 0 +def show_docs(options): + device_opt = options["device_opt"] + + ## Process special options (and exit) + ##### + if options.has_key("-h"): + usage(device_opt) + sys.exit(0) + + if options.has_key("-o") and options["-o"].lower() == "metadata": + metadata(device_opt) + sys.exit(0) + + if options.has_key("-V"): + print RELEASE_VERSION, BUILD_DATE + print REDHAT_COPYRIGHT + sys.exit(0) + def fence_action(tn, options, set_power_fn, get_power_fn, get_outlet_list = None): + ## Process options that manipulate fencing device + ##### if (options["-o"] == "list") and (0 == options["device_opt"].count("port")) and (0 == options["device_opt"].count("partition")): print "N/A" return diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index cb74f1d..f6e4a58 100644 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -140,13 +140,15 @@ def main(): options = check_input(device_opt, process_input(device_opt)) ## - ## Fence agent specific defaults + ## Fence agent specific settings and default values ##### if 0 == options.has_key("-c"): options["-c"] = [ ":~>", "]\$", "\$ " ] if 0 == options.has_key("-x"): fail_usage("Failed: You have to use ssh connection (-x) to fence device") + + show_docs(options) if 0 == options.has_key("-s"): fail_usage("Failed: You have to enter name of managed system") diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index dd2f579..9c33327 100644 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -55,6 +55,8 @@ def main(): # This device will not allow us to login even with LANG=C options["ssh_options"] = "-F /dev/null" + + show_docs(options) ## ## Operate the fencing device diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py index 6866fb0..038e903 100644 --- a/fence/agents/virsh/fence_virsh.py +++ b/fence/agents/virsh/fence_virsh.py @@ -77,6 +77,8 @@ def main(): options["ssh_options"]="-t '/bin/bash -c \"PS1=\[EXPECT\]#\ /bin/bash --noprofile --norc\"'" + show_docs(options) + ## Operate the fencing device conn = fence_login(options) fence_action(conn, options, set_power_status, get_power_status, get_outlets_status) diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py index 42dc097..10307c1 100644 --- a/fence/agents/vmware/fence_vmware.py +++ b/fence/agents/vmware/fence_vmware.py @@ -290,6 +290,8 @@ def main(): # Default is secure connection options["-x"] = 1 + show_docs(options) + # Check vmware type and set path vmware_check_vmware_type(options) diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 35b4d54..13c6b52 100644 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -88,6 +88,8 @@ def main(): if 0 == options.has_key("-c"): options["-c"] = [ "RSM>", "MPC>", "IPS>", "TPS>", "NBB>", "NPS>" ] + show_docs(options) + ## ## Operate the fencing device ## From marx@fedoraproject.org Mon Jul 13 15:06:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 13 Jul 2009 15:06:00 -0000 Subject: cluster: STABLE3 - fence_lpar: option -x for ssh was required Message-ID: <20090713150559.0CF301201FF@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8b932966fd7407b85b0b34ca71cb7471bbef8078 Commit: 8b932966fd7407b85b0b34ca71cb7471bbef8078 Parent: 634c700d5781476ed777266950bd84e4952fa4a9 Author: Marek 'marx' Grac AuthorDate: Mon Jul 13 16:59:59 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 13 16:59:59 2009 +0200 fence_lpar: option -x for ssh was required Option -x is no longer required for LPAR. It is turned on automatically. This should not change behaviour of fence agent as -x was required before and no other access to LPAR/HMC is supported. --- fence/agents/lib/fencing.py.py | 2 +- fence/agents/lpar/fence_lpar.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index eaff7a0..bd4c114 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -144,7 +144,7 @@ all_opt = { "hmc_version" : { "getopt" : "H:", "longopt" : "hmc-version", - "help" : "-H, --hmc-version= Force HMC version to use: 3, 4 (default)", + "help" : "-H, --hmc-version= Force HMC version to use: 3, 4 (default)", "required" : "0", "shortdesc" : "Force HMC version to use (3 or 4)", "default" : "4", diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index f6e4a58..aaaa65b 100644 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -138,6 +138,7 @@ def main(): atexit.register(atexit_handler) options = check_input(device_opt, process_input(device_opt)) + options["-x"] = 1 ## ## Fence agent specific settings and default values @@ -145,9 +146,6 @@ def main(): if 0 == options.has_key("-c"): options["-c"] = [ ":~>", "]\$", "\$ " ] - if 0 == options.has_key("-x"): - fail_usage("Failed: You have to use ssh connection (-x) to fence device") - show_docs(options) if 0 == options.has_key("-s"): From marx@fedoraproject.org Mon Jul 13 15:13:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 13 Jul 2009 15:13:00 -0000 Subject: cluster: RHEL5 - fence_lpar: option -x for ssh was required Message-ID: <20090713151322.D3FD61201FF@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9913f8ed7bf92f7e4ad306dd65c3b2ec7e815818 Commit: 9913f8ed7bf92f7e4ad306dd65c3b2ec7e815818 Parent: a06e21bd1c7fc0590f1734db650bf7b6c60594bb Author: Marek 'marx' Grac AuthorDate: Mon Jul 13 17:09:12 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 13 17:09:12 2009 +0200 fence_lpar: option -x for ssh was required Option -x is no longer required for LPAR. It is turned on automatically. This should not change behaviour of fence agent as -x was required before and no other access to LPAR/HMC is supported. --- fence/agents/lib/fencing.py.py | 2 +- fence/agents/lpar/fence_lpar.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 7aed327..ba8adae 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -109,7 +109,7 @@ all_opt = { "hmc_version" : { "getopt" : "H:", "longopt" : "hmc-version", - "help" : "-H, --hmc-version= Force HMC version to use: 3, 4 (default)", + "help" : "-H Force HMC version to use: 3, 4 (default)", "order" : 1 }, "ribcl" : { "getopt" : "r:", diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index 436d153..353ca06 100755 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -92,6 +92,7 @@ def main(): "cmd_prompt", "ipport" ] options = check_input(device_opt, process_input(device_opt)) + options["-x"] = 1 ## ## Fence agent specific defaults @@ -102,9 +103,6 @@ def main(): if 0 == options.has_key("-H"): options["-H"] = "4" - if 0 == options.has_key("-x"): - fail_usage("Failed: You have to use ssh connection (-x) to fence device") - if 0 == options.has_key("-s"): fail_usage("Failed: You have to enter name of managed system") From marx@fedoraproject.org Mon Jul 13 15:14:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 13 Jul 2009 15:14:00 -0000 Subject: cluster: RHEL4 - fence_lpar: option -x for ssh was required Message-ID: <20090713151426.B4F3E1201FF@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=b992279f3080cde3eb714cd202455fa7c7619f92 Commit: b992279f3080cde3eb714cd202455fa7c7619f92 Parent: dc3627fc32acc1e79f251a6aaab7b362920323aa Author: Marek 'marx' Grac AuthorDate: Mon Jul 13 17:09:12 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 13 17:10:45 2009 +0200 fence_lpar: option -x for ssh was required Option -x is no longer required for LPAR. It is turned on automatically. This should not change behaviour of fence agent as -x was required before and no other access to LPAR/HMC is supported. --- fence/agents/lib/fencing.py.py | 2 +- fence/agents/lpar/fence_lpar.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index fe9b64f..55b1b65 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -103,7 +103,7 @@ all_opt = { "hmc_version" : { "getopt" : "H:", "longopt" : "hmc-version", - "help" : "-H, --hmc-version= Force HMC version to use: 3, 4 (default)", + "help" : "-H Force HMC version to use: 3, 4 (default)", "order" : 1 }, "ribcl" : { "getopt" : "r:", diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index 4cf5c7c..680eab5 100755 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -91,6 +91,7 @@ def main(): "secure", "partition", "managed", "hmc_version", "cmd_prompt" ] options = check_input(device_opt, process_input(device_opt)) + options["-x"] = 1 ## ## Fence agent specific defaults @@ -101,9 +102,6 @@ def main(): if 0 == options.has_key("-H"): options["-H"] = "4" - if 0 == options.has_key("-x"): - fail_usage("Failed: You have to use ssh connection (-x) to fence device") - if 0 == options.has_key("-s"): fail_usage("Failed: You have to enter name of managed system") From marx@fedoraproject.org Mon Jul 13 15:15:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 13 Jul 2009 15:15:00 -0000 Subject: cluster: STABLE2 - fence_lpar: option -x for ssh was required Message-ID: <20090713151505.C0BDA1201FF@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=36fb115aedfb2cef7afab7b9f0855aadd1d1f619 Commit: 36fb115aedfb2cef7afab7b9f0855aadd1d1f619 Parent: 8956c953c63ff8d4b3c3cb8719a739862e21beb1 Author: Marek 'marx' Grac AuthorDate: Mon Jul 13 17:09:12 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 13 17:11:20 2009 +0200 fence_lpar: option -x for ssh was required Option -x is no longer required for LPAR. It is turned on automatically. This should not change behaviour of fence agent as -x was required before and no other access to LPAR/HMC is supported. --- fence/agents/lib/fencing.py.py | 2 +- fence/agents/lpar/fence_lpar.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index e8f89ec..4d41fcb 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -104,7 +104,7 @@ all_opt = { "hmc_version" : { "getopt" : "H:", "longopt" : "hmc-version", - "help" : "-H, --hmc-version= Force HMC version to use: 3, 4 (default)", + "help" : "-H Force HMC version to use: 3, 4 (default)", "order" : 1 }, "ribcl" : { "getopt" : "r:", diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index c20cde5..1990f42 100755 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -85,6 +85,7 @@ def main(): "cmd_prompt", "ipport" ] options = check_input(device_opt, process_input(device_opt)) + options["-x"] = 1 ## ## Fence agent specific defaults @@ -95,9 +96,6 @@ def main(): if 0 == options.has_key("-H"): options["-H"] = "4" - if 0 == options.has_key("-x"): - fail_usage("Failed: You have to use ssh connection (-x) to fence device") - if 0 == options.has_key("-s"): fail_usage("Failed: You have to enter name of managed system") From marx@fedoraproject.org Mon Jul 13 15:22:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 13 Jul 2009 15:22:00 -0000 Subject: fence-agents: master - fence_lpar: option -x for ssh was required Message-ID: <20090713151814.CC15D1201FF@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=7d3cd2d85b83662a6da8250c5aa7438f21f1b28f Commit: 7d3cd2d85b83662a6da8250c5aa7438f21f1b28f Parent: 122857accf9e20167c2fae3ef76f24979a0d0ca6 Author: Marek 'marx' Grac AuthorDate: Mon Jul 13 17:13:34 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 13 17:13:34 2009 +0200 fence_lpar: option -x for ssh was required Option -x is no longer required for LPAR. It is turned on automatically. This should not change behaviour of fence agent as -x was required before and no other access to LPAR/HMC is supported. --- fence/agents/lib/fencing.py.py | 2 +- fence/agents/lpar/fence_lpar.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index eaff7a0..bd4c114 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -144,7 +144,7 @@ all_opt = { "hmc_version" : { "getopt" : "H:", "longopt" : "hmc-version", - "help" : "-H, --hmc-version= Force HMC version to use: 3, 4 (default)", + "help" : "-H, --hmc-version= Force HMC version to use: 3, 4 (default)", "required" : "0", "shortdesc" : "Force HMC version to use (3 or 4)", "default" : "4", diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index d3c6f53..31a227f 100644 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -138,6 +138,7 @@ def main(): atexit.register(atexit_handler) options = check_input(device_opt, process_input(device_opt)) + options["-x"] = 1 ## ## Fence agent specific settings and default values @@ -145,9 +146,6 @@ def main(): if 0 == options.has_key("-c"): options["-c"] = [ ":~>", "]\$", "\$ " ] - if 0 == options.has_key("-x"): - fail_usage("Failed: You have to use ssh connection (-x) to fence device") - show_docs(options) if 0 == options.has_key("-s"): From rpeterso@fedoraproject.org Tue Jul 14 15:41:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Tue, 14 Jul 2009 15:41:00 -0000 Subject: cluster: RHEL5 - fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. Message-ID: <20090714154035.C499D120109@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c4344d672a442a24a176706ab3be71f8098dc33e Commit: c4344d672a442a24a176706ab3be71f8098dc33e Parent: 9913f8ed7bf92f7e4ad306dd65c3b2ec7e815818 Author: Bob Peterson AuthorDate: Tue Jul 14 10:40:03 2009 -0500 Committer: Bob Peterson CommitterDate: Tue Jul 14 10:40:03 2009 -0500 fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. bz 510758 This is a gfs2 crosswrite from gfs of commit 8df780b532e02acef7f0ebc0113cf96515a7a3b6 --- gfs2/fsck/metawalk.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c index 7c0570e..0730835 100644 --- a/gfs2/fsck/metawalk.c +++ b/gfs2/fsck/metawalk.c @@ -580,9 +580,11 @@ static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block, if(error > 0) { return 1; } - check_eattr_entries(ip, bh, pass, want_updated); - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass, want_updated); brelse(bh, *want_updated); + } + return error; } return 0; From rpeterso@fedoraproject.org Tue Jul 14 15:42:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Tue, 14 Jul 2009 15:42:00 -0000 Subject: cluster: RHEL54 - fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. Message-ID: <20090714154221.2A21C120109@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4478238a116b9c0720e88ff83e7f6cd8fde3c6ad Commit: 4478238a116b9c0720e88ff83e7f6cd8fde3c6ad Parent: 6cf7dbc393d206e56a14261af81b1aeeb5bb160a Author: Bob Peterson AuthorDate: Tue Jul 14 10:40:03 2009 -0500 Committer: Bob Peterson CommitterDate: Tue Jul 14 10:43:37 2009 -0500 fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. bz 510758 This is a gfs2 crosswrite from gfs of commit 8df780b532e02acef7f0ebc0113cf96515a7a3b6 --- gfs2/fsck/metawalk.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c index 7c0570e..0730835 100644 --- a/gfs2/fsck/metawalk.c +++ b/gfs2/fsck/metawalk.c @@ -580,9 +580,11 @@ static int check_leaf_eattr(struct gfs2_inode *ip, uint64_t block, if(error > 0) { return 1; } - check_eattr_entries(ip, bh, pass, want_updated); - if (bh) + if (bh) { + error = check_eattr_entries(ip, bh, pass, want_updated); brelse(bh, *want_updated); + } + return error; } return 0; From rpeterso@fedoraproject.org Sun Jul 19 04:41:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Sun, 19 Jul 2009 04:41:00 -0000 Subject: gfs2-utils: master - gfs2_edit produces unaligned access Message-ID: <20090719044144.31DCF120269@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=60d5d7cbd26888177653a766bd476c307b091074 Commit: 60d5d7cbd26888177653a766bd476c307b091074 Parent: 5305e878a987b90caf498f0bc5a92ae7ba8fa57d Author: Bob Peterson AuthorDate: Sat Jul 18 23:37:15 2009 -0500 Committer: Bob Peterson CommitterDate: Sat Jul 18 23:43:08 2009 -0500 gfs2_edit produces unaligned access bz 503530 --- gfs2/edit/hexedit.c | 5 ++--- gfs2/edit/savemeta.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index 5c66995..17d8d7d 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -800,9 +800,8 @@ static void rgcount(void) /* ------------------------------------------------------------------------ */ static uint64_t find_rgrp_block(struct gfs2_inode *dif, int rg) { - char fbuf[sizeof(struct gfs2_rindex)]; int amt; - struct gfs2_rindex ri; + struct gfs2_rindex fbuf, ri; uint64_t foffset, gfs1_adj = 0; foffset = rg * risize(); @@ -817,7 +816,7 @@ static uint64_t find_rgrp_block(struct gfs2_inode *dif, int rg) amt = gfs2_readi(dif, (void *)&fbuf, foffset + gfs1_adj, risize()); if (!amt) /* end of file */ return 0; - gfs2_rindex_in(&ri, fbuf); + gfs2_rindex_in(&ri, (void *)&fbuf); return ri.ri_addr; } diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c index d1b6984..fd7a29f 100644 --- a/gfs2/edit/savemeta.c +++ b/gfs2/edit/savemeta.c @@ -54,12 +54,13 @@ extern void read_superblock(void); */ static int get_gfs_struct_info(char *gbuf, int *block_type, int *gstruct_len) { - struct gfs2_meta_header mh; + struct gfs2_meta_header mh, mhbuf; *block_type = 0; *gstruct_len = sbd.bsize; - gfs2_meta_header_in(&mh, gbuf); + memcpy(&mhbuf, gbuf, sizeof(mhbuf)); + gfs2_meta_header_in(&mh, (void *)&mhbuf); if (mh.mh_magic != GFS2_MAGIC) return -1; @@ -784,7 +785,10 @@ static int restore_data(int fd, int in_fd, int printblocksonly) exit(-1); } if (first) { - gfs2_sb_in(&sbd.sd_sb, savedata->buf); + struct gfs2_sb bufsb; + + memcpy(&bufsb, savedata->buf, sizeof(bufsb)); + gfs2_sb_in(&sbd.sd_sb, (void *)&bufsb); sbd1 = (struct gfs_sb *)&sbd.sd_sb; if (sbd1->sb_fs_format == GFS_FORMAT_FS && sbd1->sb_header.mh_type == From rpeterso@fedoraproject.org Sun Jul 19 04:43:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Sun, 19 Jul 2009 04:43:00 -0000 Subject: cluster: STABLE2 - gfs2_edit produces unaligned access Message-ID: <20090719044328.A52C7120269@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a0145f6cdeb39bafc17a33645333ebdc2af5bd1b Commit: a0145f6cdeb39bafc17a33645333ebdc2af5bd1b Parent: 36fb115aedfb2cef7afab7b9f0855aadd1d1f619 Author: Bob Peterson AuthorDate: Sat Jul 18 22:44:31 2009 -0500 Committer: Bob Peterson CommitterDate: Sat Jul 18 22:47:21 2009 -0500 gfs2_edit produces unaligned access bz 503530 --- gfs2/edit/hexedit.c | 5 ++--- gfs2/edit/savemeta.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index 911f75d..51be25a 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -857,9 +857,8 @@ void rgcount(void) /* ------------------------------------------------------------------------ */ uint64_t find_rgrp_block(struct gfs2_inode *di, int rg) { - char buf[sizeof(struct gfs2_rindex)]; int amt; - struct gfs2_rindex ri; + struct gfs2_rindex buf, ri; uint64_t offset, gfs1_adj = 0; offset = rg * risize(); @@ -874,7 +873,7 @@ uint64_t find_rgrp_block(struct gfs2_inode *di, int rg) amt = gfs2_readi(di, (void *)&buf, offset + gfs1_adj, risize()); if (!amt) /* end of file */ return 0; - gfs2_rindex_in(&ri, buf); + gfs2_rindex_in(&ri, (void *)&buf); return ri.ri_addr; } diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c index 6cb9f39..76f37ab 100644 --- a/gfs2/edit/savemeta.c +++ b/gfs2/edit/savemeta.c @@ -54,12 +54,13 @@ uint64_t masterblock(const char *fn); */ int get_gfs_struct_info(char *buf, int *block_type, int *struct_len) { - struct gfs2_meta_header mh; + struct gfs2_meta_header mh, mhbuf; *block_type = 0; *struct_len = sbd.bsize; - gfs2_meta_header_in(&mh, buf); + memcpy(&mhbuf, buf, sizeof(mhbuf)); + gfs2_meta_header_in(&mh, (void *)&mhbuf); if (mh.mh_magic != GFS2_MAGIC) return -1; @@ -723,7 +724,10 @@ int restore_data(int fd, int in_fd, int printblocksonly) do_read(in_fd, savedata->buf, savedata->siglen); if (first) { - gfs2_sb_in(&sbd.sd_sb, savedata->buf); + struct gfs2_sb bufsb; + + memcpy(&bufsb, savedata->buf, sizeof(bufsb)); + gfs2_sb_in(&sbd.sd_sb, (void *)&bufsb); sbd1 = (struct gfs_sb *)&sbd.sd_sb; if (sbd1->sb_fs_format == GFS_FORMAT_FS && sbd1->sb_header.mh_type == From rpeterso@fedoraproject.org Sun Jul 19 04:43:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Sun, 19 Jul 2009 04:43:00 -0000 Subject: cluster: STABLE3 - gfs2_edit produces unaligned access Message-ID: <20090719044307.2D16E120269@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=abfc1f6194474c3d218e340c7c3bf1a8d246fcdb Commit: abfc1f6194474c3d218e340c7c3bf1a8d246fcdb Parent: 8b932966fd7407b85b0b34ca71cb7471bbef8078 Author: Bob Peterson AuthorDate: Sat Jul 18 23:37:15 2009 -0500 Committer: Bob Peterson CommitterDate: Sat Jul 18 23:37:15 2009 -0500 gfs2_edit produces unaligned access bz 503530 --- gfs2/edit/hexedit.c | 5 ++--- gfs2/edit/savemeta.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index b774ead..ff449e9 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -798,9 +798,8 @@ static void rgcount(void) /* ------------------------------------------------------------------------ */ static uint64_t find_rgrp_block(struct gfs2_inode *dif, int rg) { - char fbuf[sizeof(struct gfs2_rindex)]; int amt; - struct gfs2_rindex ri; + struct gfs2_rindex fbuf, ri; uint64_t foffset, gfs1_adj = 0; foffset = rg * risize(); @@ -815,7 +814,7 @@ static uint64_t find_rgrp_block(struct gfs2_inode *dif, int rg) amt = gfs2_readi(dif, (void *)&fbuf, foffset + gfs1_adj, risize()); if (!amt) /* end of file */ return 0; - gfs2_rindex_in(&ri, fbuf); + gfs2_rindex_in(&ri, (void *)&fbuf); return ri.ri_addr; } diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c index ee5ff04..243ee49 100644 --- a/gfs2/edit/savemeta.c +++ b/gfs2/edit/savemeta.c @@ -52,12 +52,13 @@ extern void read_superblock(void); */ static int get_gfs_struct_info(char *gbuf, int *block_type, int *gstruct_len) { - struct gfs2_meta_header mh; + struct gfs2_meta_header mh, mhbuf; *block_type = 0; *gstruct_len = sbd.bsize; - gfs2_meta_header_in(&mh, gbuf); + memcpy(&mhbuf, gbuf, sizeof(mhbuf)); + gfs2_meta_header_in(&mh, (void *)&mhbuf); if (mh.mh_magic != GFS2_MAGIC) return -1; @@ -782,7 +783,10 @@ static int restore_data(int fd, int in_fd, int printblocksonly) exit(-1); } if (first) { - gfs2_sb_in(&sbd.sd_sb, savedata->buf); + struct gfs2_sb bufsb; + + memcpy(&bufsb, savedata->buf, sizeof(bufsb)); + gfs2_sb_in(&sbd.sd_sb, (void *)&bufsb); sbd1 = (struct gfs_sb *)&sbd.sd_sb; if (sbd1->sb_fs_format == GFS_FORMAT_FS && sbd1->sb_header.mh_type == From rpeterso@fedoraproject.org Sun Jul 19 04:44:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Sun, 19 Jul 2009 04:44:00 -0000 Subject: cluster: RHEL5 - gfs2_edit produces unaligned access Message-ID: <20090719044400.677BB120269@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=3a7d9047ac8192bd621dfc8ef22918070faafb67 Commit: 3a7d9047ac8192bd621dfc8ef22918070faafb67 Parent: c4344d672a442a24a176706ab3be71f8098dc33e Author: Bob Peterson AuthorDate: Sat Jul 18 22:44:31 2009 -0500 Committer: Bob Peterson CommitterDate: Sat Jul 18 22:44:31 2009 -0500 gfs2_edit produces unaligned access bz 503530 --- gfs2/edit/hexedit.c | 5 ++--- gfs2/edit/savemeta.c | 10 +++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index 38274c2..5937663 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -872,9 +872,8 @@ void rgcount(void) /* ------------------------------------------------------------------------ */ uint64_t find_rgrp_block(struct gfs2_inode *di, int rg) { - char buf[sizeof(struct gfs2_rindex)]; int amt; - struct gfs2_rindex ri; + struct gfs2_rindex buf, ri; uint64_t offset, gfs1_adj = 0; offset = rg * risize(); @@ -889,7 +888,7 @@ uint64_t find_rgrp_block(struct gfs2_inode *di, int rg) amt = gfs2_readi(di, (void *)&buf, offset + gfs1_adj, risize()); if (!amt) /* end of file */ return 0; - gfs2_rindex_in(&ri, buf); + gfs2_rindex_in(&ri, (void *)&buf); return ri.ri_addr; } diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c index 3a058fb..01d2bc3 100644 --- a/gfs2/edit/savemeta.c +++ b/gfs2/edit/savemeta.c @@ -66,12 +66,13 @@ uint64_t masterblock(const char *fn); */ int get_gfs_struct_info(char *buf, int *block_type, int *struct_len) { - struct gfs2_meta_header mh; + struct gfs2_meta_header mh, mhbuf; *block_type = 0; *struct_len = sbd.bsize; - gfs2_meta_header_in(&mh, buf); + memcpy(&mhbuf, buf, sizeof(mhbuf)); + gfs2_meta_header_in(&mh, (void *)&mhbuf); if (mh.mh_magic != GFS2_MAGIC) return -1; @@ -736,7 +737,10 @@ int restore_data(int fd, int in_fd, int printblocksonly) do_read(in_fd, savedata->buf, savedata->siglen); if (first) { - gfs2_sb_in(&sbd.sd_sb, savedata->buf); + struct gfs2_sb bufsb; + + memcpy(&bufsb, savedata->buf, sizeof(bufsb)); + gfs2_sb_in(&sbd.sd_sb, (void *)&bufsb); sbd1 = (struct gfs_sb *)&sbd.sd_sb; if (sbd1->sb_fs_format == GFS_FORMAT_FS && sbd1->sb_header.mh_type == From marx@fedoraproject.org Mon Jul 20 13:51:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 20 Jul 2009 13:51:00 -0000 Subject: cluster: RHEL4 - fencing: #510335 - Fencing fails if telnet/ssh is not available Message-ID: <20090720135120.3D4291201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=770a87c873cb64d9e08425f9ffaf9c598effa113 Commit: 770a87c873cb64d9e08425f9ffaf9c598effa113 Parent: b992279f3080cde3eb714cd202455fa7c7619f92 Author: Marek 'marx' Grac AuthorDate: Mon Jul 20 15:46:11 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 20 15:46:11 2009 +0200 fencing: #510335 - Fencing fails if telnet/ssh is not available --- fence/agents/lib/fencing.py.py | 37 +++++++++++++++++++++++++++++++++---- fence/agents/wti/fence_wti.py | 9 ++++++++- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 55b1b65..0210ec3 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -22,6 +22,7 @@ LOGIN_TIMEOUT = 5 LOG_MODE_VERBOSE = 100 LOG_MODE_QUIET = 0 +EC_GENERIC_ERROR = 1 EC_BAD_ARGS = 2 EC_LOGIN_DENIED = 3 EC_CONNECTION_LOST = 4 @@ -377,12 +378,24 @@ def fence_login(options): if options.has_key("-z"): command = '%s %s %s' % (SSL_PATH, options["-a"], "443") - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + ## SSL telnet is part of the fencing package + sys.stderr.write(str(ex) + "\n") + sys.exit(EC_GENERIC_ERROR) elif options.has_key("-x") and 0 == options.has_key("-k"): command = '%s %s@%s' % (SSH_PATH, options["-l"], options["-a"]) if options.has_key("ssh_options"): command += ' ' + options["ssh_options"] - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + result = conn.log_expect(options, [ "ssword:", "Are you sure you want to continue connecting (yes/no)?" ], LOGIN_TIMEOUT) if result == 1: conn.sendline("yes") @@ -390,7 +403,15 @@ def fence_login(options): conn.sendline(options["-p"]) conn.log_expect(options, options["-c"], LOGIN_TIMEOUT) elif options.has_key("-x") and 1 == options.has_key("-k"): - conn = fspawn('%s %s@%s -i %s' % (SSH_PATH, options["-l"], options["-a"], options["-k"])) + command = '%s %s@%s -i %s' % (SSH_PATH, options["-l"], options["-a"], options["-k"]) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + result = conn.log_expect(options, [ options["-c"], "Are you sure you want to continue connecting (yes/no)?", "Enter passphrase for key '"+options["-k"]+"':" ], LOGIN_TIMEOUT) if result == 1: conn.sendline("yes") @@ -402,7 +423,15 @@ def fence_login(options): else: fail_usage("Failed: You have to enter passphrase (-p) for identity file") else: - conn = fspawn('%s %s' % (TELNET_PATH, options["-a"])) + command = '%s %s' % (TELNET_PATH, options["-a"]) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + conn.log_expect(options, re_login, LOGIN_TIMEOUT) conn.send(options["-l"]+"\r\n") conn.log_expect(options, re_pass, SHELL_TIMEOUT) diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 6335df7..f04f645 100755 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -86,7 +86,14 @@ def main(): ##### if 0 == options.has_key("-x"): try: - conn = fspawn ('telnet ' + options["-a"]) + try: + conn = fspawn('%s %s' % (TELNET_PATH, options["-a"])) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_prompt = re.compile("|".join(map (lambda x: "(" + x + ")", options["-c"])), re.IGNORECASE) From marx@fedoraproject.org Mon Jul 20 14:37:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 20 Jul 2009 14:37:00 -0000 Subject: cluster: RHEL5 - fencing: #510335 - Fencing fails if telnet/ssh is not available Message-ID: <20090720143734.6B0EC1201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=405b0dfc7f2c6956560b19e99b6441b24983afbc Commit: 405b0dfc7f2c6956560b19e99b6441b24983afbc Parent: 3a7d9047ac8192bd621dfc8ef22918070faafb67 Author: Marek 'marx' Grac AuthorDate: Mon Jul 20 16:05:51 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 20 16:05:51 2009 +0200 fencing: #510335 - Fencing fails if telnet/ssh is not available --- fence/agents/lib/fencing.py.py | 41 ++++++++++++++++++++++++++++++++++----- fence/agents/wti/fence_wti.py | 9 +++++++- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index ba8adae..8175048 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -22,6 +22,7 @@ LOGIN_TIMEOUT = 5 LOG_MODE_VERBOSE = 100 LOG_MODE_QUIET = 0 +EC_GENERIC_ERROR = 1 EC_BAD_ARGS = 2 EC_LOGIN_DENIED = 3 EC_CONNECTION_LOST = 4 @@ -459,12 +460,24 @@ def fence_login(options): if options.has_key("-z"): command = '%s %s %s' % (SSL_PATH, options["-a"], options["-u"]) - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + ## SSL telnet is part of the fencing package + sys.stderr.write(str(ex) + "\n") + sys.exit(EC_GENERIC_ERROR) elif options.has_key("-x") and 0 == options.has_key("-k"): command = '%s %s@%s -p %s' % (SSH_PATH, options["-l"], options["-a"], options["-u"]) if options.has_key("ssh_options"): command += ' ' + options["ssh_options"] - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + result = conn.log_expect(options, [ "ssword:", "Are you sure you want to continue connecting (yes/no)?" ], LOGIN_TIMEOUT) if result == 1: conn.sendline("yes") @@ -472,7 +485,15 @@ def fence_login(options): conn.sendline(options["-p"]) conn.log_expect(options, options["-c"], LOGIN_TIMEOUT) elif options.has_key("-x") and 1 == options.has_key("-k"): - conn = fspawn('%s %s@%s -i %s -p %s' % (SSH_PATH, options["-l"], options["-a"], options["-k"], options["-u"])) + command = '%s %s@%s -i %s -p %s' % (SSH_PATH, options["-l"], options["-a"], options["-k"], options["-u"]) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + result = conn.log_expect(options, [ options["-c"], "Are you sure you want to continue connecting (yes/no)?", "Enter passphrase for key '"+options["-k"]+"':" ], LOGIN_TIMEOUT) if result == 1: conn.sendline("yes") @@ -484,9 +505,17 @@ def fence_login(options): else: fail_usage("Failed: You have to enter passphrase (-p) for identity file") else: - conn = fspawn(TELNET_PATH) - conn.send("set binary\n") - conn.send("open %s -%s\n"%(options["-a"], options["-u"])) + command = '%s %s' % (TELNET_PATH, options["-a"]) + try: + conn = fspawn(TELNET_PATH) + conn.send("set binary\n") + conn.send("open %s -%s\n"%(options["-a"], options["-u"])) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + conn.log_expect(options, re_login, LOGIN_TIMEOUT) conn.send(options["-l"]+"\r\n") conn.log_expect(options, re_pass, SHELL_TIMEOUT) diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 4a5c758..4d9f6b2 100755 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -86,7 +86,14 @@ def main(): ##### if 0 == options.has_key("-x"): try: - conn = fspawn ('telnet ' + options["-a"]) + try: + conn = fspawn('%s %s' % (TELNET_PATH, options["-a"])) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_prompt = re.compile("|".join(map (lambda x: "(" + x + ")", options["-c"])), re.IGNORECASE) From marx@fedoraproject.org Mon Jul 20 14:53:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 20 Jul 2009 14:53:00 -0000 Subject: cluster: STABLE2 - fencing: #510335 - Fencing fails if telnet/ssh is not available Message-ID: <20090720145143.69AEB1201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2e6f9172df430a052bc2ac79aa81809d693cf347 Commit: 2e6f9172df430a052bc2ac79aa81809d693cf347 Parent: a0145f6cdeb39bafc17a33645333ebdc2af5bd1b Author: Marek 'marx' Grac AuthorDate: Mon Jul 20 16:46:30 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 20 16:46:30 2009 +0200 fencing: #510335 - Fencing fails if telnet/ssh is not available --- fence/agents/lib/fencing.py.py | 39 ++++++++++++++++++++++++++++++++------- fence/agents/wti/fence_wti.py | 9 ++++++++- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 4d41fcb..25d1e14 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -18,6 +18,7 @@ LOGIN_TIMEOUT = 5 LOG_MODE_VERBOSE = 100 LOG_MODE_QUIET = 0 +EC_GENERIC_ERROR = 1 EC_BAD_ARGS = 2 EC_LOGIN_DENIED = 3 EC_CONNECTION_LOST = 4 @@ -456,13 +457,24 @@ def fence_login(options): if options.has_key("-z"): command = '%s %s %s' % (SSL_PATH, options["-a"], options["-u"]) - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + ## SSL telnet is part of the fencing package + sys.stderr.write(str(ex) + "\n") + sys.exit(EC_GENERIC_ERROR) elif options.has_key("-x") and 0 == options.has_key("-k"): command = '%s %s@%s -p %s' % (SSH_PATH, options["-l"], options["-a"], options["-u"]) if options.has_key("ssh_options"): command += ' ' + options["ssh_options"] - conn = fspawn(command) - + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + if options.has_key("telnet_over_ssh"): #This is for stupid ssh servers (like ALOM) which behave more like telnet (ignore name and display login prompt) result = conn.log_expect(options, [ re_login, "Are you sure you want to continue connecting (yes/no)?" ], LOGIN_TIMEOUT) @@ -484,7 +496,13 @@ def fence_login(options): command = '%s %s@%s -i %s -p %s' % (SSH_PATH, options["-l"], options["-a"], options["-k"], options["-u"]) if options.has_key("ssh_options"): command += ' ' + options["ssh_options"] - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) result = conn.log_expect(options, [ options["-c"], "Are you sure you want to continue connecting (yes/no)?", "Enter passphrase for key '"+options["-k"]+"':" ], LOGIN_TIMEOUT) if result == 1: @@ -497,9 +515,16 @@ def fence_login(options): else: fail_usage("Failed: You have to enter passphrase (-p) for identity file") else: - conn = fspawn(TELNET_PATH) - conn.send("set binary\n") - conn.send("open %s -%s\n"%(options["-a"], options["-u"])) + try: + conn = fspawn(TELNET_PATH) + conn.send("set binary\n") + conn.send("open %s -%s\n"%(options["-a"], options["-u"])) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + conn.log_expect(options, re_login, LOGIN_TIMEOUT) conn.send(options["-l"]+"\r\n") conn.log_expect(options, re_pass, SHELL_TIMEOUT) diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 30b41a1..814f27a 100644 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -85,7 +85,14 @@ def main(): ##### if 0 == options.has_key("-x"): try: - conn = fspawn ('telnet ' + options["-a"]) + try: + conn = fspawn('%s %s' % (TELNET_PATH, options["-a"])) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_prompt = re.compile("|".join(map (lambda x: "(" + x + ")", options["-c"])), re.IGNORECASE) From marx@fedoraproject.org Mon Jul 20 14:56:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 20 Jul 2009 14:56:00 -0000 Subject: cluster: STABLE3 - fencing: Fencing fails if telnet/ssh is not available Message-ID: <20090720145605.52B2F1201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=11996d184948d4becf3de29568ea1520e24b2cc3 Commit: 11996d184948d4becf3de29568ea1520e24b2cc3 Parent: abfc1f6194474c3d218e340c7c3bf1a8d246fcdb Author: Marek 'marx' Grac AuthorDate: Mon Jul 20 16:51:23 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 20 16:51:23 2009 +0200 fencing: Fencing fails if telnet/ssh is not available bz#512343 --- fence/agents/lib/fencing.py.py | 39 ++++++++++++++++++++++++++++++++------- fence/agents/wti/fence_wti.py | 9 ++++++++- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index bd4c114..6a2e8b3 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -19,6 +19,7 @@ LOGIN_TIMEOUT = 5 LOG_MODE_VERBOSE = 100 LOG_MODE_QUIET = 0 +EC_GENERIC_ERROR = 1 EC_BAD_ARGS = 2 EC_LOGIN_DENIED = 3 EC_CONNECTION_LOST = 4 @@ -706,13 +707,24 @@ def fence_login(options): if options.has_key("-z"): command = '%s %s %s %s' % (SSL_PATH, force_ipvx, options["-a"], options["-u"]) - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + ## SSL telnet is part of the fencing package + sys.stderr.write(str(ex) + "\n") + sys.exit(EC_GENERIC_ERROR) elif options.has_key("-x") and 0 == options.has_key("-k"): command = '%s %s %s@%s -p %s' % (SSH_PATH, force_ipvx, options["-l"], options["-a"], options["-u"]) if options.has_key("ssh_options"): command += ' ' + options["ssh_options"] - conn = fspawn(command) - + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + if options.has_key("telnet_over_ssh"): #This is for stupid ssh servers (like ALOM) which behave more like telnet (ignore name and display login prompt) result = conn.log_expect(options, [ re_login, "Are you sure you want to continue connecting (yes/no)?" ], LOGIN_TIMEOUT) @@ -734,7 +746,13 @@ def fence_login(options): command = '%s %s %s@%s -i %s -p %s' % (SSH_PATH, force_ipvx, options["-l"], options["-a"], options["-k"], options["-u"]) if options.has_key("ssh_options"): command += ' ' + options["ssh_options"] - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) result = conn.log_expect(options, [ options["-c"], "Are you sure you want to continue connecting (yes/no)?", "Enter passphrase for key '"+options["-k"]+"':" ], LOGIN_TIMEOUT) if result == 1: @@ -747,9 +765,16 @@ def fence_login(options): else: fail_usage("Failed: You have to enter passphrase (-p) for identity file") else: - conn = fspawn(TELNET_PATH) - conn.send("set binary\n") - conn.send("open %s -%s\n"%(options["-a"], options["-u"])) + try: + conn = fspawn(TELNET_PATH) + conn.send("set binary\n") + conn.send("open %s -%s\n"%(options["-a"], options["-u"])) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + conn.log_expect(options, re_login, LOGIN_TIMEOUT) conn.send(options["-l"]+"\r\n") conn.log_expect(options, re_pass, SHELL_TIMEOUT) diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 13c6b52..5326e6d 100644 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -97,7 +97,14 @@ def main(): ##### if 0 == options.has_key("-x"): try: - conn = fspawn ('telnet ' + options["-a"]) + try: + conn = fspawn('%s %s' % (TELNET_PATH, options["-a"])) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_prompt = re.compile("|".join(map (lambda x: "(" + x + ")", options["-c"])), re.IGNORECASE) From marx@fedoraproject.org Mon Jul 20 14:59:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 20 Jul 2009 14:59:00 -0000 Subject: fence-agents: master - fencing: #512343 - Fencing fails if telnet/ssh is not available Message-ID: <20090720145901.61D401201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=06a1e2735127c38b5d28875f881ec8f8cac47879 Commit: 06a1e2735127c38b5d28875f881ec8f8cac47879 Parent: 7d3cd2d85b83662a6da8250c5aa7438f21f1b28f Author: Marek 'marx' Grac AuthorDate: Mon Jul 20 16:54:09 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Jul 20 16:54:09 2009 +0200 fencing: #512343 - Fencing fails if telnet/ssh is not available --- fence/agents/lib/fencing.py.py | 39 ++++++++++++++++++++++++++++++++------- fence/agents/wti/fence_wti.py | 9 ++++++++- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index bd4c114..6a2e8b3 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -19,6 +19,7 @@ LOGIN_TIMEOUT = 5 LOG_MODE_VERBOSE = 100 LOG_MODE_QUIET = 0 +EC_GENERIC_ERROR = 1 EC_BAD_ARGS = 2 EC_LOGIN_DENIED = 3 EC_CONNECTION_LOST = 4 @@ -706,13 +707,24 @@ def fence_login(options): if options.has_key("-z"): command = '%s %s %s %s' % (SSL_PATH, force_ipvx, options["-a"], options["-u"]) - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + ## SSL telnet is part of the fencing package + sys.stderr.write(str(ex) + "\n") + sys.exit(EC_GENERIC_ERROR) elif options.has_key("-x") and 0 == options.has_key("-k"): command = '%s %s %s@%s -p %s' % (SSH_PATH, force_ipvx, options["-l"], options["-a"], options["-u"]) if options.has_key("ssh_options"): command += ' ' + options["ssh_options"] - conn = fspawn(command) - + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + if options.has_key("telnet_over_ssh"): #This is for stupid ssh servers (like ALOM) which behave more like telnet (ignore name and display login prompt) result = conn.log_expect(options, [ re_login, "Are you sure you want to continue connecting (yes/no)?" ], LOGIN_TIMEOUT) @@ -734,7 +746,13 @@ def fence_login(options): command = '%s %s %s@%s -i %s -p %s' % (SSH_PATH, force_ipvx, options["-l"], options["-a"], options["-k"], options["-u"]) if options.has_key("ssh_options"): command += ' ' + options["ssh_options"] - conn = fspawn(command) + try: + conn = fspawn(command) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) result = conn.log_expect(options, [ options["-c"], "Are you sure you want to continue connecting (yes/no)?", "Enter passphrase for key '"+options["-k"]+"':" ], LOGIN_TIMEOUT) if result == 1: @@ -747,9 +765,16 @@ def fence_login(options): else: fail_usage("Failed: You have to enter passphrase (-p) for identity file") else: - conn = fspawn(TELNET_PATH) - conn.send("set binary\n") - conn.send("open %s -%s\n"%(options["-a"], options["-u"])) + try: + conn = fspawn(TELNET_PATH) + conn.send("set binary\n") + conn.send("open %s -%s\n"%(options["-a"], options["-u"])) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + conn.log_expect(options, re_login, LOGIN_TIMEOUT) conn.send(options["-l"]+"\r\n") conn.log_expect(options, re_pass, SHELL_TIMEOUT) diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 13c6b52..5326e6d 100644 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -97,7 +97,14 @@ def main(): ##### if 0 == options.has_key("-x"): try: - conn = fspawn ('telnet ' + options["-a"]) + try: + conn = fspawn('%s %s' % (TELNET_PATH, options["-a"])) + except pexpect.ExceptionPexpect, ex: + sys.stderr.write(str(ex) + "\n") + sys.stderr.write("Due to limitations, binary dependencies on fence agents " + "are not in the spec file and must be installed separately." + "\n") + sys.exit(EC_GENERIC_ERROR) + re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_prompt = re.compile("|".join(map (lambda x: "(" + x + ")", options["-c"])), re.IGNORECASE) From marx@fedoraproject.org Tue Jul 21 12:50:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Tue, 21 Jul 2009 12:50:00 -0000 Subject: cluster: STABLE3 - fencing.py: Adds device option login_eol_lf Message-ID: <20090721124955.7B6171201B5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=43371def0f66c4d026342b2beac015bb4cd2f5c4 Commit: 43371def0f66c4d026342b2beac015bb4cd2f5c4 Parent: 11996d184948d4becf3de29568ea1520e24b2cc3 Author: Marek 'marx' Grac AuthorDate: Tue Jul 21 14:43:53 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Tue Jul 21 14:43:53 2009 +0200 fencing.py: Adds device option login_eol_lf This option is used for login method using telnet. By default most of the fence agents work with username\r\n but on some devices (e.g. HP iLO MP, sanbox2) it is interpreted as there is empty password. --- fence/agents/lib/fencing.py.py | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 6a2e8b3..2d0205d 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -157,6 +157,11 @@ all_opt = { "required" : "0", "shortdesc" : "Force ribcl version to use", "order" : 1 }, + "login_eol_lf" : { + "getopt" : "", + "help" : "", + "order" : 1 + }, "cmd_prompt" : { "getopt" : "c:", "longopt" : "command-prompt", @@ -701,6 +706,11 @@ def fence_login(options): if (options.has_key("-4")): force_ipvx="-4 " + if (options["device_opt"].count("login_eol_lf")): + login_eol = "\n" + else: + login_eol = "\r\n" + try: re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_pass = re.compile("password", re.IGNORECASE) @@ -776,9 +786,9 @@ def fence_login(options): sys.exit(EC_GENERIC_ERROR) conn.log_expect(options, re_login, LOGIN_TIMEOUT) - conn.send(options["-l"]+"\r\n") + conn.send(options["-l"] + login_eol) conn.log_expect(options, re_pass, SHELL_TIMEOUT) - conn.send(options["-p"]+"\r\n") + conn.send(options["-p"] + login_eol) conn.log_expect(options, options["-c"], SHELL_TIMEOUT) except pexpect.EOF: fail(EC_LOGIN_DENIED) From marx@fedoraproject.org Tue Jul 21 12:53:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Tue, 21 Jul 2009 12:53:00 -0000 Subject: cluster: STABLE2 - fencing.py: Adds device option login_eol_lf Message-ID: <20090721125251.B46841201B5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5914d7c1d984b5e8352474ca0950be2c533000a4 Commit: 5914d7c1d984b5e8352474ca0950be2c533000a4 Parent: 2e6f9172df430a052bc2ac79aa81809d693cf347 Author: Marek 'marx' Grac AuthorDate: Tue Jul 21 14:48:51 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Tue Jul 21 14:48:51 2009 +0200 fencing.py: Adds device option login_eol_lf This option is used for login method using telnet. By default most of the fence agents work with username\r\n but on some devices (e.g. HP iLO MP, sanbox2) it is interpreted as there is empty password. --- fence/agents/lib/fencing.py.py | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 25d1e14..57bc246 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -111,6 +111,11 @@ all_opt = { "getopt" : "r:", "help" : "-r Force ribcl version to use", "order" : 1 }, + "login_eol_lf" : { + "getopt" : "", + "help" : "", + "order" : 1 + }, "cmd_prompt" : { "getopt" : "c:", "help" : "-c Force command prompt", @@ -451,6 +456,11 @@ def fence_action(tn, options, set_power_fn, get_power_fn): print "Status: " + status.upper() def fence_login(options): + if (options["device_opt"].count("login_eol_lf")): + login_eol = "\n" + else: + login_eol = "\r\n" + try: re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_pass = re.compile("password", re.IGNORECASE) @@ -526,9 +536,9 @@ def fence_login(options): sys.exit(EC_GENERIC_ERROR) conn.log_expect(options, re_login, LOGIN_TIMEOUT) - conn.send(options["-l"]+"\r\n") + conn.send(options["-l"] + login_eol) conn.log_expect(options, re_pass, SHELL_TIMEOUT) - conn.send(options["-p"]+"\r\n") + conn.send(options["-p"] + login_eol) conn.log_expect(options, options["-c"], SHELL_TIMEOUT) except pexpect.EOF: fail(EC_LOGIN_DENIED) From marx@fedoraproject.org Tue Jul 21 12:59:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Tue, 21 Jul 2009 12:59:00 -0000 Subject: cluster: RHEL4 - fencing.py: Adds device option login_eol_lf Message-ID: <20090721125858.3F8EF1201B5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ff9305a4c0522fdf4ec71d4516fc8f1b3070d4af Commit: ff9305a4c0522fdf4ec71d4516fc8f1b3070d4af Parent: 770a87c873cb64d9e08425f9ffaf9c598effa113 Author: Marek 'marx' Grac AuthorDate: Tue Jul 21 14:48:51 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Tue Jul 21 14:52:21 2009 +0200 fencing.py: Adds device option login_eol_lf This option is used for login method using telnet. By default most of the fence agents work with username\r\n but on some devices (e.g. HP iLO MP, sanbox2) it is interpreted as there is empty password. Needed for bz#510279 (sanbox2) and #512941 (fence_ilo-mp) --- fence/agents/lib/fencing.py.py | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 0210ec3..3e9bfd4 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -110,6 +110,11 @@ all_opt = { "getopt" : "r:", "help" : "-r Force ribcl version to use", "order" : 1 }, + "login_eol_lf" : { + "getopt" : "", + "help" : "", + "order" : 1 + }, "cmd_prompt" : { "getopt" : "c:", "help" : "-c Force command prompt", @@ -372,6 +377,11 @@ def fence_action(tn, options, set_power_fn, get_power_fn): print "Status: " + status.upper() def fence_login(options): + if (options["device_opt"].count("login_eol_lf")): + login_eol = "\n" + else: + login_eol = "\r\n" + try: re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_pass = re.compile("password", re.IGNORECASE) @@ -433,9 +443,9 @@ def fence_login(options): sys.exit(EC_GENERIC_ERROR) conn.log_expect(options, re_login, LOGIN_TIMEOUT) - conn.send(options["-l"]+"\r\n") + conn.send(options["-l"] + login_eol) conn.log_expect(options, re_pass, SHELL_TIMEOUT) - conn.send(options["-p"]+"\r\n") + conn.send(options["-p"] + login_eol) conn.log_expect(options, options["-c"], SHELL_TIMEOUT) except pexpect.EOF: fail(EC_LOGIN_DENIED) From marx@fedoraproject.org Tue Jul 21 13:02:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Tue, 21 Jul 2009 13:02:00 -0000 Subject: cluster: RHEL5 - fencing.py: Adds device option login_eol_lf Message-ID: <20090721130140.45D181201B5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c0a0ac5b6358a0f641a1d5e739307e7957e7ba6a Commit: c0a0ac5b6358a0f641a1d5e739307e7957e7ba6a Parent: 405b0dfc7f2c6956560b19e99b6441b24983afbc Author: Marek 'marx' Grac AuthorDate: Tue Jul 21 14:48:51 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Tue Jul 21 14:55:44 2009 +0200 fencing.py: Adds device option login_eol_lf This option is used for login method using telnet. By default most of the fence agents work with username\r\n but on some devices (e.g. HP iLO MP, sanbox2) it is interpreted as there is empty password. Needed for bz#512947 (sanbox2) and #508722 (fence_ilo-mp) --- fence/agents/lib/fencing.py.py | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 8175048..480150b 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -116,6 +116,11 @@ all_opt = { "getopt" : "r:", "help" : "-r Force ribcl version to use", "order" : 1 }, + "login_eol_lf" : { + "getopt" : "", + "help" : "", + "order" : 1 + }, "cmd_prompt" : { "getopt" : "c:", "help" : "-c Force command prompt", @@ -454,6 +459,11 @@ def fence_action(tn, options, set_power_fn, get_power_fn): print "Status: " + status.upper() def fence_login(options): + if (options["device_opt"].count("login_eol_lf")): + login_eol = "\n" + else: + login_eol = "\r\n" + try: re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_pass = re.compile("password", re.IGNORECASE) @@ -517,9 +527,9 @@ def fence_login(options): sys.exit(EC_GENERIC_ERROR) conn.log_expect(options, re_login, LOGIN_TIMEOUT) - conn.send(options["-l"]+"\r\n") + conn.send(options["-l"] + login_eol) conn.log_expect(options, re_pass, SHELL_TIMEOUT) - conn.send(options["-p"]+"\r\n") + conn.send(options["-p"] + login_eol) conn.log_expect(options, options["-c"], SHELL_TIMEOUT) except pexpect.EOF: fail(EC_LOGIN_DENIED) From marx@fedoraproject.org Tue Jul 21 13:49:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Tue, 21 Jul 2009 13:49:00 -0000 Subject: fence-agents: master - fencing.py: Adds device option login_eol_lf Message-ID: <20090721134902.867EF1201B5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=0b2b6e5f5ccae39d5f8931ee6d222164198534ec Commit: 0b2b6e5f5ccae39d5f8931ee6d222164198534ec Parent: 06a1e2735127c38b5d28875f881ec8f8cac47879 Author: Marek 'marx' Grac AuthorDate: Tue Jul 21 15:44:07 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Tue Jul 21 15:44:07 2009 +0200 fencing.py: Adds device option login_eol_lf This option is used for login method using telnet. By default most of the fence agents work with username\r\n but on some devices (e.g. HP iLO MP, sanbox2) it is interpreted as there is empty password. --- fence/agents/lib/fencing.py.py | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 6a2e8b3..2d0205d 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -157,6 +157,11 @@ all_opt = { "required" : "0", "shortdesc" : "Force ribcl version to use", "order" : 1 }, + "login_eol_lf" : { + "getopt" : "", + "help" : "", + "order" : 1 + }, "cmd_prompt" : { "getopt" : "c:", "longopt" : "command-prompt", @@ -701,6 +706,11 @@ def fence_login(options): if (options.has_key("-4")): force_ipvx="-4 " + if (options["device_opt"].count("login_eol_lf")): + login_eol = "\n" + else: + login_eol = "\r\n" + try: re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_pass = re.compile("password", re.IGNORECASE) @@ -776,9 +786,9 @@ def fence_login(options): sys.exit(EC_GENERIC_ERROR) conn.log_expect(options, re_login, LOGIN_TIMEOUT) - conn.send(options["-l"]+"\r\n") + conn.send(options["-l"] + login_eol) conn.log_expect(options, re_pass, SHELL_TIMEOUT) - conn.send(options["-p"]+"\r\n") + conn.send(options["-p"] + login_eol) conn.log_expect(options, options["-c"], SHELL_TIMEOUT) except pexpect.EOF: fail(EC_LOGIN_DENIED) From lon@fedoraproject.org Tue Jul 21 17:21:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Tue, 21 Jul 2009 17:21:00 -0000 Subject: cluster: RHEL4 - rgmanager: Fix double-unlock in error path Message-ID: <20090721172034.009911201B5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=99c87b52af779a52274132383424cfacc06378e2 Commit: 99c87b52af779a52274132383424cfacc06378e2 Parent: ff9305a4c0522fdf4ec71d4516fc8f1b3070d4af Author: Lon Hohberger AuthorDate: Tue Jul 21 13:16:53 2009 -0400 Committer: Lon Hohberger CommitterDate: Tue Jul 21 13:20:14 2009 -0400 rgmanager: Fix double-unlock in error path Signed-off-by: Lon Hohberger --- rgmanager/src/daemons/rg_state.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c index 386d569..7b4a991 100644 --- a/rgmanager/src/daemons/rg_state.c +++ b/rgmanager/src/daemons/rg_state.c @@ -803,7 +803,6 @@ svc_start(char *svcName, int req) if (set_rg_state(svcName, &svcStatus) != 0) { clulog(LOG_ERR, "#47: Failed changing service status\n"); - rg_unlock(svcName, lockp); goto out_unlock; } From chrissie@fedoraproject.org Wed Jul 22 15:07:00 2009 From: chrissie@fedoraproject.org (Christine Caulfield) Date: Wed, 22 Jul 2009 15:07:00 -0000 Subject: cluster: STABLE3 - cman: Improve cman_tool startup error reporting Message-ID: <20090722150651.274071201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=09aa3a3c4979b514379c56066d416d01a1e6ac3d Commit: 09aa3a3c4979b514379c56066d416d01a1e6ac3d Parent: 43371def0f66c4d026342b2beac015bb4cd2f5c4 Author: Christine Caulfield AuthorDate: Wed Jul 22 16:04:48 2009 +0100 Committer: Christine Caulfield CommitterDate: Wed Jul 22 16:04:48 2009 +0100 cman: Improve cman_tool startup error reporting Several errors that can be generated by cman-preconfig get discarded and replaced with a rather cursory and unhelpful "corosync died: Could not read cluster configuration" Now we print the messages passed back before examining the corosync exit status. Signed-off-by: Christine Caulfield --- cman/cman_tool/join.c | 6 +++++- cman/daemon/cman-preconfig.c | 16 +++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cman/cman_tool/join.c b/cman/cman_tool/join.c index eaea597..2a0e017 100644 --- a/cman/cman_tool/join.c +++ b/cman/cman_tool/join.c @@ -272,7 +272,7 @@ int join(commandline_t *comline, char *main_envp[]) fprintf(stderr, "forked process ID is %d\n", corosync_pid); status = 1; - /* There might be a SUCCESS message in the pipe too. */ + /* There might be a SUCCESS or error message in the pipe too. */ messageptr = strchr(messageptr, '\n'); if (messageptr) messageptr++; @@ -286,6 +286,10 @@ int join(commandline_t *comline, char *main_envp[]) status = 0; break; } + else if (messageptr) { + fprintf(stderr, "%s\n", messageptr); + break; + } } else if (len < 0 && errno == EINTR) { continue; diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c index 1dc7a26..8c490df 100644 --- a/cman/daemon/cman-preconfig.c +++ b/cman/daemon/cman-preconfig.c @@ -543,22 +543,24 @@ static int get_nodename(struct objdb_iface_ver0 *objdb) error = uname(&utsname); if (error) { sprintf(error_reason, "cannot get node name, uname failed"); - write_cman_pipe("Can't determine local node name"); + write_cman_pipe("Can't determine local node name, uname failed"); error = -1; goto out; } if (strlen(utsname.nodename) >= sizeof(nodename)) { sprintf(error_reason, "node name from uname is too long"); - write_cman_pipe("Can't determine local node name"); + write_cman_pipe("local node name is too long"); error = -1; goto out; } strcpy(nodename, utsname.nodename); } - if (verify_nodename(objdb, nodename)) + if (verify_nodename(objdb, nodename)) { + write_cman_pipe("Cannot find node name in cluster.conf"); return -1; + } } @@ -622,8 +624,10 @@ static int get_nodename(struct objdb_iface_ver0 *objdb) free(str); } - if (add_ifaddr(objdb, mcast_name, nodename, portnum, broadcast)) + if (add_ifaddr(objdb, mcast_name, nodename, portnum, broadcast)) { + write_cman_pipe(error_reason); return -1; + } /* Get all alternative node names */ num_nodenames = 1; @@ -643,8 +647,10 @@ static int get_nodename(struct objdb_iface_ver0 *objdb) mcast = mcast_name; } - if (add_ifaddr(objdb, mcast, node, portnum, broadcast)) + if (add_ifaddr(objdb, mcast, node, portnum, broadcast)) { + write_cman_pipe(error_reason); return -1; + } num_nodenames++; } From cfeist@fedoraproject.org Wed Jul 22 16:10:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Wed, 22 Jul 2009 16:10:00 -0000 Subject: cluster: the annotated tag cmirror_1_1_38 has been created Message-ID: <20090722161021.7285112025B@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0b2f5269f7df3f3a7639d14b5b9b2082b612c7f1 Commit: 0b2f5269f7df3f3a7639d14b5b9b2082b612c7f1 Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-14 16:46 +0000 Committer: Chris Feist CommitterDate: 2009-07-14 16:46 +0000 annotated tag: cmirror_1_1_38 has been created at 0b2f5269f7df3f3a7639d14b5b9b2082b612c7f1 (tag) tagging 6cf7dbc393d206e56a14261af81b1aeeb5bb160a (commit) replaces gfs_0_1_20 Jonathan Brassow (1): clogd: Fix for bugs 474174 and 491340 From cfeist@fedoraproject.org Wed Jul 22 16:10:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Wed, 22 Jul 2009 16:10:00 -0000 Subject: cluster: the annotated tag cman_2_0_110 has been created Message-ID: <20090722161020.C77F61201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4642ab182c5547072f590f4f212de179084c044a Commit: 4642ab182c5547072f590f4f212de179084c044a Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-22 16:09 +0000 Committer: Chris Feist CommitterDate: 2009-07-22 16:09 +0000 annotated tag: cman_2_0_110 has been created at 4642ab182c5547072f590f4f212de179084c044a (tag) tagging 32bcee3c03818e5fe65751ade92308a35809e08f (commit) replaces gfs_0_1_20 Bob Peterson (1): fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. Christine Caulfield (1): cman: send fewer messages for each state transition. Jonathan Brassow (1): clogd: Fix for bugs 474174 and 491340 From cfeist@fedoraproject.org Wed Jul 22 16:10:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Wed, 22 Jul 2009 16:10:00 -0000 Subject: cluster: the annotated tag gfs2_0_1_61 has been created Message-ID: <20090722161022.5B24A1201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e958c1dee7285f966b45c7df8387fd9bffe3582e Commit: e958c1dee7285f966b45c7df8387fd9bffe3582e Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-14 16:46 +0000 Committer: Chris Feist CommitterDate: 2009-07-14 16:46 +0000 annotated tag: gfs2_0_1_61 has been created at e958c1dee7285f966b45c7df8387fd9bffe3582e (tag) tagging 4478238a116b9c0720e88ff83e7f6cd8fde3c6ad (commit) replaces cmirror_1_1_38 Bob Peterson (1): fsck.gfs2 segfaults while fixing 'EA leaf block type' problem. From cfeist@fedoraproject.org Wed Jul 22 16:15:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Wed, 22 Jul 2009 16:15:00 -0000 Subject: cluster: the annotated tag cman_2_0_111 has been created Message-ID: <20090722161506.F00561201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f751d1d0f25b82ac6306211d0e2eee37c06fa9c7 Commit: f751d1d0f25b82ac6306211d0e2eee37c06fa9c7 Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-22 16:15 +0000 Committer: Chris Feist CommitterDate: 2009-07-22 16:15 +0000 annotated tag: cman_2_0_111 has been created at f751d1d0f25b82ac6306211d0e2eee37c06fa9c7 (tag) tagging 32bcee3c03818e5fe65751ade92308a35809e08f (commit) replaces gfs2_0_1_61 Christine Caulfield (1): cman: send fewer messages for each state transition. From cfeist@fedoraproject.org Wed Jul 22 16:33:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Wed, 22 Jul 2009 16:33:00 -0000 Subject: cluster: RHEL54 - cman: send fewer messages for each state transition. Message-ID: <20090722160526.0AC681201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=32bcee3c03818e5fe65751ade92308a35809e08f Commit: 32bcee3c03818e5fe65751ade92308a35809e08f Parent: 4478238a116b9c0720e88ff83e7f6cd8fde3c6ad Author: Christine Caulfield AuthorDate: Tue Jan 20 14:14:26 2009 +0000 Committer: Chris Feist CommitterDate: Wed Jul 22 11:05:02 2009 -0500 cman: send fewer messages for each state transition. Only recalculate quorum (and tell everyone the result) if a node state has actually changed. bz#505258 Signed-off-by: Christine Caulfield --- cman/daemon/commands.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index 03c7426..710449e 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -1712,6 +1712,8 @@ static void do_process_transition(int nodeid, char *data, int len) { struct cl_transmsg *msg = (struct cl_transmsg *)data; struct cluster_node *node; + unsigned int old_expected; + nodestate_t old_state; if (valid_transition_msg(nodeid, msg) != 0) { P_MEMB("Transition message from %d does not match current config - should quit ?\n", nodeid); @@ -1732,6 +1734,8 @@ static void do_process_transition(int nodeid, char *data, int len) add_ais_node(nodeid, incarnation, num_ais_nodes); node = find_node_by_nodeid(nodeid); assert(node); + old_expected = node->expected_votes; + old_state = node->state; P_MEMB("Got TRANSITION message. msg->flags=%x, node->flags=%x, first_trans=%d\n", msg->flags, node->flags, msg->first_trans); @@ -1791,7 +1795,9 @@ static void do_process_transition(int nodeid, char *data, int len) /* Take into account any new expected_votes value that the new node has */ node->expected_votes = msg->expected_votes; - recalculate_quorum(0, 0); + + if (old_state != node->state || old_expected != node->expected_votes) + recalculate_quorum(0, 0); if (node->fence_agent && msg->fence_agent[0] && strcmp(node->fence_agent, msg->fence_agent)) { From rpeterso@fedoraproject.org Wed Jul 22 17:44:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Wed, 22 Jul 2009 17:44:00 -0000 Subject: gfs1-utils: master - GFS: Commited data evaporates Message-ID: <20090722174423.F40181201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs1-utils.git?p=gfs1-utils.git;a=commitdiff;h=a5b702ebca0ef783d1c4dc3b6cf0d55221fb45d5 Commit: a5b702ebca0ef783d1c4dc3b6cf0d55221fb45d5 Parent: 6ec6f79ce2b87d3d53efea9074f16339e4e66f2c Author: Bob Peterson AuthorDate: Wed Jul 22 12:13:02 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 22 12:45:25 2009 -0500 GFS: Commited data evaporates bz 510310 Since stuffed data is contained along with the metadata, the journal needs to be flushed at fsync in order to ensure the data hits the media. The problem is that fsyncs to stuffed inodes were not causing the journal to be flushed. --- gfs-kernel/src/gfs/ops_file.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c index bb55e5c..e5b6c4c 100644 --- a/gfs-kernel/src/gfs/ops_file.c +++ b/gfs-kernel/src/gfs/ops_file.c @@ -1622,6 +1622,8 @@ gfs_fsync(struct file *file, struct dentry *dentry, int datasync) }; error = sync_inode(inode, &wbc); } + if (gfs_is_stuffed(ip)) + gfs_log_flush_glock(ip->i_gl); } gfs_glock_dq_uninit(&i_gh); From rpeterso@fedoraproject.org Wed Jul 22 17:47:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Wed, 22 Jul 2009 17:47:00 -0000 Subject: cluster: STABLE2 - GFS: Commited data evaporates Message-ID: <20090722174719.ED3881201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a626347b4cc50e69b519d948cec03a4f47c94047 Commit: a626347b4cc50e69b519d948cec03a4f47c94047 Parent: 5914d7c1d984b5e8352474ca0950be2c533000a4 Author: Bob Peterson AuthorDate: Wed Jul 22 12:13:02 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 22 12:49:56 2009 -0500 GFS: Commited data evaporates bz 510310 Since stuffed data is contained along with the metadata, the journal needs to be flushed at fsync in order to ensure the data hits the media. The problem is that fsyncs to stuffed inodes were not causing the journal to be flushed. --- gfs-kernel/src/gfs/ops_file.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c index bb55e5c..e5b6c4c 100644 --- a/gfs-kernel/src/gfs/ops_file.c +++ b/gfs-kernel/src/gfs/ops_file.c @@ -1622,6 +1622,8 @@ gfs_fsync(struct file *file, struct dentry *dentry, int datasync) }; error = sync_inode(inode, &wbc); } + if (gfs_is_stuffed(ip)) + gfs_log_flush_glock(ip->i_gl); } gfs_glock_dq_uninit(&i_gh); From rpeterso@fedoraproject.org Wed Jul 22 17:47:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Wed, 22 Jul 2009 17:47:00 -0000 Subject: cluster: STABLE3 - GFS: Commited data evaporates Message-ID: <20090722174648.CE7911201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0d93f2b3eb654c787940273d346bf95703a4ffe2 Commit: 0d93f2b3eb654c787940273d346bf95703a4ffe2 Parent: 09aa3a3c4979b514379c56066d416d01a1e6ac3d Author: Bob Peterson AuthorDate: Wed Jul 22 12:13:02 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 22 12:49:26 2009 -0500 GFS: Commited data evaporates bz 510310 Since stuffed data is contained along with the metadata, the journal needs to be flushed at fsync in order to ensure the data hits the media. The problem is that fsyncs to stuffed inodes were not causing the journal to be flushed. --- gfs-kernel/src/gfs/ops_file.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c index bb55e5c..e5b6c4c 100644 --- a/gfs-kernel/src/gfs/ops_file.c +++ b/gfs-kernel/src/gfs/ops_file.c @@ -1622,6 +1622,8 @@ gfs_fsync(struct file *file, struct dentry *dentry, int datasync) }; error = sync_inode(inode, &wbc); } + if (gfs_is_stuffed(ip)) + gfs_log_flush_glock(ip->i_gl); } gfs_glock_dq_uninit(&i_gh); From teigland@fedoraproject.org Wed Jul 22 20:40:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Wed, 22 Jul 2009 20:40:00 -0000 Subject: cluster: STABLE3 - dlm_controld/gfs_controld: GETLK should free unused resource Message-ID: <20090722203957.362CA1201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=c2f3ba7a40d4080f6dbf7a2cc9dc80ff9445eb9e Commit: c2f3ba7a40d4080f6dbf7a2cc9dc80ff9445eb9e Parent: 0d93f2b3eb654c787940273d346bf95703a4ffe2 Author: David Teigland AuthorDate: Wed Jul 22 15:29:53 2009 -0500 Committer: David Teigland CommitterDate: Wed Jul 22 15:29:53 2009 -0500 dlm_controld/gfs_controld: GETLK should free unused resource bz 513285 If a plock resource does not exist in dlm_controld/gfs_controld, (no posix locks exist on a file), fcntl(GETLK) on that file will cause the resource to be created, but not removed afterward. Signed-off-by: David Teigland --- group/dlm_controld/plock.c | 1 + group/gfs_controld/plock.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c index 0b432d1..3d4431e 100644 --- a/group/dlm_controld/plock.c +++ b/group/dlm_controld/plock.c @@ -732,6 +732,7 @@ static void do_get(struct lockspace *ls, struct dlm_plock_info *in, rv = 0; write_result(ls, in, rv); + put_resource(r); } static void save_message(struct lockspace *ls, struct dlm_header *hd, int len, diff --git a/group/gfs_controld/plock.c b/group/gfs_controld/plock.c index f8b600e..7a83a08 100644 --- a/group/gfs_controld/plock.c +++ b/group/gfs_controld/plock.c @@ -705,6 +705,7 @@ static void do_get(struct mountgroup *mg, struct dlm_plock_info *in, rv = 0; write_result(mg, in, rv); + put_resource(r); } static void __receive_plock(struct mountgroup *mg, struct dlm_plock_info *in, From teigland@fedoraproject.org Wed Jul 22 20:43:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Wed, 22 Jul 2009 20:43:00 -0000 Subject: dlm: master - dlm_controld: GETLK should free unused resource Message-ID: <20090722204317.9122F1201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=041ee1d89567c842287dfc0bf1f707535fa03bbe Commit: 041ee1d89567c842287dfc0bf1f707535fa03bbe Parent: cdda56dcbb999b3ffd6dd080fa97f8dd8eefcc14 Author: David Teigland AuthorDate: Wed Jul 22 15:29:53 2009 -0500 Committer: David Teigland CommitterDate: Wed Jul 22 15:34:46 2009 -0500 dlm_controld: GETLK should free unused resource bz 513285 If a plock resource does not exist in dlm_controld, (no posix locks exist on a file), fcntl(GETLK) on that file will cause the resource to be created, but not removed afterward. Signed-off-by: David Teigland --- group/dlm_controld/plock.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/group/dlm_controld/plock.c b/group/dlm_controld/plock.c index 77e6c71..85628ce 100644 --- a/group/dlm_controld/plock.c +++ b/group/dlm_controld/plock.c @@ -731,6 +731,7 @@ static void do_get(struct lockspace *ls, struct dlm_plock_info *in, rv = 0; write_result(ls, in, rv); + put_resource(r); } static void save_message(struct lockspace *ls, struct dlm_header *hd, int len, From teigland@fedoraproject.org Wed Jul 22 20:45:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Wed, 22 Jul 2009 20:45:00 -0000 Subject: cluster: RHEL5 - gfs_controld: GETLK should free unused resource Message-ID: <20090722204454.17F4C1201FC@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f106b915e18e2323f549fbbf0e956c0ee884fb2e Commit: f106b915e18e2323f549fbbf0e956c0ee884fb2e Parent: c0a0ac5b6358a0f641a1d5e739307e7957e7ba6a Author: David Teigland AuthorDate: Wed Jul 22 15:29:53 2009 -0500 Committer: David Teigland CommitterDate: Wed Jul 22 15:35:59 2009 -0500 gfs_controld: GETLK should free unused resource bz 513285 If a plock resource does not exist in gfs_controld, (no posix locks exist on a file), fcntl(GETLK) on that file will cause the resource to be created, but not removed afterward. Signed-off-by: David Teigland --- group/gfs_controld/plock.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/group/gfs_controld/plock.c b/group/gfs_controld/plock.c index 34c4c21..b03e77f 100644 --- a/group/gfs_controld/plock.c +++ b/group/gfs_controld/plock.c @@ -886,6 +886,7 @@ static void do_get(struct mountgroup *mg, struct dlm_plock_info *in, rv = 0; write_result(mg, in, rv); + put_resource(r); } static void __receive_plock(struct mountgroup *mg, struct dlm_plock_info *in, From swhiteho@fedoraproject.org Thu Jul 23 09:14:00 2009 From: swhiteho@fedoraproject.org (Steven Whitehouse) Date: Thu, 23 Jul 2009 09:14:00 -0000 Subject: gfs2-utils: master - gfs_controld: Remove some unused code Message-ID: <20090723091409.9AC77120337@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=7a5b9055ce63203dfe355d81bb98d1a00d6234b4 Commit: 7a5b9055ce63203dfe355d81bb98d1a00d6234b4 Parent: 60d5d7cbd26888177653a766bd476c307b091074 Author: Steven Whitehouse AuthorDate: Wed Jul 22 18:36:29 2009 +0100 Committer: Steven Whitehouse CommitterDate: Wed Jul 22 18:36:29 2009 +0100 gfs_controld: Remove some unused code There were three hunks of unused code in gfs_controld. One can be enabled since its only debugging. One is really documentation, so the comment has been updated to explain why its still there. The third is also really documentation, and also updated. Signed-off-by: Steven Whitehouse --- group/gfs_controld/cpg-new.c | 8 ++++---- group/gfs_controld/member_cman.c | 15 +++++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/group/gfs_controld/cpg-new.c b/group/gfs_controld/cpg-new.c index 399ac16..7d71712 100644 --- a/group/gfs_controld/cpg-new.c +++ b/group/gfs_controld/cpg-new.c @@ -1755,7 +1755,6 @@ static void create_new_nodes(struct mountgroup *mg) } } -#if 0 static void print_id_list(struct mountgroup *mg, struct id_info *ids, int id_count, int id_size) { @@ -1768,7 +1767,6 @@ static void print_id_list(struct mountgroup *mg, struct id_info *ids, id = (struct id_info *)((char *)id + id_size); } } -#endif static void create_failed_journals(struct mountgroup *mg) { @@ -1783,7 +1781,7 @@ static void create_failed_journals(struct mountgroup *mg) log_group(mg, "create_failed_journals all new"); return; } - /* print_id_list(mg, ids, id_count, id_size); */ + print_id_list(mg, ids, id_count, id_size); id = ids; @@ -2248,7 +2246,9 @@ static int pick_journal_to_recover(struct mountgroup *mg, int *jid) #if 0 /* FIXME: do something so this doesn't happen so regularly; maybe - retry only after all nodes have failed */ + * retry only after all nodes have failed. This code doesn't work + * but shows an idea of roughly how to fix the issue. + */ /* Retry recoveries that failed the first time. This is necessary at times for withrawn journals when all nodes fail the recovery diff --git a/group/gfs_controld/member_cman.c b/group/gfs_controld/member_cman.c index 384fab0..16631d3 100644 --- a/group/gfs_controld/member_cman.c +++ b/group/gfs_controld/member_cman.c @@ -84,12 +84,11 @@ void close_cluster_cfg(void) corosync_cfg_finalize(ch); } -/* what's the replacement for this? */ -#if 0 - case CMAN_REASON_CONFIG_UPDATE: - setup_logging(); - setup_ccs(); - break; - } -#endif +/* what's the replacement for this? + * case CMAN_REASON_CONFIG_UPDATE: + * setup_logging(); + * setup_ccs(); + * break; + * } + */ From marx@fedoraproject.org Thu Jul 23 10:08:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 23 Jul 2009 10:08:00 -0000 Subject: cluster: RHEL4 - fence_agents: #504589 - fence agents fails with pexpect exception Message-ID: <20090723100754.9DBC3120337@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=db5c670bfecfeb3cdf748651181e7e82438e601d Commit: db5c670bfecfeb3cdf748651181e7e82438e601d Parent: 99c87b52af779a52274132383424cfacc06378e2 Author: Marek Grac AuthorDate: Thu Jul 23 11:58:19 2009 +0200 Committer: Marek Grac CommitterDate: Thu Jul 23 11:58:19 2009 +0200 fence_agents: #504589 - fence agents fails with pexpect exception Added correct import --- fence/agents/apc/fence_apc.py | 2 +- fence/agents/bladecenter/fence_bladecenter.py | 2 +- fence/agents/drac/fence_drac5.py | 2 +- fence/agents/lpar/fence_lpar.py | 2 +- fence/agents/rsa/fence_rsa.py | 2 +- fence/agents/wti/fence_wti.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py index b0cbfcc..b98add3 100755 --- a/fence/agents/apc/fence_apc.py +++ b/fence/agents/apc/fence_apc.py @@ -15,7 +15,7 @@ ## cipher (des/blowfish) have to be defined ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py index 3e7204a..518f6a6 100755 --- a/fence/agents/bladecenter/fence_bladecenter.py +++ b/fence/agents/bladecenter/fence_bladecenter.py @@ -13,7 +13,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py index 7f9f24c..cefe673 100644 --- a/fence/agents/drac/fence_drac5.py +++ b/fence/agents/drac/fence_drac5.py @@ -12,7 +12,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index 680eab5..ffa2be8 100755 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -11,7 +11,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index af2a780..e54133c 100755 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -7,7 +7,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index f04f645..f43f88b 100755 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -12,7 +12,7 @@ ## WTI IPS-800-CE v1.40h (no username) ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * From marx@fedoraproject.org Thu Jul 23 10:16:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 23 Jul 2009 10:16:00 -0000 Subject: cluster: STABLE2 - fencing: fence agents fails with pexpect exception Message-ID: <20090723101610.89E48120337@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=06cf4e24b7100ab26447c81e10eb755f3959a0ac Commit: 06cf4e24b7100ab26447c81e10eb755f3959a0ac Parent: a626347b4cc50e69b519d948cec03a4f47c94047 Author: Marek 'marx' Grac AuthorDate: Thu Jul 23 12:14:25 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Thu Jul 23 12:14:25 2009 +0200 fencing: fence agents fails with pexpect exception bz#501586 - 2nd patch --- fence/agents/bladecenter/fence_bladecenter.py | 2 +- fence/agents/drac/fence_drac5.py | 2 +- fence/agents/lpar/fence_lpar.py | 2 +- fence/agents/rsa/fence_rsa.py | 2 +- fence/agents/virsh/fence_virsh.py | 2 +- fence/agents/vmware/fence_vmware.py | 11 ++++++++--- fence/agents/wti/fence_wti.py | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py index dc5d091..e391bd2 100644 --- a/fence/agents/bladecenter/fence_bladecenter.py +++ b/fence/agents/bladecenter/fence_bladecenter.py @@ -12,7 +12,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py index 85bf3b5..f9c7044 100644 --- a/fence/agents/drac/fence_drac5.py +++ b/fence/agents/drac/fence_drac5.py @@ -12,7 +12,7 @@ ## @note: drac_version was removed ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index 1990f42..36a322b 100755 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -10,7 +10,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index 1e6314a..af62d03 100644 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -7,7 +7,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py index 3012621..c02336a 100644 --- a/fence/agents/virsh/fence_virsh.py +++ b/fence/agents/virsh/fence_virsh.py @@ -5,7 +5,7 @@ # Virsh 0.3.3 on RHEL 5.2 with xen-3.0.3-51 # -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py index 887b3bb..2c7e824 100755 --- a/fence/agents/vmware/fence_vmware.py +++ b/fence/agents/vmware/fence_vmware.py @@ -6,7 +6,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * @@ -103,8 +103,13 @@ def main(): ## ## Logout from system ###### - conn.sendline("logout") - conn.close() + try: + conn.sendline("logout") + conn.close() + except exceptions.OSError: + pass + except pexpect.ExceptionPexpect: + pass if __name__ == "__main__": main() diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 814f27a..381e16c 100644 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -11,7 +11,7 @@ ## WTI IPS-800-CE v1.40h (no username) ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * From marx@fedoraproject.org Thu Jul 23 10:20:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 23 Jul 2009 10:20:00 -0000 Subject: cluster: STABLE3 - fencing: fence agents fails with pexpect exception Message-ID: <20090723101957.BCF79120337@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=bac5088a3ae7c03753c9c25f5a9799d67fbdb2ca Commit: bac5088a3ae7c03753c9c25f5a9799d67fbdb2ca Parent: c2f3ba7a40d4080f6dbf7a2cc9dc80ff9445eb9e Author: Marek 'marx' Grac AuthorDate: Thu Jul 23 12:18:06 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Thu Jul 23 12:18:06 2009 +0200 fencing: fence agents fails with pexpect exception bz#501586 - 2nd patch --- fence/agents/bladecenter/fence_bladecenter.py | 2 +- fence/agents/drac/fence_drac5.py | 2 +- fence/agents/lpar/fence_lpar.py | 2 +- fence/agents/rsa/fence_rsa.py | 2 +- fence/agents/virsh/fence_virsh.py | 2 +- fence/agents/vmware/fence_vmware.py | 2 +- fence/agents/wti/fence_wti.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py index 5df4869..eacac33 100644 --- a/fence/agents/bladecenter/fence_bladecenter.py +++ b/fence/agents/bladecenter/fence_bladecenter.py @@ -12,7 +12,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py index b669bac..231fd06 100755 --- a/fence/agents/drac/fence_drac5.py +++ b/fence/agents/drac/fence_drac5.py @@ -12,7 +12,7 @@ ## @note: drac_version was removed ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index aaaa65b..760dd74 100644 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -10,7 +10,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index 9c33327..dec626c 100644 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -7,7 +7,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py index 038e903..432bdb9 100644 --- a/fence/agents/virsh/fence_virsh.py +++ b/fence/agents/virsh/fence_virsh.py @@ -5,7 +5,7 @@ # Virsh 0.3.3 on RHEL 5.2 with xen-3.0.3-51 # -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py index 10307c1..c3a6cf0 100644 --- a/fence/agents/vmware/fence_vmware.py +++ b/fence/agents/vmware/fence_vmware.py @@ -14,7 +14,7 @@ # VMware Virtual Center 2.5 # -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 5326e6d..25cbccc 100644 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -11,7 +11,7 @@ ## WTI IPS-800-CE v1.40h (no username) ('list' tested) ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * From marx@fedoraproject.org Thu Jul 23 10:25:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 23 Jul 2009 10:25:00 -0000 Subject: fence-agents: master - fencing: fence agents fails with pexpect exception Message-ID: <20090723102504.79E41120337@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=7f97f16699739fcbc2304bf35322a1495b1131b0 Commit: 7f97f16699739fcbc2304bf35322a1495b1131b0 Parent: 0b2b6e5f5ccae39d5f8931ee6d222164198534ec Author: Marek 'marx' Grac AuthorDate: Thu Jul 23 12:18:06 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Thu Jul 23 12:23:27 2009 +0200 fencing: fence agents fails with pexpect exception bz#501586 - 2nd patch --- fence/agents/bladecenter/fence_bladecenter.py | 2 +- fence/agents/drac/fence_drac5.py | 2 +- fence/agents/lpar/fence_lpar.py | 2 +- fence/agents/rsa/fence_rsa.py | 2 +- fence/agents/virsh/fence_virsh.py | 2 +- fence/agents/vmware/fence_vmware.py | 2 +- fence/agents/wti/fence_wti.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py index 5df4869..eacac33 100644 --- a/fence/agents/bladecenter/fence_bladecenter.py +++ b/fence/agents/bladecenter/fence_bladecenter.py @@ -12,7 +12,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py index b669bac..231fd06 100755 --- a/fence/agents/drac/fence_drac5.py +++ b/fence/agents/drac/fence_drac5.py @@ -12,7 +12,7 @@ ## @note: drac_version was removed ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index 31a227f..ea10596 100644 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -10,7 +10,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index 09e878c..0a1335a 100644 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -6,7 +6,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py index 038e903..432bdb9 100644 --- a/fence/agents/virsh/fence_virsh.py +++ b/fence/agents/virsh/fence_virsh.py @@ -5,7 +5,7 @@ # Virsh 0.3.3 on RHEL 5.2 with xen-3.0.3-51 # -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py index 10307c1..c3a6cf0 100644 --- a/fence/agents/vmware/fence_vmware.py +++ b/fence/agents/vmware/fence_vmware.py @@ -14,7 +14,7 @@ # VMware Virtual Center 2.5 # -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 5326e6d..25cbccc 100644 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -11,7 +11,7 @@ ## WTI IPS-800-CE v1.40h (no username) ('list' tested) ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * From marx@fedoraproject.org Thu Jul 23 10:29:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 23 Jul 2009 10:29:00 -0000 Subject: cluster: RHEL5 - fencing: #501586 - fence agents fails with pexpect exception Message-ID: <20090723102912.276FC120337@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4d1e5e8187632e150588d5515635b6468f726f83 Commit: 4d1e5e8187632e150588d5515635b6468f726f83 Parent: f106b915e18e2323f549fbbf0e956c0ee884fb2e Author: Marek Grac AuthorDate: Thu Jul 23 11:32:41 2009 +0200 Committer: Marek Grac CommitterDate: Thu Jul 23 11:32:41 2009 +0200 fencing: #501586 - fence agents fails with pexpect exception Added import exceptions. Fence agent for VMWare was not checked for these exceptions. --- fence/agents/bladecenter/fence_bladecenter.py | 2 +- fence/agents/drac/fence_drac5.py | 2 +- fence/agents/lpar/fence_lpar.py | 2 +- fence/agents/rsa/fence_rsa.py | 2 +- fence/agents/virsh/fence_virsh.py | 2 +- fence/agents/vmware/fence_vmware.py | 11 ++++++++--- fence/agents/wti/fence_wti.py | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py index 5272df3..92b5d06 100755 --- a/fence/agents/bladecenter/fence_bladecenter.py +++ b/fence/agents/bladecenter/fence_bladecenter.py @@ -13,7 +13,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py index 3b951c0..e50f59a 100755 --- a/fence/agents/drac/fence_drac5.py +++ b/fence/agents/drac/fence_drac5.py @@ -12,7 +12,7 @@ ## @note: drac_version was removed ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index 353ca06..0f76c22 100755 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -11,7 +11,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index dd2f579..399e3c0 100755 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -7,7 +7,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py index ae8cd23..2f8a250 100644 --- a/fence/agents/virsh/fence_virsh.py +++ b/fence/agents/virsh/fence_virsh.py @@ -6,7 +6,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py index 3cbb900..1aa0a1e 100755 --- a/fence/agents/vmware/fence_vmware.py +++ b/fence/agents/vmware/fence_vmware.py @@ -7,7 +7,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * @@ -104,8 +104,13 @@ def main(): ## ## Logout from system ###### - conn.sendline("logout") - conn.close() + try: + conn.sendline("logout") + conn.close() + except exceptions.OSError: + pass + except pexpect.ExceptionPexpect: + pass if __name__ == "__main__": main() diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 4d9f6b2..132c8af 100755 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -12,7 +12,7 @@ ## WTI IPS-800-CE v1.40h (no username) ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * From rpeterso@fedoraproject.org Thu Jul 23 15:29:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Thu, 23 Jul 2009 15:29:00 -0000 Subject: cluster: RHEL5 - GFS: Commited data evaporates Message-ID: <20090723152833.3FC61120284@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a46a5d37522642efd6b88d4d0b1812ddf8541073 Commit: a46a5d37522642efd6b88d4d0b1812ddf8541073 Parent: 4d1e5e8187632e150588d5515635b6468f726f83 Author: Bob Peterson AuthorDate: Wed Jul 22 12:13:02 2009 -0500 Committer: Bob Peterson CommitterDate: Thu Jul 23 09:35:00 2009 -0500 GFS: Commited data evaporates bz 510310 Since stuffed data is contained along with the metadata, the journal needs to be flushed at fsync in order to ensure the data hits the media. The problem is that fsyncs to stuffed inodes were not causing the journal to be flushed. --- gfs-kernel/src/gfs/ops_file.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c index bdeb3be..bd68583 100644 --- a/gfs-kernel/src/gfs/ops_file.c +++ b/gfs-kernel/src/gfs/ops_file.c @@ -1621,6 +1621,8 @@ gfs_fsync(struct file *file, struct dentry *dentry, int datasync) }; error = sync_inode(inode, &wbc); } + if (gfs_is_stuffed(ip)) + gfs_log_flush_glock(ip->i_gl); } gfs_glock_dq_uninit(&i_gh); From rpeterso@fedoraproject.org Thu Jul 23 15:29:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Thu, 23 Jul 2009 15:29:00 -0000 Subject: cluster: RHEL54 - GFS: Commited data evaporates Message-ID: <20090723152931.D237A120284@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=188db164825505dfecd32b8eb4a53a1349557280 Commit: 188db164825505dfecd32b8eb4a53a1349557280 Parent: 32bcee3c03818e5fe65751ade92308a35809e08f Author: Bob Peterson AuthorDate: Wed Jul 22 12:13:02 2009 -0500 Committer: Bob Peterson CommitterDate: Thu Jul 23 10:31:53 2009 -0500 GFS: Commited data evaporates bz 510310 Since stuffed data is contained along with the metadata, the journal needs to be flushed at fsync in order to ensure the data hits the media. The problem is that fsyncs to stuffed inodes were not causing the journal to be flushed. --- gfs-kernel/src/gfs/ops_file.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c index bdeb3be..bd68583 100644 --- a/gfs-kernel/src/gfs/ops_file.c +++ b/gfs-kernel/src/gfs/ops_file.c @@ -1621,6 +1621,8 @@ gfs_fsync(struct file *file, struct dentry *dentry, int datasync) }; error = sync_inode(inode, &wbc); } + if (gfs_is_stuffed(ip)) + gfs_log_flush_glock(ip->i_gl); } gfs_glock_dq_uninit(&i_gh); From rpeterso@fedoraproject.org Thu Jul 23 15:31:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Thu, 23 Jul 2009 15:31:00 -0000 Subject: cluster: RHEL53 - GFS: Commited data evaporates Message-ID: <20090723153032.6B049120284@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f19cc83e347ccc639bd54635adeb2e77bbbf2e66 Commit: f19cc83e347ccc639bd54635adeb2e77bbbf2e66 Parent: 2bac6a6e1a24cd56f08bb89299296bf2a9a6ea58 Author: Bob Peterson AuthorDate: Wed Jul 22 12:13:02 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 22 12:37:57 2009 -0500 GFS: Commited data evaporates bz 510310 Since stuffed data is contained along with the metadata, the journal needs to be flushed at fsync in order to ensure the data hits the media. The problem is that fsyncs to stuffed inodes were not causing the journal to be flushed. --- gfs-kernel/src/gfs/ops_file.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c index 1e54e30..64bc76a 100644 --- a/gfs-kernel/src/gfs/ops_file.c +++ b/gfs-kernel/src/gfs/ops_file.c @@ -1597,6 +1597,8 @@ gfs_fsync(struct file *file, struct dentry *dentry, int datasync) }; error = sync_inode(inode, &wbc); } + if (gfs_is_stuffed(ip)) + gfs_log_flush_glock(ip->i_gl); } gfs_glock_dq_uninit(&i_gh); From rpeterso@fedoraproject.org Thu Jul 23 15:32:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Thu, 23 Jul 2009 15:32:00 -0000 Subject: cluster: RHEL52 - GFS: Commited data evaporates Message-ID: <20090723153120.0B6D6120284@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d52f4c7c5d7937e760ac7e8e7a969ff4016054c4 Commit: d52f4c7c5d7937e760ac7e8e7a969ff4016054c4 Parent: e716488ac3bb60ddf7111030b975d852151f6bb6 Author: Bob Peterson AuthorDate: Wed Jul 22 12:13:02 2009 -0500 Committer: Bob Peterson CommitterDate: Wed Jul 22 12:38:08 2009 -0500 GFS: Commited data evaporates bz 510310 Since stuffed data is contained along with the metadata, the journal needs to be flushed at fsync in order to ensure the data hits the media. The problem is that fsyncs to stuffed inodes were not causing the journal to be flushed. --- gfs-kernel/src/gfs/ops_file.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c index 5df9a81..93dcfbf 100644 --- a/gfs-kernel/src/gfs/ops_file.c +++ b/gfs-kernel/src/gfs/ops_file.c @@ -1570,6 +1570,8 @@ gfs_fsync(struct file *file, struct dentry *dentry, int datasync) }; error = sync_inode(inode, &wbc); } + if (gfs_is_stuffed(ip)) + gfs_log_flush_glock(ip->i_gl); } gfs_glock_dq_uninit(&i_gh); From teigland@fedoraproject.org Thu Jul 23 18:04:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Thu, 23 Jul 2009 18:04:00 -0000 Subject: cluster: STABLE3 - doc: update usage.txt Message-ID: <20090723175220.0B84112022F@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ab181b7303ccd66ab4bd67a08ed06136b4a20a93 Commit: ab181b7303ccd66ab4bd67a08ed06136b4a20a93 Parent: bac5088a3ae7c03753c9c25f5a9799d67fbdb2ca Author: David Teigland AuthorDate: Thu Jul 23 12:41:16 2009 -0500 Committer: David Teigland CommitterDate: Thu Jul 23 12:44:03 2009 -0500 doc: update usage.txt for cluster3 Signed-off-by: David Teigland --- doc/usage.txt | 201 ++++++++++++++++----------------------------------------- 1 files changed, 57 insertions(+), 144 deletions(-) diff --git a/doc/usage.txt b/doc/usage.txt index f9e2866..ad53a95 100644 --- a/doc/usage.txt +++ b/doc/usage.txt @@ -1,177 +1,90 @@ -How to install and run GFS. - -Refer to the cluster project page for the latest information. -http://sources.redhat.com/cluster/ - - -Install -------- - -Install a Linux kernel with GFS2, DLM, configfs, IPV6 and SCTP, - 2.6.23-rc1 or later - - If you want to use gfs1 (from cluster/gfs-kernel), then you need to - export three additional symbols from gfs2 by adding the following lines - to the end of linux/fs/gfs2/locking.c: - EXPORT_SYMBOL_GPL(gfs2_unmount_lockproto); - EXPORT_SYMBOL_GPL(gfs2_mount_lockproto); - EXPORT_SYMBOL_GPL(gfs2_withdraw_lockproto); - -Install openais - get the latest "whitetank" (stable) release from - http://openais.org/ - or - svn checkout http://svn.osdl.org/openais - cd openais/branches/whitetank - make; make install DESTDIR=/ - -Install gfs/dlm/fencing/etc components - get the latest cluster-2.xx.yy tarball from - ftp://sources.redhat.com/pub/cluster/ - or - cvs -d :pserver:cvs@sources.redhat.com:/cvs/cluster login cvs - cvs -d :pserver:cvs@sources.redhat.com:/cvs/cluster checkout cluster - the password is "cvs" - cd cluster - ./configure --kernel_src=/path/to/kernel - make install - - NOTE: On 64-bit systems, you will usually need to add '--libdir=/usr/lib64' - to the configure line. - -Install LVM2/CLVM (optional) - cvs -d :pserver:cvs@sources.redhat.com:/cvs/lvm2 login cvs - cvs -d :pserver:cvs@sources.redhat.com:/cvs/lvm2 checkout LVM2 - cvs -d :pserver:cvs@sources.redhat.com:/cvs/lvm2 - the password is "cvs" - cd LVM2 - ./configure --with-clvmd=cman --with-cluster=shared - make; make install - - NOTE: On 64-bit systems, you will usually need to add '--libdir=/usr/lib64' - to the configure line. - -Load kernel modules -------------------- - -modprobe gfs2 -modprobe gfs -modprobe lock_dlm -modprobe lock_nolock -modprobe dlm - - -Configuration -------------- - -Create /etc/cluster/cluster.conf and copy it to all nodes. - - The format and content of cluster.conf has changed little since the - last generation of the software. See old example here: - http://sources.redhat.com/cluster/doc/usage.txt - The one change you will need to make is to add nodeids for all nodes - in the cluster. These are now mandatory. eg: - - - - If you already have a cluster.conf file with no nodeids in it, then you can - use the 'ccs_tool addnodeids' command to add them. +cluster3 minimal setup and usage +cluster configuration +--------------------- -Example cluster.conf --------------------- +Create /etc/cluster/cluster.conf and copy it to all nodes. -This is a basic cluster.conf file that requires manual fencing. The node -names should resolve to the address on the network interface you want to -use for openais/cman/dlm communication. +Below is a minimal cluster.conf file using manual fencing. The node names +should resolve to the address on the network interface you want to use for +cluster communication. - - - - - - - - - - - - - - + + + - - - -Startup procedure ------------------ +cluster start +------------- + +Use the init script on all nodes: + +> service cman start -Run these commands on each cluster node: +Or, minimal manual steps: +> modprobe configfs +> modprobe dlm +> modprobe gfs2 (if using gfs2) > mount -t configfs none /sys/kernel/config -> ccsd > cman_tool join -> groupd > fenced -> fence_tool join > dlm_controld -> gfs_controld -> clvmd (optional) -> mkfs -t gfs2 -p lock_dlm -t : -j <#journals> -> mount -t gfs2 [-v] +> gfs_controld (if using gfs2) +> fence_tool join + + +using clvm +---------- + +Use the init script on all nodes: + +> service clvmd start + +Or, manually: + +> clvmd +> vgscan +> vgchange -aly + + +using rgmanager +--------------- + +Use the init script on all nodes: -Notes: -- replace "gfs2" with "gfs" above to use gfs1 instead of gfs2 -- in mkfs should match the one in cluster.conf. -- in mkfs is any name you pick, each fs must have a different name. -- <#journals> in mkfs should be greater than or equal to the number of nodes - that you want to mount this fs, each node uses a separate journal. -- To avoid unnecessary fencing when starting the cluster, it's best for - all nodes to join the cluster (complete cman_tool join) before any - of them do fence_tool join. -- The cman_tool "status" and "nodes" options show the status and members - of the cluster. -- The group_tool command shows the status of fencing, dlm and gfs groups - that the local node is part of. -- The "cman" init script can be used for starting everything up through - gfs_controld in the list above. +> service rgmanager start +Or, manually: -Shutdown procedure ------------------- +> rgmanager -Run these commands on each cluster node: +Create services/resources to be managed in cluster.conf. -> umount [-v] -> fence_tool leave -> cman_tool leave +using gfs2 +---------- -Converting from GFS1 to GFS2 ----------------------------- +Create new file systems, using the cluster name from cluster.conf. Pick a +unique name for each fs and select a number of journals greater than or equal +to the number of nodes that will mount the fs. -If you have GFS1 filesystems that you need to convert to GFS2, follow -this procedure: +> mkfs.gfs2 -p lock_dlm -t : -j <#journals> -1. Back up your entire filesystem first. - e.g. cp /dev/your_vg/lvol0 /your_gfs_backup +Use the gfs2 init script to automate mounting gfs2 fs's listed in /etc/fstab: -2. Run fsck to ensure filesystem integrity. - e.g. gfs2_fsck /dev/your_vg/lvol0 +> service gfs2 start -3. Make sure the filesystem is not mounted from any node. - e.g. for i in `grep " mount -t gfs2 -5. Run gfs2_convert from one of the nodes. - e.g. gfs2_convert /dev/your_vg/lvol0 +(Replace "gfs2" with "gfs" everywhere above to use gfs instead of gfs2.) From teigland@fedoraproject.org Thu Jul 23 18:04:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Thu, 23 Jul 2009 18:04:00 -0000 Subject: cluster: STABLE3 - doc: remove old gfs docs Message-ID: <20090723175222.2F98712022F@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6f83ab05ad47c5fe242d7840388db955c20c4ece Commit: 6f83ab05ad47c5fe242d7840388db955c20c4ece Parent: ab181b7303ccd66ab4bd67a08ed06136b4a20a93 Author: David Teigland AuthorDate: Thu Jul 23 12:42:43 2009 -0500 Committer: David Teigland CommitterDate: Thu Jul 23 12:44:03 2009 -0500 doc: remove old gfs docs Signed-off-by: David Teigland --- doc/Makefile | 5 +- doc/gfs2.txt | 45 --------------- doc/journaling.txt | 155 -------------------------------------------------- doc/min-gfs.txt | 159 ---------------------------------------------------- 4 files changed, 1 insertions(+), 363 deletions(-) diff --git a/doc/Makefile b/doc/Makefile index 10a076c..2aeb0b9 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,7 +1,4 @@ -DOCS = gfs2.txt \ - journaling.txt \ - min-gfs.txt \ - usage.txt \ +DOCS = usage.txt \ COPYING.applications \ COPYING.libraries \ COPYRIGHT \ diff --git a/doc/gfs2.txt b/doc/gfs2.txt deleted file mode 100644 index 88f0143..0000000 --- a/doc/gfs2.txt +++ /dev/null @@ -1,45 +0,0 @@ -Global File System ------------------- - -http://sources.redhat.com/cluster/ - -GFS is a cluster file system. It allows a cluster of computers to -simultaneously use a block device that is shared between them (with FC, -iSCSI, NBD, etc). GFS reads and writes to the block device like a local -file system, but also uses a lock module to allow the computers coordinate -their I/O so file system consistency is maintained. One of the nifty -features of GFS is perfect consistency -- changes made to the file system -on one machine show up immediately on all other machines in the cluster. - -GFS uses interchangable inter-node locking mechanisms. Different lock -modules can plug into GFS and each file system selects the appropriate -lock module at mount time. Lock modules include: - - lock_nolock -- does no real locking and allows gfs to be used as a - local file system - - lock_dlm -- uses a distributed lock manager (dlm) for inter-node locking - The dlm is found at linux/fs/dlm/ - -In addition to interfacing with an external locking manager, a gfs lock -module is responsible for interacting with external cluster management -systems. Lock_dlm depends on user space cluster management systems found -at the URL above. - -To use gfs as a local file system, no external clustering systems are -needed, simply: - - $ gfs2_mkfs -p lock_nolock -j 1 /dev/block_device - $ mount -t gfs2 /dev/block_device /dir - -GFS2 is not on-disk compatible with previous versions of GFS. - -The following man pages can be found at the URL above: - gfs2_mkfs to make a filesystem - gfs2_fsck to repair a filesystem - gfs2_grow to expand a filesystem online - gfs2_jadd to add journals to a filesystem online - gfs2_tool to manipulate, examine and tune a filesystem - gfs2_quota to examine and change quota values in a filesystem - mount.gfs2 to find mount options - diff --git a/doc/journaling.txt b/doc/journaling.txt deleted file mode 100644 index e89eefa..0000000 --- a/doc/journaling.txt +++ /dev/null @@ -1,155 +0,0 @@ -o Journaling & Replay - -The fundamental problem with a journaled cluster filesystem is -handling journal replay with multiple journals. A single block of -metadata can be modified sequentially by many different nodes in the -cluster. As the block is modified by each node, it gets logged in the -journal for each node. If care is not taken, it's possible to get -into a situation where a journal replay can actually corrupt a -filesystem. The error scenario is: - -1) Node A modifies a metadata block by putting a updated copy into its - incore log. -2) Node B wants to read and modify the block so it requests the lock - and a blocking callback is sent to Node A. -3) Node A flushes its incore log to disk, and then syncs out the - metadata block to its inplace location. -4) Node A then releases the lock. -5) Node B reads in the block and puts a modified copy into its ondisk - log and then the inplace block location. -6) Node A crashes. - -At this point, Node A's journal needs to be replayed. Since there is -a newer version of block inplace, if that block is replayed, the -filesystem will be corrupted. There are a few different ways of -avoiding this problem. - -1) Generation Numbers (GFS1) - - Each metadata block has header in it that contains a 64-bit - generation number. As each block is logged into a journal, the - generation number is incremented. This provides a strict ordering - of the different versions of the block a they are logged in the FS' - different journals. When journal replay happens, each block in the - journal is not replayed if generation number in the journal is less - than the generation number in place. This ensures that a newer - version of a block is never replaced with an older version. So, - this solution basically allows multiple copies of the same block in - different journals, but it allows you to always know which is the - correct one. - - Pros: - - A) This method allows the fastest callbacks. To release a lock, - the incore log for the lock must be flushed and then the inplace - data and metadata must be synced. That's it. The sync - operations involved are: start the log body and wait for it to - become stable on the disk, synchronously write the commit block, - start the inplace metadata and wait for it to become stable on - the disk. - - Cons: - - A) Maintaining the generation numbers is expensive. All newly - allocated metadata block must be read off the disk in order to - figure out what the previous value of the generation number was. - When deallocating metadata, extra work and care must be taken to - make sure dirty data isn't thrown away in such a way that the - generation numbers stop doing their thing. - B) You can't continue to modify the filesystem during journal - replay. Basically, replay of a block is a read-modify-write - operation: the block is read from disk, the generation number is - compared, and (maybe) the new version is written out. Replay - requires that the R-M-W operation is atomic with respect to - other R-M-W operations that might be happening (say by a normal - I/O process). Since journal replay doesn't (and can't) play by - the normal metadata locking rules, you can't count on them to - protect replay. Hence GFS1, quieces all writes on a filesystem - before starting replay. This provides the mutual exclusion - required, but it's slow and unnecessarily interrupts service on - the whole cluster. - -2) Total Metadata Sync (OCFS2) - - This method is really simple in that it uses exactly the same - infrastructure that a local journaled filesystem uses. Every time - a node receives a callback, it stops all metadata modification, - syncs out the whole incore journal, syncs out any dirty data, marks - the journal as being clean (unmounted), and then releases the lock. - Because journal is marked as clean and recovery won't look at any - of the journaled blocks in it, a valid copy of any particular block - only exists in one journal at a time and that journal always the - journal who modified it last. - - Pros: - - A) Very simple to implement. - B) You can reuse journaling code from other places (such as JBD). - C) No quiece necessary for replay. - D) No need for generation numbers sprinkled throughout the metadata. - - Cons: - - A) This method has the slowest possible callbacks. The sync - operations are: stop all metadata operations, start and wait for - the log body, write the log commit block, start and wait for all - the FS' dirty metadata, write an unmount block. Writing the - metadata for the whole filesystem can be particularly expensive - because it can be scattered all over the disk and there can be a - whole journal's worth of it. - -3) Revocation of a lock's buffers (GFS2) - - This method prevents a block from appearing in more than one - journal by canceling out the metadata blocks in the journal that - belong to the lock being released. Journaling works very similarly - to a local filesystem or to #2 above. - - The biggest difference is you have to keep track of buffers in the - active region of the ondisk journal, even after the inplace blocks - have been written back. This is done in GFS2 by adding a second - part to the Active Items List. The first part (in GFS2 called - AIL1) contains a list of all the blocks which have been logged to - the journal, but not written back to their inplace location. Once - an item in AIL1 has been written back to its inplace location, it - is moved to AIL2. Once the tail of the log moves past the block's - transaction in the log, it can be removed from AIL2. - - When a callback occurs, the log is flushed to the disk and the - metadata for the lock is synced to disk. At this point, any - metadata blocks for the lock that are in the current active region - of the log will be in the AIL2 list. We then build a transaction - that contains revoke tags for each buffer in the AIL2 list that - belongs to that lock. - - Pros: - - A) No quiece necessary for Replay - B) No need for generation numbers sprinkled throughout the - metadata. - C) The sync operations are: stop all metadata operations, start and - wait for the log body, write the log commit block, start and - wait for all the FS' dirty metadata, start and wait for the log - body of a transaction that revokes any of the lock's metadata - buffers in the journal's active region, and write the commit - block for that transaction. - - Cons: - - A) Recovery takes two passes, one to find all the revoke tags in - the log and one to replay the metadata blocks using the revoke - tags as a filter. This is necessary for a local filesystem and - the total sync method, too. It's just that there will probably - be more tags. - -Comparing #2 and #3, both do extra I/O during a lock callback to make -sure that any metadata blocks in the log for that lock will be -removed. I believe #2 will be slower because syncing out all the -dirty metadata for entire filesystem requires lots of little, -scattered I/O across the whole disk. The extra I/O done by #3 is a -log write to the disk. So, not only should it be less I/O, but it -should also be better suited to get good performance out of the disk -subsystem. - -KWP 07/06/05 - diff --git a/doc/min-gfs.txt b/doc/min-gfs.txt deleted file mode 100644 index af1399c..0000000 --- a/doc/min-gfs.txt +++ /dev/null @@ -1,159 +0,0 @@ - -Minimum GFS HowTo ------------------ - -The following gfs configuration requires a minimum amount of hardware and -no expensive storage system. It's the cheapest and quickest way to "play" -with gfs. - - - ---------- ---------- - | GNBD | | GNBD | - | client | | client | <-- these nodes use gfs - | node2 | | node3 | - ---------- ---------- - | | - ------------------ IP network - | - ---------- - | GNBD | - | server | <-- this node doesn't use gfs - | node1 | - ---------- - -- There are three machines to use with hostnames: node1, node2, node3 - -- node1 has an extra disk /dev/sda1 to use for gfs - (this could be hda1 or an lvm LV or an md device) - -- node1 will use gnbd to export this disk to node2 and node3 - -- Node1 cannot use gfs, it only acts as a gnbd server. - (Node1 will /not/ actually be part of the cluster since it is only - running the gnbd server.) - -- Only node2 and node3 will be in the cluster and use gfs. - (A two-node cluster is a special case for cman, noted in the config below.) - -- There's not much point to using clvm in this setup so it's left out. - -- Download the "cluster" source tree. - -- Build and install from the cluster source tree. (The kernel components - are not required on node1 which will only need the gnbd_serv program.) - - cd cluster - ./configure --kernel_src=/path/to/kernel - make; make install - -- Create /etc/cluster/cluster.conf on node2 with the following contents: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- load kernel modules on nodes - -node2 and node3> modprobe gnbd -node2 and node3> modprobe gfs -node2 and node3> modprobe lock_dlm - -- run the following commands - -node1> gnbd_serv -n -node1> gnbd_export -c -d /dev/sda1 -e global_disk - -node2 and node3> gnbd_import -n -i node1 -node2 and node3> ccsd -node2 and node3> cman_tool join -node2 and node3> fence_tool join - -node2> gfs_mkfs -p lock_dlm -t gamma:gfs1 -j 2 /dev/gnbd/global_disk - -node2 and node3> mount -t gfs /dev/gnbd/global_disk /mnt - -- the end, you now have a gfs file system mounted on node2 and node3 - - -Appendix A ----------- - -To use manual fencing instead of gnbd fencing, the cluster.conf file -would look like this: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -FAQ ---- - -- Why can't node3 use gfs, too? - -You might be able to make it work, but we recommend that you not try. -This software was not intended or designed to allow that kind of usage. - -- Isn't node3 a single point of failure? how do I avoid that? - -Yes it is. For the time being, there's no way to avoid that, apart from -not using gnbd, of course. Eventually, there will be a way to avoid this -using cluster mirroring. - -- More info from - http://sources.redhat.com/cluster/gnbd/gnbd_usage.txt - http://sources.redhat.com/cluster/doc/usage.txt - From jbrassow@fedoraproject.org Thu Jul 23 20:34:00 2009 From: jbrassow@fedoraproject.org (Jonathan Brassow) Date: Thu, 23 Jul 2009 20:34:00 -0000 Subject: cluster: RHEL5 - clogd/dm-log-clustered.ko: Fix for bugs 506843, 479749, 507400 Message-ID: <20090723203325.B9B0012022F@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=95c604973535fe61ed27b73e6f0bd098c6d3cd9c Commit: 95c604973535fe61ed27b73e6f0bd098c6d3cd9c Parent: a46a5d37522642efd6b88d4d0b1812ddf8541073 Author: Jonathan Brassow AuthorDate: Thu Jul 23 15:26:45 2009 -0500 Committer: Jonathan Brassow CommitterDate: Thu Jul 23 15:32:33 2009 -0500 clogd/dm-log-clustered.ko: Fix for bugs 506843, 479749, 507400 Device-mapper userspace logs (like the clustered log) are identified by a universally unique identifier (UUID). This identifier is used to associate requests from the kernel to a specific log in userspace. The UUID must be unique everywhere, since multiple machines may use this identifier when sharing a log, as is the case for cluster logs. Sometimes, device-mapper/LVM may re-use a UUID. This is the case during 'pvmove's, when moving from one segment of an LV to another, or when resizing a mirror, etc. In these cases, a new log is created with the same UUID and loaded in the "inactive" slot. When a device-mapper "resume" is issued, the "live" talbe is deactivated and the new "inactive" table becomes "live". (The "inactive" table can also be removed via a device-mapper 'clear' command.) The above two issues where colliding in the 3 bugs (possibly more) mentioned in the title. More than one log was being created with the same UUID, and there was no way to distinguish between them. So, sometimes the wrong log would be swapped out during the exchange. The solution is to create a 'uuid_instance', or perhaps a 'luid'. A local unique identifier to go along with the UUID. This new identifier is used to determine exactly which log is being referenced by the kernel when the log exchange is made. The identifier is not universally safe, but it does not need to be, since create/destroy/suspend/resume operations are bound to a specific machine; and these are the operations that make up the exchange. --- cmirror-kernel/src/dm-clog-tfr.c | 5 +- cmirror-kernel/src/dm-clog-tfr.h | 6 +- cmirror-kernel/src/dm-clog.c | 43 ++++++++++--- cmirror/src/cluster.c | 41 ++++++++---- cmirror/src/cluster.h | 2 +- cmirror/src/functions.c | 132 +++++++++++++++++++++----------------- cmirror/src/functions.h | 8 ++- 7 files changed, 148 insertions(+), 89 deletions(-) diff --git a/cmirror-kernel/src/dm-clog-tfr.c b/cmirror-kernel/src/dm-clog-tfr.c index 778ffb7..ddcf359 100644 --- a/cmirror-kernel/src/dm-clog-tfr.c +++ b/cmirror-kernel/src/dm-clog-tfr.c @@ -147,6 +147,7 @@ static void cn_clog_callback(void *data) /* * dm_clog_consult_server * @uuid: log's uuid (must be DM_UUID_LEN in size) + * @uuid_instance: further identifier (if more than 1 log with same uuid) * @request_type: * @data: data to tx to the server * @data_size: size of data in bytes @@ -158,7 +159,8 @@ static void cn_clog_callback(void *data) * * Returns: 0 on success, -EXXX on failure */ -int dm_clog_consult_server(const char *uuid, int request_type, +int dm_clog_consult_server(const char *uuid, uint32_t uuid_instance, + int request_type, char *data, int data_size, char *rdata, int *rdata_size) { @@ -188,6 +190,7 @@ resend: memset(tfr, 0, DM_CLOG_PREALLOCED_SIZE - overhead_size); memcpy(tfr->uuid, uuid, DM_UUID_LEN); + tfr->uuid_instance = uuid_instance; tfr->seq = seq++; tfr->request_type = request_type; tfr->data_size = data_size; diff --git a/cmirror-kernel/src/dm-clog-tfr.h b/cmirror-kernel/src/dm-clog-tfr.h index dcf7e91..802db8b 100644 --- a/cmirror-kernel/src/dm-clog-tfr.h +++ b/cmirror-kernel/src/dm-clog-tfr.h @@ -52,7 +52,8 @@ struct clog_tfr { uint64_t private[2]; char uuid[DM_UUID_LEN]; /* Ties a request to a specific mirror log */ - char uuid_padding[7]; /* DM_UUID_LEN == 129 */ + char uuid_padding[3]; /* DM_UUID_LEN == 129 */ + uint32_t uuid_instance; /* Allows more than one instance w/ same uuid */ int32_t error; /* Used by server to inform of errors */ uint32_t originator; /* Cluster ID of this machine */ @@ -68,7 +69,8 @@ struct clog_tfr { int dm_clog_tfr_init(void); void dm_clog_tfr_exit(void); -int dm_clog_consult_server(const char *uuid, int request_type, +int dm_clog_consult_server(const char *uuid, uint32_t uuid_instance, + int request_type, char *data, int data_size, char *rdata, int *rdata_size); #endif diff --git a/cmirror-kernel/src/dm-clog.c b/cmirror-kernel/src/dm-clog.c index be08331..17e7486 100644 --- a/cmirror-kernel/src/dm-clog.c +++ b/cmirror-kernel/src/dm-clog.c @@ -18,10 +18,13 @@ struct flush_entry { }; struct log_c { + struct list_head list; + struct dm_target *ti; uint32_t region_size; region_t region_count; char uuid[DM_UUID_LEN]; + uint32_t uuid_instance; char *ctr_str; /* Gives ability to restart if userspace dies */ uint32_t ctr_size; @@ -41,6 +44,8 @@ struct log_c { struct dm_dev *disk_log; }; +static struct list_head log_list_head; +static spinlock_t log_list_lock; static mempool_t *flush_entry_pool = NULL; static void *flush_entry_alloc(gfp_t gfp_mask, void *pool_data) @@ -64,7 +69,7 @@ int cluster_do_request(struct log_c *lc, const char *uuid, int request_type, * restored. */ retry: - r = dm_clog_consult_server(uuid, request_type, data, + r = dm_clog_consult_server(uuid, lc->uuid_instance, request_type, data, data_size, rdata, rdata_size); if (r != -ESRCH) @@ -75,13 +80,15 @@ retry: set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(2*HZ); DMWARN("Attempting to contact cluster log server..."); - r = dm_clog_consult_server(uuid, DM_CLOG_CTR, lc->ctr_str, + r = dm_clog_consult_server(uuid, lc->uuid_instance, + DM_CLOG_CTR, lc->ctr_str, lc->ctr_size, NULL, NULL); if (!r) break; } DMINFO("Reconnected to cluster log server... CTR complete"); - r = dm_clog_consult_server(uuid, DM_CLOG_RESUME, NULL, + r = dm_clog_consult_server(uuid, lc->uuid_instance, + DM_CLOG_RESUME, NULL, 0, NULL, NULL); if (!r) goto retry; @@ -100,7 +107,7 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti, int str_size; int offset = (disk_log) ? 1 : 0; char *ctr_str = NULL; - struct log_c *lc = NULL; + struct log_c *lc = NULL, *tmp; uint32_t region_size; region_t region_count; @@ -129,6 +136,15 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti, spin_lock_init(&lc->flush_lock); INIT_LIST_HEAD(&lc->flush_list); + lc->uuid_instance = 1; + spin_lock(&log_list_lock); + list_for_each_entry(tmp, &log_list_head, list) + if (!strncmp(tmp->uuid, lc->uuid, DM_UUID_LEN) && + (tmp->uuid_instance >= lc->uuid_instance)) + lc->uuid_instance = tmp->uuid_instance + 1; + list_add(&lc->list, &log_list_head); + spin_unlock(&log_list_lock); + for (i = 0, str_size = 0; i < argc; i++) str_size += strlen(argv[i]) + 1; /* +1 for space between args */ @@ -146,7 +162,7 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti, str_size += sprintf(ctr_str + str_size, "%llu", ti->len); /* Send table string */ - r = dm_clog_consult_server(lc->uuid, DM_CLOG_CTR, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, DM_CLOG_CTR, ctr_str, str_size, NULL, NULL); if (r == -ESRCH) @@ -242,11 +258,15 @@ static void cluster_dtr(struct dm_dirty_log *log) int r; struct log_c *lc = (struct log_c *)log->context; - r = dm_clog_consult_server(lc->uuid, DM_CLOG_DTR, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, DM_CLOG_DTR, NULL, 0, NULL, NULL); /* FIXME: What do we do on failure? */ + + spin_lock(&log_list_lock); + list_del(&lc->list); + spin_unlock(&log_list_lock); if (lc->disk_log) dm_put_device(lc->ti, lc->disk_log); kfree(lc->ctr_str); @@ -264,7 +284,8 @@ static int cluster_presuspend(struct dm_dirty_log *log) int r; struct log_c *lc = (struct log_c *)log->context; - r = dm_clog_consult_server(lc->uuid, DM_CLOG_PRESUSPEND, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, + DM_CLOG_PRESUSPEND, NULL, 0, NULL, NULL); @@ -280,7 +301,8 @@ static int cluster_postsuspend(struct dm_dirty_log *log) int r; struct log_c *lc = (struct log_c *)log->context; - r = dm_clog_consult_server(lc->uuid, DM_CLOG_POSTSUSPEND, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, + DM_CLOG_POSTSUSPEND, NULL, 0, NULL, NULL); @@ -297,7 +319,7 @@ static int cluster_resume(struct dm_dirty_log *log) struct log_c *lc = (struct log_c *)log->context; lc->in_sync_hint = 0; - r = dm_clog_consult_server(lc->uuid, DM_CLOG_RESUME, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, DM_CLOG_RESUME, NULL, 0, NULL, NULL); @@ -746,6 +768,9 @@ static int __init cluster_dirty_log_init(void) { int r = 0; + INIT_LIST_HEAD(&log_list_head); + spin_lock_init(&log_list_lock); + flush_entry_pool = mempool_create(100, flush_entry_alloc, flush_entry_free, NULL); diff --git a/cmirror/src/cluster.c b/cmirror/src/cluster.c index 63af0dd..1ecef33 100644 --- a/cmirror/src/cluster.c +++ b/cmirror/src/cluster.c @@ -82,6 +82,7 @@ static int log_resp_rec = 0; struct checkpoint_data { uint32_t requester; char uuid[CPG_MAX_NAME_LENGTH]; + uint32_t uuid_instance; int bitmap_size; /* in bytes */ char *sync_bits; @@ -101,6 +102,7 @@ struct clog_cpg { uint32_t lowest_id; cpg_handle_t handle; struct cpg_name name; + uint32_t uuid_instance; /* Are we the first, or have we received checkpoint? */ int state; @@ -144,6 +146,12 @@ int cluster_send(struct clog_tfr *tfr) return -ENOENT; } + /* + * uuid_instance is only valid per machine, it looses its meaning + * when sent to the cluster. + */ + tfr->uuid_instance = 0; + iov.iov_base = tfr; iov.iov_len = sizeof(struct clog_tfr) + tfr->data_size; @@ -349,9 +357,11 @@ static struct checkpoint_data *prepare_checkpoint(struct clog_cpg *entry, memset(new, 0, sizeof(*new)); new->requester = cp_requester; strncpy(new->uuid, entry->name.value, entry->name.length); + new->uuid_instance = entry->uuid_instance; - new->bitmap_size = push_state(entry->name.value, "clean_bits", - &new->clean_bits, cp_requester); + new->bitmap_size = push_state(entry->name.value, entry->uuid_instance, + "clean_bits", &new->clean_bits, + cp_requester); if (new->bitmap_size <= 0) { LOG_ERROR("Failed to store clean_bits to checkpoint for node %u", new->requester); @@ -359,7 +369,7 @@ static struct checkpoint_data *prepare_checkpoint(struct clog_cpg *entry, return NULL; } - new->bitmap_size = push_state(entry->name.value, + new->bitmap_size = push_state(entry->name.value, entry->uuid_instance, "sync_bits", &new->sync_bits, cp_requester); if (new->bitmap_size <= 0) { LOG_ERROR("Failed to store sync_bits to checkpoint for node %u", @@ -369,7 +379,9 @@ static struct checkpoint_data *prepare_checkpoint(struct clog_cpg *entry, return NULL; } - r = push_state(entry->name.value, "recovering_region", &new->recovering_region, cp_requester); + r = push_state(entry->name.value, entry->uuid_instance, + "recovering_region", &new->recovering_region, + cp_requester); if (r <= 0) { LOG_ERROR("Failed to store recovering_region to checkpoint for node %u", new->requester); @@ -696,7 +708,7 @@ init_retry: } if (iov.readSize) { - if (pull_state(entry->name.value, + if (pull_state(entry->name.value, entry->uuid_instance, (char *)desc.sectionId.id, bitmap, iov.readSize)) { LOG_ERROR("Error loading state"); @@ -1087,7 +1099,7 @@ static void cpg_message_callback(cpg_handle_t handle, struct cpg_name *gname, new->next = match->checkpoint_list; match->checkpoint_list = new; - } + } out: /* nothing happens after this point. It is just for debugging */ @@ -1229,7 +1241,7 @@ static void cpg_leave_callback(struct clog_cpg *match, cpg_fd_get(match->handle, &fd); links_unregister(fd); - cluster_postsuspend(match->name.value); + cluster_postsuspend(match->name.value, match->uuid_instance); list_for_each_safe(p, n, &match->working_list) { list_del_init(p); @@ -1281,7 +1293,7 @@ static void cpg_leave_callback(struct clog_cpg *match, j--; } } - match->checkpoints_needed = j; + match->checkpoints_needed = j; if (left->nodeid < my_cluster_id) { match->delay = (match->delay > 0) ? match->delay - 1 : 0; @@ -1434,7 +1446,7 @@ unlink_retry: return 1; } -int create_cluster_cpg(char *str) +int create_cluster_cpg(char *uuid, uint32_t uuid_instance) { int r; int size; @@ -1442,8 +1454,8 @@ int create_cluster_cpg(char *str) struct clog_cpg *tmp, *tmp2; list_for_each_entry_safe(tmp, tmp2, &clog_cpg_list, list) - if (!strncmp(tmp->name.value, str, CPG_MAX_NAME_LENGTH)) { - LOG_ERROR("Log entry already exists: %s", str); + if (!strncmp(tmp->name.value, uuid, CPG_MAX_NAME_LENGTH)) { + LOG_ERROR("Log entry already exists: %s", uuid); return -EEXIST; } @@ -1458,10 +1470,11 @@ int create_cluster_cpg(char *str) INIT_LIST_HEAD(&new->startup_list); INIT_LIST_HEAD(&new->working_list); - size = ((strlen(str) + 1) > CPG_MAX_NAME_LENGTH) ? - CPG_MAX_NAME_LENGTH : (strlen(str) + 1); - strncpy(new->name.value, str, size); + size = ((strlen(uuid) + 1) > CPG_MAX_NAME_LENGTH) ? + CPG_MAX_NAME_LENGTH : (strlen(uuid) + 1); + strncpy(new->name.value, uuid, size); new->name.length = size; + new->uuid_instance = uuid_instance; /* * Ensure there are no stale checkpoints around before we join diff --git a/cmirror/src/cluster.h b/cmirror/src/cluster.h index 9c98085..176024b 100644 --- a/cmirror/src/cluster.h +++ b/cmirror/src/cluster.h @@ -5,7 +5,7 @@ int init_cluster(void); void cleanup_cluster(void); void cluster_debug(void); -int create_cluster_cpg(char *str); +int create_cluster_cpg(char *uuid, uint32_t uuid_instance); int destroy_cluster_cpg(char *str); int cluster_send(struct clog_tfr *tfr); diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c index 3e0d15f..f7270a6 100644 --- a/cmirror/src/functions.c +++ b/cmirror/src/functions.c @@ -49,7 +49,7 @@ struct log_c { struct list_head list; char uuid[DM_UUID_LEN]; - uint32_t ref_count; + uint32_t uuid_instance; time_t delay; /* limits how fast a resume can happen after suspend */ int touched; @@ -148,7 +148,7 @@ static uint64_t count_bits32(uint32_t *addr, uint32_t count) * * Returns: log if found, NULL otherwise */ -static struct log_c *get_log(const char *uuid) +static struct log_c *get_log(const char *uuid, uint32_t uuid_instance) { struct list_head *l; struct log_c *lc; @@ -156,7 +156,9 @@ static struct log_c *get_log(const char *uuid) /* FIXME: Need prefetch to do this right */ __list_for_each(l, &log_list) { lc = list_entry(l, struct log_c, list); - if (!strcmp(lc->uuid, uuid)) + if (!strcmp(lc->uuid, uuid) && + (!uuid_instance || + (lc->uuid_instance == uuid_instance))) return lc; } @@ -172,7 +174,7 @@ static struct log_c *get_log(const char *uuid) * * Returns: log if found, NULL otherwise */ -static struct log_c *get_pending_log(const char *uuid) +static struct log_c *get_pending_log(const char *uuid, uint32_t uuid_instance) { struct list_head *l; struct log_c *lc; @@ -180,7 +182,9 @@ static struct log_c *get_pending_log(const char *uuid) /* FIXME: Need prefetch to do this right */ __list_for_each(l, &log_pending_list) { lc = list_entry(l, struct log_c, list); - if (!strcmp(lc->uuid, uuid)) + if (!strcmp(lc->uuid, uuid) && + (!uuid_instance || + (lc->uuid_instance == uuid_instance))) return lc; } @@ -346,7 +350,8 @@ static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_pat return r ? -errno : 0; } -static int _clog_ctr(int argc, char **argv, uint64_t device_size) +static int _clog_ctr(int argc, char **argv, uint32_t uuid_instance, + uint64_t device_size) { int i; int r = 0; @@ -435,16 +440,23 @@ static int _clog_ctr(int argc, char **argv, uint64_t device_size) lc->skip_bit_warning = region_count; lc->disk_fd = -1; lc->log_dev_failed = 0; - lc->ref_count = 1; strncpy(lc->uuid, argv[1 + disk_log], DM_UUID_LEN); + lc->uuid_instance = uuid_instance; - if ((dup = get_log(lc->uuid)) || - (dup = get_pending_log(lc->uuid))) { - LOG_DBG("[%s] Inc reference count on cluster log", - SHORT_UUID(lc->uuid)); + if ((dup = get_log(lc->uuid, lc->uuid_instance))) { + LOG_ERROR("Duplicate log UUID and uuid_instance!"); + LOG_ERROR("UUID: %s", lc->uuid); + LOG_ERROR("uuid_instance: %u", lc->uuid_instance); free(lc); - dup->ref_count++; - return 0; + return -EINVAL; + } + + if ((dup = get_pending_log(lc->uuid, lc->uuid_instance))) { + LOG_ERROR("Duplicate pending log UUID and uuid_instance!"); + LOG_ERROR("UUID: %s", lc->uuid); + LOG_ERROR("uuid_instance: %u", lc->uuid_instance); + free(lc); + return -EINVAL; } INIT_LIST_HEAD(&lc->mark_list); @@ -571,7 +583,7 @@ static int clog_ctr(struct clog_tfr *tfr) } argc--; /* We pass in the device_size separate */ - r = _clog_ctr(argc, argv, device_size); + r = _clog_ctr(argc, argv, tfr->uuid_instance, device_size); /* We join the CPG when we resume */ @@ -580,7 +592,8 @@ static int clog_ctr(struct clog_tfr *tfr) free(argv); if (r) - LOG_ERROR("Failed to create cluster log (%s)", tfr->uuid); + LOG_ERROR("Failed to create cluster log (%s)", + SHORT_UUID(tfr->uuid)); else LOG_DBG("[%s] Cluster log created", SHORT_UUID(tfr->uuid)); @@ -595,32 +608,21 @@ static int clog_ctr(struct clog_tfr *tfr) */ static int clog_dtr(struct clog_tfr *tfr) { - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (lc) { /* * The log should not be on the official list. There * should have been a suspend first. */ - lc->ref_count--; - if (!lc->ref_count) { - LOG_ERROR("[%s] DTR before SUS: leaving CPG", - SHORT_UUID(tfr->uuid)); - destroy_cluster_cpg(tfr->uuid); - } - } else if ((lc = get_pending_log(tfr->uuid))) { - lc->ref_count--; - } else { + LOG_ERROR("[%s] DTR before SUS: leaving CPG", + SHORT_UUID(tfr->uuid)); + destroy_cluster_cpg(tfr->uuid); + } else if (!(lc = get_pending_log(tfr->uuid, tfr->uuid_instance))) { LOG_ERROR("clog_dtr called on log that is not official or pending"); return -EINVAL; } - if (lc->ref_count) { - LOG_DBG("[%s] Dec reference count on cluster log", - SHORT_UUID(lc->uuid)); - return 0; - } - LOG_DBG("[%s] Cluster log removed", SHORT_UUID(lc->uuid)); list_del_init(&lc->list); @@ -642,7 +644,7 @@ static int clog_dtr(struct clog_tfr *tfr) */ static int clog_presuspend(struct clog_tfr *tfr) { - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -662,7 +664,7 @@ static int clog_presuspend(struct clog_tfr *tfr) */ static int clog_postsuspend(struct clog_tfr *tfr) { - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -683,9 +685,9 @@ static int clog_postsuspend(struct clog_tfr *tfr) * @tfr * */ -int cluster_postsuspend(char *uuid) +int cluster_postsuspend(char *uuid, uint32_t uuid_instance) { - struct log_c *lc = get_log(uuid); + struct log_c *lc = get_log(uuid, uuid_instance); if (!lc) return -EINVAL; @@ -710,7 +712,7 @@ static int clog_resume(struct clog_tfr *tfr) { uint32_t i; int commit_log = 0; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); size_t size = lc->bitset_uint32_count * sizeof(uint32_t); if (!lc) @@ -836,11 +838,11 @@ int local_resume(struct clog_tfr *tfr) { int r; time_t t; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) { /* Is the log in the pending list? */ - lc = get_pending_log(tfr->uuid); + lc = get_pending_log(tfr->uuid, tfr->uuid_instance); if (!lc) { LOG_ERROR("clog_resume called on log that is not official or pending"); return -EINVAL; @@ -875,12 +877,22 @@ int local_resume(struct clog_tfr *tfr) sleep(3 - t); /* Join the CPG */ - r = create_cluster_cpg(tfr->uuid); + r = create_cluster_cpg(tfr->uuid, tfr->uuid_instance); if (r) { LOG_ERROR("clog_resume: Failed to create cluster CPG"); return r; } + if (get_log(lc->uuid, lc->uuid_instance)) { + /* + * Not being able to identify a log uniquely is fatal, + * and represents a programming error. + */ + LOG_ERROR("[%s/%u] DUPLICATE LOG WITH SAME UUID[_INSTANCE]!", + SHORT_UUID(lc->uuid), lc->uuid_instance); + exit(EXIT_FAILURE); + } + /* move log to official list */ list_del_init(&lc->list); list_add(&lc->list, &log_list); @@ -902,7 +914,7 @@ int local_resume(struct clog_tfr *tfr) static int clog_get_region_size(struct clog_tfr *tfr) { uint64_t *rtn = (uint64_t *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); LOG_PRINT("WARNING: kernel should not be calling clog_get_region_size"); if (!lc) @@ -925,7 +937,7 @@ static int clog_is_clean(struct clog_tfr *tfr) { int *rtn = (int *)tfr->data; uint64_t region = *((uint64_t *)(tfr->data)); - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -950,7 +962,7 @@ static int clog_in_sync(struct clog_tfr *tfr) { int *rtn = (int *)tfr->data; uint64_t region = *((uint64_t *)(tfr->data)); - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -979,7 +991,7 @@ static int clog_in_sync(struct clog_tfr *tfr) static int clog_flush(struct clog_tfr *tfr, int server) { int r = 0; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1067,7 +1079,7 @@ static int clog_mark_region(struct clog_tfr *tfr) int r; int count; uint64_t *region; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1134,7 +1146,7 @@ static int clog_clear_region(struct clog_tfr *tfr) int r; int count; uint64_t *region; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1170,7 +1182,7 @@ static int clog_get_resync_work(struct clog_tfr *tfr) uint32_t arch_padding; uint64_t r; } *pkg = (void *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1264,7 +1276,7 @@ static int clog_set_region_sync(struct clog_tfr *tfr) uint32_t arch_padding; int32_t in_sync; } *pkg = (void *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1343,7 +1355,7 @@ static int clog_set_region_sync(struct clog_tfr *tfr) static int clog_get_sync_count(struct clog_tfr *tfr) { uint64_t *sync_count = (uint64_t *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); /* * FIXME: Mirror requires us to be able to ask for @@ -1352,7 +1364,7 @@ static int clog_get_sync_count(struct clog_tfr *tfr) * the stored value may not be accurate. */ if (!lc) - lc = get_pending_log(tfr->uuid); + lc = get_pending_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1411,10 +1423,10 @@ static int disk_status_info(struct log_c *lc, struct clog_tfr *tfr) static int clog_status_info(struct clog_tfr *tfr) { int r; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) - lc = get_pending_log(tfr->uuid); + lc = get_pending_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1470,10 +1482,10 @@ static int disk_status_table(struct log_c *lc, struct clog_tfr *tfr) static int clog_status_table(struct clog_tfr *tfr) { int r; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) - lc = get_pending_log(tfr->uuid); + lc = get_pending_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1499,7 +1511,7 @@ static int clog_is_remote_recovering(struct clog_tfr *tfr) uint32_t arch_padding; uint64_t in_sync_hint; } *pkg = (void *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1680,7 +1692,8 @@ static void print_bits(char *buf, int size, int print) } /* int store_bits(const char *uuid, const char *which, char **buf)*/ -int push_state(const char *uuid, const char *which, char **buf, uint32_t debug_who) +int push_state(const char *uuid, uint32_t uuid_instance, const char *which, + char **buf, uint32_t debug_who) { int bitset_size; struct log_c *lc; @@ -1688,7 +1701,7 @@ int push_state(const char *uuid, const char *which, char **buf, uint32_t debug_w if (*buf) LOG_ERROR("store_bits: *buf != NULL"); - lc = get_log(uuid); + lc = get_log(uuid, uuid_instance); if (!lc) { LOG_ERROR("store_bits: No log found for %s", uuid); return -EINVAL; @@ -1734,7 +1747,8 @@ int push_state(const char *uuid, const char *which, char **buf, uint32_t debug_w } /*int load_bits(const char *uuid, const char *which, char *buf, int size)*/ -int pull_state(const char *uuid, const char *which, char *buf, int size) +int pull_state(const char *uuid, uint32_t uuid_instance, + const char *which, char *buf, int size) { int bitset_size; struct log_c *lc; @@ -1742,7 +1756,7 @@ int pull_state(const char *uuid, const char *which, char *buf, int size) if (!buf) LOG_ERROR("pull_state: buf == NULL"); - lc = get_log(uuid); + lc = get_log(uuid, uuid_instance); if (!lc) { LOG_ERROR("pull_state: No log found for %s", uuid); return -EINVAL; @@ -1786,7 +1800,7 @@ int log_get_state(struct clog_tfr *tfr) { struct log_c *lc; - lc = get_log(tfr->uuid); + lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; diff --git a/cmirror/src/functions.h b/cmirror/src/functions.h index 7c01c64..63ed49a 100644 --- a/cmirror/src/functions.h +++ b/cmirror/src/functions.h @@ -7,11 +7,13 @@ #define LOG_SUSPENDED 2 int local_resume(struct clog_tfr *tfr); -int cluster_postsuspend(char *); +int cluster_postsuspend(char *, uint32_t); int do_request(struct clog_tfr *tfr, int server); -int push_state(const char *uuid, const char *which, char **buf, uint32_t debug_who); -int pull_state(const char *uuid, const char *which, char *buf, int size); +int push_state(const char *uuid, uint32_t uuid_instance, + const char *which, char **buf, uint32_t debug_who); +int pull_state(const char *uuid, uint32_t uuid_instance, + const char *which, char *buf, int size); int log_get_state(struct clog_tfr *tfr); int log_status(void); From swhiteho@fedoraproject.org Fri Jul 24 09:56:00 2009 From: swhiteho@fedoraproject.org (Steven Whitehouse) Date: Fri, 24 Jul 2009 09:56:00 -0000 Subject: gfs2-utils: master - doc: Add diagram of how things fit together Message-ID: <20090724095317.2E682120362@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=619671c51ca766a72dfa9884c361f900aebc5c83 Commit: 619671c51ca766a72dfa9884c361f900aebc5c83 Parent: 7a5b9055ce63203dfe355d81bb98d1a00d6234b4 Author: Steven Whitehouse AuthorDate: Fri Jul 24 11:50:05 2009 +0100 Committer: Steven Whitehouse CommitterDate: Fri Jul 24 11:50:05 2009 +0100 doc: Add diagram of how things fit together Adding a diagram of the communication paths between the various cluster bits. Still needs some additions, but most of it is there. Signed-off-by: Steven Whitehouse --- doc/cluster.fig | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 102 insertions(+), 0 deletions(-) diff --git a/doc/cluster.fig b/doc/cluster.fig new file mode 100644 index 0000000..b896a10 --- /dev/null +++ b/doc/cluster.fig @@ -0,0 +1,102 @@ +#FIG 3.2 Produced by xfig version 3.2.5a +Landscape +Center +Inches +Letter +100.00 +Single +-2 +1200 2 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 1 7332.065 8049.457 3900 5025 3075 6375 2775 7650 + 1 1 1.00 60.00 120.00 + 1 0 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 2640.072 5956.954 3300 7650 4275 6750 4200 5025 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 1 2812.500 5137.500 2175 4350 2775 4125 3450 4350 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 1 3770.455 7155.682 1650 5925 2700 4950 3450 4725 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 0 1 9962.903 13539.746 9075 5025 4950 6600 3750 7650 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 0 10339.926 6368.284 9300 5025 8700 5925 9225 7650 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 0 0 1 7917.672 6484.914 9525 5025 10050 6075 9750 7650 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 1 7531.731 2331.731 4125 3975 3750 2400 3900 1275 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 1 10477.754 2669.174 8850 3975 8400 2475 8925 1275 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 1 6825.000 2625.000 9675 3975 9975 2475 9675 1275 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 1 2690.779 2326.844 5025 1275 5250 2400 4650 3975 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 1 6675.000 6531.250 5250 4500 6675 4050 8100 4500 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 1 10499.364 5185.805 9900 4500 10500 4275 11175 4575 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 1 6478.423 21308.838 3975 8175 5925 7950 8550 8100 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 1 6102.404 -1403.365 3975 8400 5850 8625 8550 8325 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +5 1 0 1 0 7 50 -1 -1 0.000 0 1 1 1 9490.909 6835.048 11400 7650 11475 6225 9900 4800 + 1 1 1.00 60.00 120.00 + 1 1 1.00 60.00 120.00 +1 2 0 1 0 4 100 -1 20 0.000 1 0.0000 8534 4503 3825 600 4709 4503 12359 4503 +1 2 0 1 0 4 100 -1 20 0.000 1 0.0000 1961 4596 1575 2250 386 4596 3536 4596 +2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 + 225 7425 12825 7425 +2 4 0 1 0 6 50 -1 20 0.000 0 0 7 0 0 5 + 12675 1275 600 1275 600 375 12675 375 12675 1275 +2 4 0 1 0 1 50 -1 20 0.000 0 0 7 0 0 5 + 3975 8625 825 8625 825 7650 3975 7650 3975 8625 +2 4 0 1 0 1 50 -1 20 0.000 0 0 7 0 0 5 + 12225 8550 8550 8550 8550 7650 12225 7650 12225 8550 +2 4 0 1 0 2 50 -1 20 0.000 0 0 7 0 0 5 + 2250 6975 375 6975 375 5925 2250 5925 2250 6975 +2 4 0 1 0 2 50 -1 20 0.000 0 0 7 0 0 5 + 2175 5025 300 5025 300 3975 2175 3975 2175 5025 +2 4 0 1 0 6 50 -1 20 0.000 0 0 7 0 0 5 + 5250 5025 3450 5025 3450 3975 5250 3975 5250 5025 +2 4 0 1 0 6 50 -1 20 0.000 0 0 7 0 0 5 + 9900 5025 8100 5025 8100 3975 9900 3975 9900 5025 +2 4 0 1 0 2 50 -1 20 0.000 0 0 7 0 0 5 + 13050 5025 11175 5025 11175 3975 13050 3975 13050 5025 +4 0 0 50 -1 0 12 0.0000 4 180 780 4050 900 Corosync\001 +4 0 0 50 -1 0 12 0.0000 4 180 930 675 4650 gfs_control\001 +4 0 0 50 -1 0 12 0.0000 4 180 1035 3825 4575 gfs_controld\001 +4 0 0 50 -1 0 12 0.0000 4 180 1035 825 6525 mount.gfs[2]\001 +4 0 0 50 -1 0 12 0.0000 4 165 570 1950 8250 GFS[2]\001 +4 0 0 50 -1 0 12 0.0000 4 135 435 9900 8175 DLM\001 +4 0 0 50 -1 0 12 0.0000 4 135 540 5100 7650 Kernel\001 +4 0 0 50 -1 0 12 0.0000 4 180 810 5100 7350 Userspace\001 +4 0 0 50 -1 0 12 0.0000 4 180 420 6375 6000 Sysfs\001 +4 0 0 50 -1 0 12 0.0000 4 135 1005 2400 5325 Unix Socket\001 +4 0 0 50 -1 0 12 0.0000 4 135 1005 2400 4050 Unix Socket\001 +4 0 0 50 -1 0 12 0.0000 4 135 585 4500 5625 Uevent\001 +4 0 0 50 -1 0 12 0.0000 4 180 420 8700 6375 Sysfs\001 +4 0 0 50 -1 0 12 0.0000 4 135 585 10050 5775 Uevent\001 +4 0 0 50 -1 0 12 4.7124 4 180 2235 3525 1575 CPG "gfs:mount:"\001 +4 0 0 50 -1 0 12 4.7124 4 180 1560 4875 1575 CPG "gfs:controld"\001 +4 0 0 50 -1 0 12 4.7124 4 135 1635 8700 1800 CPG "dlm:controld"\001 +4 0 0 50 -1 0 12 4.7124 4 135 1920 10050 1725 GPG "dlm:ls:"\001 +4 0 0 50 -1 0 12 0.0000 4 165 1110 8550 4575 dlm_controld\001 +4 0 0 50 -1 0 12 0.0000 4 165 1005 11625 4575 dlm_control\001 +4 0 0 50 -1 0 12 0.0000 4 135 1005 10050 4200 Unix Socket\001 +4 0 0 50 -1 0 12 0.0000 4 180 2160 5100 8775 Posix lock requests/replies\001 +4 0 0 50 -1 0 12 0.0000 4 180 2370 5850 7875 DLM lock requests/callbacks\001 +4 0 0 50 -1 0 12 0.0000 4 165 1050 11550 6150 (Posix locks)\001 +4 0 0 50 -1 0 12 0.0000 4 135 1020 11475 5925 Misc Device\001 +4 0 0 50 -1 0 12 0.0000 4 135 1005 6225 4275 Unix Socket\001 +4 0 4 50 -1 0 12 0.0000 4 135 1125 6975 3825 libdlmcontrol\001 +4 0 4 50 -1 0 12 0.0000 4 180 1050 1350 2250 libgfscontrol\001 +4 0 0 50 -1 0 12 0.0000 4 180 420 3000 6750 Sysfs\001 From marx@fedoraproject.org Fri Jul 24 11:47:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Fri, 24 Jul 2009 11:47:00 -0000 Subject: cluster: RHEL54 - fencing: #501586 - fence agents fails with pexpect exception Message-ID: <20090724114655.D25E1120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=82a489cba5637cfcebf43a6e8b3312e8a4555351 Commit: 82a489cba5637cfcebf43a6e8b3312e8a4555351 Parent: 188db164825505dfecd32b8eb4a53a1349557280 Author: Marek Grac AuthorDate: Thu Jul 23 11:32:41 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Fri Jul 24 13:42:20 2009 +0200 fencing: #501586 - fence agents fails with pexpect exception Added import exceptions. Fence agent for VMWare was not checked for these exceptions. --- fence/agents/bladecenter/fence_bladecenter.py | 2 +- fence/agents/drac/fence_drac5.py | 2 +- fence/agents/lpar/fence_lpar.py | 2 +- fence/agents/rsa/fence_rsa.py | 2 +- fence/agents/virsh/fence_virsh.py | 2 +- fence/agents/vmware/fence_vmware.py | 11 ++++++++--- fence/agents/wti/fence_wti.py | 2 +- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/fence/agents/bladecenter/fence_bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py index 3e7204a..518f6a6 100755 --- a/fence/agents/bladecenter/fence_bladecenter.py +++ b/fence/agents/bladecenter/fence_bladecenter.py @@ -13,7 +13,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py index 556ccb3..cdea52c 100755 --- a/fence/agents/drac/fence_drac5.py +++ b/fence/agents/drac/fence_drac5.py @@ -12,7 +12,7 @@ ## @note: drac_version was removed ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/lpar/fence_lpar.py b/fence/agents/lpar/fence_lpar.py index 6e0d848..4c6f997 100755 --- a/fence/agents/lpar/fence_lpar.py +++ b/fence/agents/lpar/fence_lpar.py @@ -11,7 +11,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index e7f131c..e2ec4dd 100755 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -7,7 +7,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * diff --git a/fence/agents/virsh/fence_virsh.py b/fence/agents/virsh/fence_virsh.py index 15885c6..c5eb935 100644 --- a/fence/agents/virsh/fence_virsh.py +++ b/fence/agents/virsh/fence_virsh.py @@ -6,7 +6,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py index 3cbb900..1aa0a1e 100755 --- a/fence/agents/vmware/fence_vmware.py +++ b/fence/agents/vmware/fence_vmware.py @@ -7,7 +7,7 @@ ## ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * @@ -104,8 +104,13 @@ def main(): ## ## Logout from system ###### - conn.sendline("logout") - conn.close() + try: + conn.sendline("logout") + conn.close() + except exceptions.OSError: + pass + except pexpect.ExceptionPexpect: + pass if __name__ == "__main__": main() diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py index 5740cd4..e20a16c 100755 --- a/fence/agents/wti/fence_wti.py +++ b/fence/agents/wti/fence_wti.py @@ -12,7 +12,7 @@ ## WTI IPS-800-CE v1.40h (no username) ##### -import sys, re, pexpect +import sys, re, pexpect, exceptions sys.path.append("/usr/lib/fence") from fencing import * From rpeterso@fedoraproject.org Fri Jul 24 15:00:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Fri, 24 Jul 2009 15:00:00 -0000 Subject: gfs2-utils: master - Fix more man page references to gfs2_fsck Message-ID: <20090724150019.49523120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=ddcef5918351da50754670cb524e41f163077578 Commit: ddcef5918351da50754670cb524e41f163077578 Parent: 619671c51ca766a72dfa9884c361f900aebc5c83 Author: Bob Peterson AuthorDate: Fri Jul 24 09:16:19 2009 -0500 Committer: Bob Peterson CommitterDate: Fri Jul 24 10:02:11 2009 -0500 Fix more man page references to gfs2_fsck bz 477072 --- gfs2/man/gfs2_edit.8 | 4 ++-- gfs2/man/gfs2_grow.8 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gfs2/man/gfs2_edit.8 b/gfs2/man/gfs2_edit.8 index df1ebbc..2546c7b 100644 --- a/gfs2/man/gfs2_edit.8 +++ b/gfs2/man/gfs2_edit.8 @@ -84,7 +84,7 @@ Valid block allocation types are: 0 (Free block), 1 (Data block), 2 (Unlinked block), and 3 (Metadata block). If a value from 0 to 3 is specified, the resource group bitmap will be changed to the new value. This may be used, for example, to artificially free or allocate a block -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. Optionally, you may specify the keyword \fIblockbits\fR. This option will locate and print the block containing the bitmap corresponding to @@ -118,7 +118,7 @@ and resource groups are allowed. If no value is specified after the field, the value of the field will be printed to stdout. If a value is specified, the field's value will be changed. This may be used, for example, to artificially change the di_size field for an inode -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. .TP \fB-s\fs [\fIstructure\fR | \fIblock\fR] diff --git a/gfs2/man/gfs2_grow.8 b/gfs2/man/gfs2_grow.8 index a38f471..317d4f2 100644 --- a/gfs2/man/gfs2_grow.8 +++ b/gfs2/man/gfs2_grow.8 @@ -34,7 +34,7 @@ You can run gfs2_grow with the \fB-T\fP flag to get a display of the current state of a mounted GFS2 filesystem. The gfs2_grow tool uses the resource group (RG) size that was originally -calculated when mkfs.gfs2 was done. This allows tools like gfs2_fsck +calculated when mkfs.gfs2 was done. This allows tools like fsck.gfs2 to better ensure the integrity of the file system. Since the new free space often does not lie on even boundaries based on that RG size, there may be some unused space on the device after gfs2_grow is run. From rpeterso@fedoraproject.org Fri Jul 24 15:01:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Fri, 24 Jul 2009 15:01:00 -0000 Subject: cluster: STABLE3 - Fix more man page references to gfs2_fsck Message-ID: <20090724150122.D8192120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9aa2ca042b0108c3ecb9ea5f3e0257e8afbbf673 Commit: 9aa2ca042b0108c3ecb9ea5f3e0257e8afbbf673 Parent: 6f83ab05ad47c5fe242d7840388db955c20c4ece Author: Bob Peterson AuthorDate: Fri Jul 24 09:16:19 2009 -0500 Committer: Bob Peterson CommitterDate: Fri Jul 24 09:57:23 2009 -0500 Fix more man page references to gfs2_fsck bz 477072 --- gfs2/man/gfs2_edit.8 | 4 ++-- gfs2/man/gfs2_grow.8 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gfs2/man/gfs2_edit.8 b/gfs2/man/gfs2_edit.8 index df1ebbc..2546c7b 100644 --- a/gfs2/man/gfs2_edit.8 +++ b/gfs2/man/gfs2_edit.8 @@ -84,7 +84,7 @@ Valid block allocation types are: 0 (Free block), 1 (Data block), 2 (Unlinked block), and 3 (Metadata block). If a value from 0 to 3 is specified, the resource group bitmap will be changed to the new value. This may be used, for example, to artificially free or allocate a block -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. Optionally, you may specify the keyword \fIblockbits\fR. This option will locate and print the block containing the bitmap corresponding to @@ -118,7 +118,7 @@ and resource groups are allowed. If no value is specified after the field, the value of the field will be printed to stdout. If a value is specified, the field's value will be changed. This may be used, for example, to artificially change the di_size field for an inode -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. .TP \fB-s\fs [\fIstructure\fR | \fIblock\fR] diff --git a/gfs2/man/gfs2_grow.8 b/gfs2/man/gfs2_grow.8 index a38f471..317d4f2 100644 --- a/gfs2/man/gfs2_grow.8 +++ b/gfs2/man/gfs2_grow.8 @@ -34,7 +34,7 @@ You can run gfs2_grow with the \fB-T\fP flag to get a display of the current state of a mounted GFS2 filesystem. The gfs2_grow tool uses the resource group (RG) size that was originally -calculated when mkfs.gfs2 was done. This allows tools like gfs2_fsck +calculated when mkfs.gfs2 was done. This allows tools like fsck.gfs2 to better ensure the integrity of the file system. Since the new free space often does not lie on even boundaries based on that RG size, there may be some unused space on the device after gfs2_grow is run. From rpeterso@fedoraproject.org Fri Jul 24 15:02:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Fri, 24 Jul 2009 15:02:00 -0000 Subject: cluster: STABLE2 - Fix more man page references to gfs2_fsck Message-ID: <20090724150144.A8EA4120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9d256d792a6a1812fcbf0a044a84de8c823a8d65 Commit: 9d256d792a6a1812fcbf0a044a84de8c823a8d65 Parent: 06cf4e24b7100ab26447c81e10eb755f3959a0ac Author: Bob Peterson AuthorDate: Fri Jul 24 09:16:19 2009 -0500 Committer: Bob Peterson CommitterDate: Fri Jul 24 10:04:32 2009 -0500 Fix more man page references to gfs2_fsck bz 477072 --- gfs2/man/gfs2_edit.8 | 4 ++-- gfs2/man/gfs2_grow.8 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gfs2/man/gfs2_edit.8 b/gfs2/man/gfs2_edit.8 index df1ebbc..2546c7b 100644 --- a/gfs2/man/gfs2_edit.8 +++ b/gfs2/man/gfs2_edit.8 @@ -84,7 +84,7 @@ Valid block allocation types are: 0 (Free block), 1 (Data block), 2 (Unlinked block), and 3 (Metadata block). If a value from 0 to 3 is specified, the resource group bitmap will be changed to the new value. This may be used, for example, to artificially free or allocate a block -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. Optionally, you may specify the keyword \fIblockbits\fR. This option will locate and print the block containing the bitmap corresponding to @@ -118,7 +118,7 @@ and resource groups are allowed. If no value is specified after the field, the value of the field will be printed to stdout. If a value is specified, the field's value will be changed. This may be used, for example, to artificially change the di_size field for an inode -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. .TP \fB-s\fs [\fIstructure\fR | \fIblock\fR] diff --git a/gfs2/man/gfs2_grow.8 b/gfs2/man/gfs2_grow.8 index bd37328..ec7e6dc 100644 --- a/gfs2/man/gfs2_grow.8 +++ b/gfs2/man/gfs2_grow.8 @@ -34,7 +34,7 @@ You can run gfs2_grow with the \fB-T\fP flag to get a display of the current state of a mounted GFS2 filesystem. The gfs2_grow tool uses the resource group (RG) size that was originally -calculated when mkfs.gfs2 was done. This allows tools like gfs2_fsck +calculated when mkfs.gfs2 was done. This allows tools like fsck.gfs2 to better ensure the integrity of the file system. Since the new free space often does not lie on even boundaries based on that RG size, there may be some unused space on the device after gfs2_grow is run. From rpeterso@fedoraproject.org Fri Jul 24 15:03:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Fri, 24 Jul 2009 15:03:00 -0000 Subject: cluster: RHEL5 - Fix more man page references to gfs2_fsck Message-ID: <20090724150324.E0E06120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=470a0f93bc2071a1ef26177b854cd7279730c247 Commit: 470a0f93bc2071a1ef26177b854cd7279730c247 Parent: 95c604973535fe61ed27b73e6f0bd098c6d3cd9c Author: Bob Peterson AuthorDate: Fri Jul 24 09:16:19 2009 -0500 Committer: Bob Peterson CommitterDate: Fri Jul 24 09:16:19 2009 -0500 Fix more man page references to gfs2_fsck bz 477072 --- gfs2/man/gfs2_edit.8 | 4 ++-- gfs2/man/gfs2_grow.8 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gfs2/man/gfs2_edit.8 b/gfs2/man/gfs2_edit.8 index a14f2b4..d133956 100644 --- a/gfs2/man/gfs2_edit.8 +++ b/gfs2/man/gfs2_edit.8 @@ -86,7 +86,7 @@ Valid block allocation types are: 0 (Free block), 1 (Data block), 2 (Unlinked block), and 3 (Metadata block). If a value from 0 to 3 is specified, the resource group bitmap will be changed to the new value. This may be used, for example, to artificially free or allocate a block -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. Optionally, you may specify the keyword \fIblockbits\fR. This option will locate and print the block containing the bitmap corresponding to @@ -120,7 +120,7 @@ and resource groups are allowed. If no value is specified after the field, the value of the field will be printed to stdout. If a value is specified, the field's value will be changed. This may be used, for example, to artificially change the di_size field for an inode -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. .TP \fB-s\fs [\fIstructure\fR | \fIblock\fR] diff --git a/gfs2/man/gfs2_grow.8 b/gfs2/man/gfs2_grow.8 index 30e9e30..4f2ee36 100644 --- a/gfs2/man/gfs2_grow.8 +++ b/gfs2/man/gfs2_grow.8 @@ -37,7 +37,7 @@ You can run gfs2_grow with the \fB-T\fP flag to get a display of the current state of a mounted GFS2 filesystem. The gfs2_grow tool uses the resource group (RG) size that was originally -calculated when mkfs.gfs2 was done. This allows tools like gfs2_fsck +calculated when mkfs.gfs2 was done. This allows tools like fsck.gfs2 to better ensure the integrity of the file system. Since the new free space often does not lie on even boundaries based on that RG size, there may be some unused space on the device after gfs2_grow is run. From rpeterso@fedoraproject.org Fri Jul 24 15:04:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Fri, 24 Jul 2009 15:04:00 -0000 Subject: cluster: RHEL54 - Fix more man page references to gfs2_fsck Message-ID: <20090724150357.9D7F6120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=6326334d93408ebe5ec43d0bef6365c7c82e8849 Commit: 6326334d93408ebe5ec43d0bef6365c7c82e8849 Parent: 82a489cba5637cfcebf43a6e8b3312e8a4555351 Author: Bob Peterson AuthorDate: Fri Jul 24 09:16:19 2009 -0500 Committer: Bob Peterson CommitterDate: Fri Jul 24 10:06:45 2009 -0500 Fix more man page references to gfs2_fsck bz 477072 --- gfs2/man/gfs2_edit.8 | 4 ++-- gfs2/man/gfs2_grow.8 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gfs2/man/gfs2_edit.8 b/gfs2/man/gfs2_edit.8 index a14f2b4..d133956 100644 --- a/gfs2/man/gfs2_edit.8 +++ b/gfs2/man/gfs2_edit.8 @@ -86,7 +86,7 @@ Valid block allocation types are: 0 (Free block), 1 (Data block), 2 (Unlinked block), and 3 (Metadata block). If a value from 0 to 3 is specified, the resource group bitmap will be changed to the new value. This may be used, for example, to artificially free or allocate a block -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. Optionally, you may specify the keyword \fIblockbits\fR. This option will locate and print the block containing the bitmap corresponding to @@ -120,7 +120,7 @@ and resource groups are allowed. If no value is specified after the field, the value of the field will be printed to stdout. If a value is specified, the field's value will be changed. This may be used, for example, to artificially change the di_size field for an inode -in order to test gfs2_fsck's ability to detect and fix the problem. +in order to test fsck.gfs2's ability to detect and fix the problem. .TP \fB-s\fs [\fIstructure\fR | \fIblock\fR] diff --git a/gfs2/man/gfs2_grow.8 b/gfs2/man/gfs2_grow.8 index 30e9e30..4f2ee36 100644 --- a/gfs2/man/gfs2_grow.8 +++ b/gfs2/man/gfs2_grow.8 @@ -37,7 +37,7 @@ You can run gfs2_grow with the \fB-T\fP flag to get a display of the current state of a mounted GFS2 filesystem. The gfs2_grow tool uses the resource group (RG) size that was originally -calculated when mkfs.gfs2 was done. This allows tools like gfs2_fsck +calculated when mkfs.gfs2 was done. This allows tools like fsck.gfs2 to better ensure the integrity of the file system. Since the new free space often does not lie on even boundaries based on that RG size, there may be some unused space on the device after gfs2_grow is run. From chrissie@fedoraproject.org Mon Jul 27 10:44:00 2009 From: chrissie@fedoraproject.org (Christine Caulfield) Date: Mon, 27 Jul 2009 10:44:00 -0000 Subject: cluster: master - cman: Improve cman_tool startup error reporting Message-ID: <20090727104403.82F03120376@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9309c9289a63c0cd583438faa2212401f860a316 Commit: 9309c9289a63c0cd583438faa2212401f860a316 Parent: 6d04c956635a0af1ac96d23ecc93806c1e4acd79 Author: Christine Caulfield AuthorDate: Mon Jul 27 11:43:02 2009 +0100 Committer: Christine Caulfield CommitterDate: Mon Jul 27 11:43:02 2009 +0100 cman: Improve cman_tool startup error reporting Several errors that can be generated by cman-preconfig get discarded and replaced with a rather cursory and unhelpful "corosync died: Could not read cluster configuration" Now we print the messages passed back before examining the corosync exit status. Signed-off-by: Christine Caulfield --- cman/cman_tool/join.c | 6 +++++- cman/config/cman-preconfig.c | 14 +++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/cman/cman_tool/join.c b/cman/cman_tool/join.c index 2245eb3..630e31a 100644 --- a/cman/cman_tool/join.c +++ b/cman/cman_tool/join.c @@ -274,7 +274,7 @@ int join(commandline_t *comline, char *main_envp[]) fprintf(stderr, "forked process ID is %d\n", corosync_pid); status = 1; - /* There might be a SUCCESS message in the pipe too. */ + /* There might be a SUCCESS or error message in the pipe too. */ messageptr = strchr(messageptr, '\n'); if (messageptr) messageptr++; @@ -288,6 +288,10 @@ int join(commandline_t *comline, char *main_envp[]) status = 0; break; } + else if (messageptr) { + fprintf(stderr, "%s\n", messageptr); + break; + } } else if (len < 0 && errno == EINTR) { continue; diff --git a/cman/config/cman-preconfig.c b/cman/config/cman-preconfig.c index b164080..1ba48ae 100644 --- a/cman/config/cman-preconfig.c +++ b/cman/config/cman-preconfig.c @@ -565,20 +565,24 @@ static int get_nodename(struct objdb_iface_ver0 *objdb) error = uname(&utsname); if (error) { sprintf(error_reason, "cannot get node name, uname failed"); + write_cman_pipe("Can't determine local node name, uname failed"); error = -1; goto out; } if (strlen(utsname.nodename) >= sizeof(nodename)) { sprintf(error_reason, "node name from uname is too long"); + write_cman_pipe("local node name is too long"); error = -1; goto out; } strcpy(nodename, utsname.nodename); } - if (verify_nodename(objdb, nodename)) + if (verify_nodename(objdb, nodename)) { + write_cman_pipe("Cannot find node name in cluster.conf"); return -1; + } } @@ -641,8 +645,10 @@ static int get_nodename(struct objdb_iface_ver0 *objdb) free(str); } - if (add_ifaddr(objdb, mcast_name, nodename, portnum, broadcast)) + if (add_ifaddr(objdb, mcast_name, nodename, portnum, broadcast)) { + write_cman_pipe(error_reason); return -1; + } /* Get all alternative node names */ num_nodenames = 1; @@ -662,8 +668,10 @@ static int get_nodename(struct objdb_iface_ver0 *objdb) mcast = mcast_name; } - if (add_ifaddr(objdb, mcast, node, portnum, broadcast)) + if (add_ifaddr(objdb, mcast, node, portnum, broadcast)) { + write_cman_pipe(error_reason); return -1; + } num_nodenames++; } From jbrassow@fedoraproject.org Mon Jul 27 18:10:00 2009 From: jbrassow@fedoraproject.org (Jonathan Brassow) Date: Mon, 27 Jul 2009 18:10:00 -0000 Subject: cluster: RHEL54 - clogd/dm-log-clustered.ko: Fix for bugs 506843, 479749, 507400 Message-ID: <20090727180946.2B9F012022D@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=fa15cb16f0de9ddf06ddb50f2fcf26dd9c257931 Commit: fa15cb16f0de9ddf06ddb50f2fcf26dd9c257931 Parent: 6326334d93408ebe5ec43d0bef6365c7c82e8849 Author: Jonathan Brassow AuthorDate: Mon Jul 27 13:07:36 2009 -0500 Committer: Jonathan Brassow CommitterDate: Mon Jul 27 13:09:26 2009 -0500 clogd/dm-log-clustered.ko: Fix for bugs 506843, 479749, 507400 Device-mapper userspace logs (like the clustered log) are identified by a universally unique identifier (UUID). This identifier is used to associate requests from the kernel to a specific log in userspace. The UUID must be unique everywhere, since multiple machines may use this identifier when sharing a log, as is the case for cluster logs. Sometimes, device-mapper/LVM may re-use a UUID. This is the case during 'pvmove's, when moving from one segment of an LV to another, or when resizing a mirror, etc. In these cases, a new log is created with the same UUID and loaded in the "inactive" slot. When a device-mapper "resume" is issued, the "live" talbe is deactivated and the new "inactive" table becomes "live". (The "inactive" table can also be removed via a device-mapper 'clear' command.) The above two issues where colliding in the 3 bugs (possibly more) mentioned in the title. More than one log was being created with the same UUID, and there was no way to distinguish between them. So, sometimes the wrong log would be swapped out during the exchange. The solution is to create a 'uuid_instance', or perhaps a 'luid'. A local unique identifier to go along with the UUID. This new identifier is used to determine exactly which log is being referenced by the kernel when the log exchange is made. The identifier is not universally safe, but it does not need to be, since create/destroy/suspend/resume operations are bound to a specific machine; and these are the operations that make up the exchange. --- cmirror-kernel/src/dm-clog-tfr.c | 7 +- cmirror-kernel/src/dm-clog-tfr.h | 9 ++- cmirror-kernel/src/dm-clog.c | 61 ++++++++++++--- cmirror/src/cluster.c | 41 +++++++---- cmirror/src/cluster.h | 2 +- cmirror/src/functions.c | 155 ++++++++++++++++++++++---------------- cmirror/src/functions.h | 8 +- cmirror/src/local.c | 1 + 8 files changed, 185 insertions(+), 99 deletions(-) diff --git a/cmirror-kernel/src/dm-clog-tfr.c b/cmirror-kernel/src/dm-clog-tfr.c index 3ceb320..ddcf359 100644 --- a/cmirror-kernel/src/dm-clog-tfr.c +++ b/cmirror-kernel/src/dm-clog-tfr.c @@ -105,7 +105,7 @@ static int fill_pkg(struct cn_msg *msg, struct clog_tfr *tfr) } else if (tfr->data_size > *(pkg->data_size)) { DMERR("Insufficient space to receive package [%s]::", RQ_TYPE(tfr->request_type)); - DMERR(" tfr->data_size = %u", tfr->data_size); + DMERR(" tfr->data_size = %llu", tfr->data_size); DMERR(" *(pkg->data_size) = %u", *(pkg->data_size)); *(pkg->data_size) = 0; @@ -147,6 +147,7 @@ static void cn_clog_callback(void *data) /* * dm_clog_consult_server * @uuid: log's uuid (must be DM_UUID_LEN in size) + * @uuid_instance: further identifier (if more than 1 log with same uuid) * @request_type: * @data: data to tx to the server * @data_size: size of data in bytes @@ -158,7 +159,8 @@ static void cn_clog_callback(void *data) * * Returns: 0 on success, -EXXX on failure */ -int dm_clog_consult_server(const char *uuid, int request_type, +int dm_clog_consult_server(const char *uuid, uint32_t uuid_instance, + int request_type, char *data, int data_size, char *rdata, int *rdata_size) { @@ -188,6 +190,7 @@ resend: memset(tfr, 0, DM_CLOG_PREALLOCED_SIZE - overhead_size); memcpy(tfr->uuid, uuid, DM_UUID_LEN); + tfr->uuid_instance = uuid_instance; tfr->seq = seq++; tfr->request_type = request_type; tfr->data_size = data_size; diff --git a/cmirror-kernel/src/dm-clog-tfr.h b/cmirror-kernel/src/dm-clog-tfr.h index bdf4b6d..802db8b 100644 --- a/cmirror-kernel/src/dm-clog-tfr.h +++ b/cmirror-kernel/src/dm-clog-tfr.h @@ -52,13 +52,15 @@ struct clog_tfr { uint64_t private[2]; char uuid[DM_UUID_LEN]; /* Ties a request to a specific mirror log */ + char uuid_padding[3]; /* DM_UUID_LEN == 129 */ + uint32_t uuid_instance; /* Allows more than one instance w/ same uuid */ - int error; /* Used by server to inform of errors */ + int32_t error; /* Used by server to inform of errors */ uint32_t originator; /* Cluster ID of this machine */ uint32_t seq; /* Sequence number for request */ uint32_t request_type; /* DM_CLOG_* */ - uint32_t data_size; /* How much data (not including this struct) */ + uint64_t data_size; /* How much data (not including this struct) */ char data[0]; }; @@ -67,7 +69,8 @@ struct clog_tfr { int dm_clog_tfr_init(void); void dm_clog_tfr_exit(void); -int dm_clog_consult_server(const char *uuid, int request_type, +int dm_clog_consult_server(const char *uuid, uint32_t uuid_instance, + int request_type, char *data, int data_size, char *rdata, int *rdata_size); #endif diff --git a/cmirror-kernel/src/dm-clog.c b/cmirror-kernel/src/dm-clog.c index f21823e..17e7486 100644 --- a/cmirror-kernel/src/dm-clog.c +++ b/cmirror-kernel/src/dm-clog.c @@ -18,10 +18,13 @@ struct flush_entry { }; struct log_c { + struct list_head list; + struct dm_target *ti; uint32_t region_size; region_t region_count; char uuid[DM_UUID_LEN]; + uint32_t uuid_instance; char *ctr_str; /* Gives ability to restart if userspace dies */ uint32_t ctr_size; @@ -41,6 +44,8 @@ struct log_c { struct dm_dev *disk_log; }; +static struct list_head log_list_head; +static spinlock_t log_list_lock; static mempool_t *flush_entry_pool = NULL; static void *flush_entry_alloc(gfp_t gfp_mask, void *pool_data) @@ -64,7 +69,7 @@ int cluster_do_request(struct log_c *lc, const char *uuid, int request_type, * restored. */ retry: - r = dm_clog_consult_server(uuid, request_type, data, + r = dm_clog_consult_server(uuid, lc->uuid_instance, request_type, data, data_size, rdata, rdata_size); if (r != -ESRCH) @@ -75,13 +80,15 @@ retry: set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(2*HZ); DMWARN("Attempting to contact cluster log server..."); - r = dm_clog_consult_server(uuid, DM_CLOG_CTR, lc->ctr_str, + r = dm_clog_consult_server(uuid, lc->uuid_instance, + DM_CLOG_CTR, lc->ctr_str, lc->ctr_size, NULL, NULL); if (!r) break; } DMINFO("Reconnected to cluster log server... CTR complete"); - r = dm_clog_consult_server(uuid, DM_CLOG_RESUME, NULL, + r = dm_clog_consult_server(uuid, lc->uuid_instance, + DM_CLOG_RESUME, NULL, 0, NULL, NULL); if (!r) goto retry; @@ -100,7 +107,7 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti, int str_size; int offset = (disk_log) ? 1 : 0; char *ctr_str = NULL; - struct log_c *lc = NULL; + struct log_c *lc = NULL, *tmp; uint32_t region_size; region_t region_count; @@ -129,6 +136,15 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti, spin_lock_init(&lc->flush_lock); INIT_LIST_HEAD(&lc->flush_list); + lc->uuid_instance = 1; + spin_lock(&log_list_lock); + list_for_each_entry(tmp, &log_list_head, list) + if (!strncmp(tmp->uuid, lc->uuid, DM_UUID_LEN) && + (tmp->uuid_instance >= lc->uuid_instance)) + lc->uuid_instance = tmp->uuid_instance + 1; + list_add(&lc->list, &log_list_head); + spin_unlock(&log_list_lock); + for (i = 0, str_size = 0; i < argc; i++) str_size += strlen(argv[i]) + 1; /* +1 for space between args */ @@ -146,7 +162,7 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti, str_size += sprintf(ctr_str + str_size, "%llu", ti->len); /* Send table string */ - r = dm_clog_consult_server(lc->uuid, DM_CLOG_CTR, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, DM_CLOG_CTR, ctr_str, str_size, NULL, NULL); if (r == -ESRCH) @@ -242,11 +258,15 @@ static void cluster_dtr(struct dm_dirty_log *log) int r; struct log_c *lc = (struct log_c *)log->context; - r = dm_clog_consult_server(lc->uuid, DM_CLOG_DTR, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, DM_CLOG_DTR, NULL, 0, NULL, NULL); /* FIXME: What do we do on failure? */ + + spin_lock(&log_list_lock); + list_del(&lc->list); + spin_unlock(&log_list_lock); if (lc->disk_log) dm_put_device(lc->ti, lc->disk_log); kfree(lc->ctr_str); @@ -264,7 +284,8 @@ static int cluster_presuspend(struct dm_dirty_log *log) int r; struct log_c *lc = (struct log_c *)log->context; - r = dm_clog_consult_server(lc->uuid, DM_CLOG_PRESUSPEND, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, + DM_CLOG_PRESUSPEND, NULL, 0, NULL, NULL); @@ -280,7 +301,8 @@ static int cluster_postsuspend(struct dm_dirty_log *log) int r; struct log_c *lc = (struct log_c *)log->context; - r = dm_clog_consult_server(lc->uuid, DM_CLOG_POSTSUSPEND, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, + DM_CLOG_POSTSUSPEND, NULL, 0, NULL, NULL); @@ -297,7 +319,7 @@ static int cluster_resume(struct dm_dirty_log *log) struct log_c *lc = (struct log_c *)log->context; lc->in_sync_hint = 0; - r = dm_clog_consult_server(lc->uuid, DM_CLOG_RESUME, + r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, DM_CLOG_RESUME, NULL, 0, NULL, NULL); @@ -536,7 +558,11 @@ static int cluster_get_resync_work(struct dm_dirty_log *log, region_t *region) int r; int rdata_size; struct log_c *lc = (struct log_c *)log->context; - struct { int i; region_t r; } pkg; + struct { + int32_t i; + uint32_t arch_padding; + region_t r; + } pkg; if (lc->in_sync_hint >= lc->region_count) return 0; @@ -564,7 +590,11 @@ static void cluster_set_region_sync(struct dm_dirty_log *log, { int r; struct log_c *lc = (struct log_c *)log->context; - struct { region_t r; int i; } pkg; + struct { + region_t r; + uint32_t arch_padding; + int32_t i; + } pkg; pkg.r = region; pkg.i = in_sync; @@ -659,7 +689,11 @@ static int cluster_is_remote_recovering(struct dm_dirty_log *log, region_t regio int r; struct log_c *lc = (struct log_c *)log->context; static unsigned long long limit = 0; - struct { int is_recovering; uint64_t in_sync_hint; } pkg; + struct { + int32_t is_recovering; + uint32_t arch_padding; + uint64_t in_sync_hint; + } pkg; int rdata_size = sizeof(pkg); /* @@ -734,6 +768,9 @@ static int __init cluster_dirty_log_init(void) { int r = 0; + INIT_LIST_HEAD(&log_list_head); + spin_lock_init(&log_list_lock); + flush_entry_pool = mempool_create(100, flush_entry_alloc, flush_entry_free, NULL); diff --git a/cmirror/src/cluster.c b/cmirror/src/cluster.c index 63af0dd..1ecef33 100644 --- a/cmirror/src/cluster.c +++ b/cmirror/src/cluster.c @@ -82,6 +82,7 @@ static int log_resp_rec = 0; struct checkpoint_data { uint32_t requester; char uuid[CPG_MAX_NAME_LENGTH]; + uint32_t uuid_instance; int bitmap_size; /* in bytes */ char *sync_bits; @@ -101,6 +102,7 @@ struct clog_cpg { uint32_t lowest_id; cpg_handle_t handle; struct cpg_name name; + uint32_t uuid_instance; /* Are we the first, or have we received checkpoint? */ int state; @@ -144,6 +146,12 @@ int cluster_send(struct clog_tfr *tfr) return -ENOENT; } + /* + * uuid_instance is only valid per machine, it looses its meaning + * when sent to the cluster. + */ + tfr->uuid_instance = 0; + iov.iov_base = tfr; iov.iov_len = sizeof(struct clog_tfr) + tfr->data_size; @@ -349,9 +357,11 @@ static struct checkpoint_data *prepare_checkpoint(struct clog_cpg *entry, memset(new, 0, sizeof(*new)); new->requester = cp_requester; strncpy(new->uuid, entry->name.value, entry->name.length); + new->uuid_instance = entry->uuid_instance; - new->bitmap_size = push_state(entry->name.value, "clean_bits", - &new->clean_bits, cp_requester); + new->bitmap_size = push_state(entry->name.value, entry->uuid_instance, + "clean_bits", &new->clean_bits, + cp_requester); if (new->bitmap_size <= 0) { LOG_ERROR("Failed to store clean_bits to checkpoint for node %u", new->requester); @@ -359,7 +369,7 @@ static struct checkpoint_data *prepare_checkpoint(struct clog_cpg *entry, return NULL; } - new->bitmap_size = push_state(entry->name.value, + new->bitmap_size = push_state(entry->name.value, entry->uuid_instance, "sync_bits", &new->sync_bits, cp_requester); if (new->bitmap_size <= 0) { LOG_ERROR("Failed to store sync_bits to checkpoint for node %u", @@ -369,7 +379,9 @@ static struct checkpoint_data *prepare_checkpoint(struct clog_cpg *entry, return NULL; } - r = push_state(entry->name.value, "recovering_region", &new->recovering_region, cp_requester); + r = push_state(entry->name.value, entry->uuid_instance, + "recovering_region", &new->recovering_region, + cp_requester); if (r <= 0) { LOG_ERROR("Failed to store recovering_region to checkpoint for node %u", new->requester); @@ -696,7 +708,7 @@ init_retry: } if (iov.readSize) { - if (pull_state(entry->name.value, + if (pull_state(entry->name.value, entry->uuid_instance, (char *)desc.sectionId.id, bitmap, iov.readSize)) { LOG_ERROR("Error loading state"); @@ -1087,7 +1099,7 @@ static void cpg_message_callback(cpg_handle_t handle, struct cpg_name *gname, new->next = match->checkpoint_list; match->checkpoint_list = new; - } + } out: /* nothing happens after this point. It is just for debugging */ @@ -1229,7 +1241,7 @@ static void cpg_leave_callback(struct clog_cpg *match, cpg_fd_get(match->handle, &fd); links_unregister(fd); - cluster_postsuspend(match->name.value); + cluster_postsuspend(match->name.value, match->uuid_instance); list_for_each_safe(p, n, &match->working_list) { list_del_init(p); @@ -1281,7 +1293,7 @@ static void cpg_leave_callback(struct clog_cpg *match, j--; } } - match->checkpoints_needed = j; + match->checkpoints_needed = j; if (left->nodeid < my_cluster_id) { match->delay = (match->delay > 0) ? match->delay - 1 : 0; @@ -1434,7 +1446,7 @@ unlink_retry: return 1; } -int create_cluster_cpg(char *str) +int create_cluster_cpg(char *uuid, uint32_t uuid_instance) { int r; int size; @@ -1442,8 +1454,8 @@ int create_cluster_cpg(char *str) struct clog_cpg *tmp, *tmp2; list_for_each_entry_safe(tmp, tmp2, &clog_cpg_list, list) - if (!strncmp(tmp->name.value, str, CPG_MAX_NAME_LENGTH)) { - LOG_ERROR("Log entry already exists: %s", str); + if (!strncmp(tmp->name.value, uuid, CPG_MAX_NAME_LENGTH)) { + LOG_ERROR("Log entry already exists: %s", uuid); return -EEXIST; } @@ -1458,10 +1470,11 @@ int create_cluster_cpg(char *str) INIT_LIST_HEAD(&new->startup_list); INIT_LIST_HEAD(&new->working_list); - size = ((strlen(str) + 1) > CPG_MAX_NAME_LENGTH) ? - CPG_MAX_NAME_LENGTH : (strlen(str) + 1); - strncpy(new->name.value, str, size); + size = ((strlen(uuid) + 1) > CPG_MAX_NAME_LENGTH) ? + CPG_MAX_NAME_LENGTH : (strlen(uuid) + 1); + strncpy(new->name.value, uuid, size); new->name.length = size; + new->uuid_instance = uuid_instance; /* * Ensure there are no stale checkpoints around before we join diff --git a/cmirror/src/cluster.h b/cmirror/src/cluster.h index 9c98085..176024b 100644 --- a/cmirror/src/cluster.h +++ b/cmirror/src/cluster.h @@ -5,7 +5,7 @@ int init_cluster(void); void cleanup_cluster(void); void cluster_debug(void); -int create_cluster_cpg(char *str); +int create_cluster_cpg(char *uuid, uint32_t uuid_instance); int destroy_cluster_cpg(char *str); int cluster_send(struct clog_tfr *tfr); diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c index d37c75a..f7270a6 100644 --- a/cmirror/src/functions.c +++ b/cmirror/src/functions.c @@ -49,7 +49,7 @@ struct log_c { struct list_head list; char uuid[DM_UUID_LEN]; - uint32_t ref_count; + uint32_t uuid_instance; time_t delay; /* limits how fast a resume can happen after suspend */ int touched; @@ -148,7 +148,7 @@ static uint64_t count_bits32(uint32_t *addr, uint32_t count) * * Returns: log if found, NULL otherwise */ -static struct log_c *get_log(const char *uuid) +static struct log_c *get_log(const char *uuid, uint32_t uuid_instance) { struct list_head *l; struct log_c *lc; @@ -156,7 +156,9 @@ static struct log_c *get_log(const char *uuid) /* FIXME: Need prefetch to do this right */ __list_for_each(l, &log_list) { lc = list_entry(l, struct log_c, list); - if (!strcmp(lc->uuid, uuid)) + if (!strcmp(lc->uuid, uuid) && + (!uuid_instance || + (lc->uuid_instance == uuid_instance))) return lc; } @@ -172,7 +174,7 @@ static struct log_c *get_log(const char *uuid) * * Returns: log if found, NULL otherwise */ -static struct log_c *get_pending_log(const char *uuid) +static struct log_c *get_pending_log(const char *uuid, uint32_t uuid_instance) { struct list_head *l; struct log_c *lc; @@ -180,7 +182,9 @@ static struct log_c *get_pending_log(const char *uuid) /* FIXME: Need prefetch to do this right */ __list_for_each(l, &log_pending_list) { lc = list_entry(l, struct log_c, list); - if (!strcmp(lc->uuid, uuid)) + if (!strcmp(lc->uuid, uuid) && + (!uuid_instance || + (lc->uuid_instance == uuid_instance))) return lc; } @@ -346,7 +350,8 @@ static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_pat return r ? -errno : 0; } -static int _clog_ctr(int argc, char **argv, uint64_t device_size) +static int _clog_ctr(int argc, char **argv, uint32_t uuid_instance, + uint64_t device_size) { int i; int r = 0; @@ -435,16 +440,23 @@ static int _clog_ctr(int argc, char **argv, uint64_t device_size) lc->skip_bit_warning = region_count; lc->disk_fd = -1; lc->log_dev_failed = 0; - lc->ref_count = 1; strncpy(lc->uuid, argv[1 + disk_log], DM_UUID_LEN); + lc->uuid_instance = uuid_instance; - if ((dup = get_log(lc->uuid)) || - (dup = get_pending_log(lc->uuid))) { - LOG_DBG("[%s] Inc reference count on cluster log", - SHORT_UUID(lc->uuid)); + if ((dup = get_log(lc->uuid, lc->uuid_instance))) { + LOG_ERROR("Duplicate log UUID and uuid_instance!"); + LOG_ERROR("UUID: %s", lc->uuid); + LOG_ERROR("uuid_instance: %u", lc->uuid_instance); free(lc); - dup->ref_count++; - return 0; + return -EINVAL; + } + + if ((dup = get_pending_log(lc->uuid, lc->uuid_instance))) { + LOG_ERROR("Duplicate pending log UUID and uuid_instance!"); + LOG_ERROR("UUID: %s", lc->uuid); + LOG_ERROR("uuid_instance: %u", lc->uuid_instance); + free(lc); + return -EINVAL; } INIT_LIST_HEAD(&lc->mark_list); @@ -545,8 +557,9 @@ static int clog_ctr(struct clog_tfr *tfr) if (strlen(tfr->data) != tfr->data_size) { LOG_ERROR("Received constructor request with bad data"); - LOG_ERROR("strlen(tfr->data)[%d] != tfr->data_size[%d]", - (int)strlen(tfr->data), tfr->data_size); + LOG_ERROR("strlen(tfr->data)[%d] != tfr->data_size[%llu]", + (int)strlen(tfr->data), + (unsigned long long)tfr->data_size); LOG_ERROR("tfr->data = '%s' [%d]", tfr->data, (int)strlen(tfr->data)); return -EINVAL; @@ -570,7 +583,7 @@ static int clog_ctr(struct clog_tfr *tfr) } argc--; /* We pass in the device_size separate */ - r = _clog_ctr(argc, argv, device_size); + r = _clog_ctr(argc, argv, tfr->uuid_instance, device_size); /* We join the CPG when we resume */ @@ -579,7 +592,8 @@ static int clog_ctr(struct clog_tfr *tfr) free(argv); if (r) - LOG_ERROR("Failed to create cluster log (%s)", tfr->uuid); + LOG_ERROR("Failed to create cluster log (%s)", + SHORT_UUID(tfr->uuid)); else LOG_DBG("[%s] Cluster log created", SHORT_UUID(tfr->uuid)); @@ -594,32 +608,21 @@ static int clog_ctr(struct clog_tfr *tfr) */ static int clog_dtr(struct clog_tfr *tfr) { - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (lc) { /* * The log should not be on the official list. There * should have been a suspend first. */ - lc->ref_count--; - if (!lc->ref_count) { - LOG_ERROR("[%s] DTR before SUS: leaving CPG", - SHORT_UUID(tfr->uuid)); - destroy_cluster_cpg(tfr->uuid); - } - } else if ((lc = get_pending_log(tfr->uuid))) { - lc->ref_count--; - } else { + LOG_ERROR("[%s] DTR before SUS: leaving CPG", + SHORT_UUID(tfr->uuid)); + destroy_cluster_cpg(tfr->uuid); + } else if (!(lc = get_pending_log(tfr->uuid, tfr->uuid_instance))) { LOG_ERROR("clog_dtr called on log that is not official or pending"); return -EINVAL; } - if (lc->ref_count) { - LOG_DBG("[%s] Dec reference count on cluster log", - SHORT_UUID(lc->uuid)); - return 0; - } - LOG_DBG("[%s] Cluster log removed", SHORT_UUID(lc->uuid)); list_del_init(&lc->list); @@ -641,7 +644,7 @@ static int clog_dtr(struct clog_tfr *tfr) */ static int clog_presuspend(struct clog_tfr *tfr) { - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -661,7 +664,7 @@ static int clog_presuspend(struct clog_tfr *tfr) */ static int clog_postsuspend(struct clog_tfr *tfr) { - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -682,9 +685,9 @@ static int clog_postsuspend(struct clog_tfr *tfr) * @tfr * */ -int cluster_postsuspend(char *uuid) +int cluster_postsuspend(char *uuid, uint32_t uuid_instance) { - struct log_c *lc = get_log(uuid); + struct log_c *lc = get_log(uuid, uuid_instance); if (!lc) return -EINVAL; @@ -709,7 +712,7 @@ static int clog_resume(struct clog_tfr *tfr) { uint32_t i; int commit_log = 0; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); size_t size = lc->bitset_uint32_count * sizeof(uint32_t); if (!lc) @@ -835,11 +838,11 @@ int local_resume(struct clog_tfr *tfr) { int r; time_t t; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) { /* Is the log in the pending list? */ - lc = get_pending_log(tfr->uuid); + lc = get_pending_log(tfr->uuid, tfr->uuid_instance); if (!lc) { LOG_ERROR("clog_resume called on log that is not official or pending"); return -EINVAL; @@ -874,12 +877,22 @@ int local_resume(struct clog_tfr *tfr) sleep(3 - t); /* Join the CPG */ - r = create_cluster_cpg(tfr->uuid); + r = create_cluster_cpg(tfr->uuid, tfr->uuid_instance); if (r) { LOG_ERROR("clog_resume: Failed to create cluster CPG"); return r; } + if (get_log(lc->uuid, lc->uuid_instance)) { + /* + * Not being able to identify a log uniquely is fatal, + * and represents a programming error. + */ + LOG_ERROR("[%s/%u] DUPLICATE LOG WITH SAME UUID[_INSTANCE]!", + SHORT_UUID(lc->uuid), lc->uuid_instance); + exit(EXIT_FAILURE); + } + /* move log to official list */ list_del_init(&lc->list); list_add(&lc->list, &log_list); @@ -901,7 +914,7 @@ int local_resume(struct clog_tfr *tfr) static int clog_get_region_size(struct clog_tfr *tfr) { uint64_t *rtn = (uint64_t *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); LOG_PRINT("WARNING: kernel should not be calling clog_get_region_size"); if (!lc) @@ -924,7 +937,7 @@ static int clog_is_clean(struct clog_tfr *tfr) { int *rtn = (int *)tfr->data; uint64_t region = *((uint64_t *)(tfr->data)); - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -949,7 +962,7 @@ static int clog_in_sync(struct clog_tfr *tfr) { int *rtn = (int *)tfr->data; uint64_t region = *((uint64_t *)(tfr->data)); - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -978,7 +991,7 @@ static int clog_in_sync(struct clog_tfr *tfr) static int clog_flush(struct clog_tfr *tfr, int server) { int r = 0; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1066,7 +1079,7 @@ static int clog_mark_region(struct clog_tfr *tfr) int r; int count; uint64_t *region; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1133,7 +1146,7 @@ static int clog_clear_region(struct clog_tfr *tfr) int r; int count; uint64_t *region; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1164,8 +1177,12 @@ static int clog_clear_region(struct clog_tfr *tfr) */ static int clog_get_resync_work(struct clog_tfr *tfr) { - struct {int i; uint64_t r; } *pkg = (void *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct { + int32_t i; + uint32_t arch_padding; + uint64_t r; + } *pkg = (void *)tfr->data; + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1254,8 +1271,12 @@ static int clog_get_resync_work(struct clog_tfr *tfr) */ static int clog_set_region_sync(struct clog_tfr *tfr) { - struct { uint64_t region; int in_sync; } *pkg = (void *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct { + uint64_t region; + uint32_t arch_padding; + int32_t in_sync; + } *pkg = (void *)tfr->data; + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1334,7 +1355,7 @@ static int clog_set_region_sync(struct clog_tfr *tfr) static int clog_get_sync_count(struct clog_tfr *tfr) { uint64_t *sync_count = (uint64_t *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); /* * FIXME: Mirror requires us to be able to ask for @@ -1343,7 +1364,7 @@ static int clog_get_sync_count(struct clog_tfr *tfr) * the stored value may not be accurate. */ if (!lc) - lc = get_pending_log(tfr->uuid); + lc = get_pending_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1402,10 +1423,10 @@ static int disk_status_info(struct log_c *lc, struct clog_tfr *tfr) static int clog_status_info(struct clog_tfr *tfr) { int r; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) - lc = get_pending_log(tfr->uuid); + lc = get_pending_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1461,10 +1482,10 @@ static int disk_status_table(struct log_c *lc, struct clog_tfr *tfr) static int clog_status_table(struct clog_tfr *tfr) { int r; - struct log_c *lc = get_log(tfr->uuid); + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) - lc = get_pending_log(tfr->uuid); + lc = get_pending_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1485,8 +1506,12 @@ static int clog_status_table(struct clog_tfr *tfr) static int clog_is_remote_recovering(struct clog_tfr *tfr) { uint64_t region = *((uint64_t *)(tfr->data)); - struct { int is_recovering; uint64_t in_sync_hint; } *pkg = (void *)tfr->data; - struct log_c *lc = get_log(tfr->uuid); + struct { + int32_t is_recovering; + uint32_t arch_padding; + uint64_t in_sync_hint; + } *pkg = (void *)tfr->data; + struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; @@ -1667,7 +1692,8 @@ static void print_bits(char *buf, int size, int print) } /* int store_bits(const char *uuid, const char *which, char **buf)*/ -int push_state(const char *uuid, const char *which, char **buf, uint32_t debug_who) +int push_state(const char *uuid, uint32_t uuid_instance, const char *which, + char **buf, uint32_t debug_who) { int bitset_size; struct log_c *lc; @@ -1675,7 +1701,7 @@ int push_state(const char *uuid, const char *which, char **buf, uint32_t debug_w if (*buf) LOG_ERROR("store_bits: *buf != NULL"); - lc = get_log(uuid); + lc = get_log(uuid, uuid_instance); if (!lc) { LOG_ERROR("store_bits: No log found for %s", uuid); return -EINVAL; @@ -1721,7 +1747,8 @@ int push_state(const char *uuid, const char *which, char **buf, uint32_t debug_w } /*int load_bits(const char *uuid, const char *which, char *buf, int size)*/ -int pull_state(const char *uuid, const char *which, char *buf, int size) +int pull_state(const char *uuid, uint32_t uuid_instance, + const char *which, char *buf, int size) { int bitset_size; struct log_c *lc; @@ -1729,7 +1756,7 @@ int pull_state(const char *uuid, const char *which, char *buf, int size) if (!buf) LOG_ERROR("pull_state: buf == NULL"); - lc = get_log(uuid); + lc = get_log(uuid, uuid_instance); if (!lc) { LOG_ERROR("pull_state: No log found for %s", uuid); return -EINVAL; @@ -1773,7 +1800,7 @@ int log_get_state(struct clog_tfr *tfr) { struct log_c *lc; - lc = get_log(tfr->uuid); + lc = get_log(tfr->uuid, tfr->uuid_instance); if (!lc) return -EINVAL; diff --git a/cmirror/src/functions.h b/cmirror/src/functions.h index 7c01c64..63ed49a 100644 --- a/cmirror/src/functions.h +++ b/cmirror/src/functions.h @@ -7,11 +7,13 @@ #define LOG_SUSPENDED 2 int local_resume(struct clog_tfr *tfr); -int cluster_postsuspend(char *); +int cluster_postsuspend(char *, uint32_t); int do_request(struct clog_tfr *tfr, int server); -int push_state(const char *uuid, const char *which, char **buf, uint32_t debug_who); -int pull_state(const char *uuid, const char *which, char *buf, int size); +int push_state(const char *uuid, uint32_t uuid_instance, + const char *which, char **buf, uint32_t debug_who); +int pull_state(const char *uuid, uint32_t uuid_instance, + const char *which, char *buf, int size); int log_get_state(struct clog_tfr *tfr); int log_status(void); diff --git a/cmirror/src/local.c b/cmirror/src/local.c index 7f9a403..cf64855 100644 --- a/cmirror/src/local.c +++ b/cmirror/src/local.c @@ -263,6 +263,7 @@ static int do_local_work(void *data) case DM_CLOG_GET_REGION_SIZE: default: LOG_ERROR("Invalid log request received, ignoring."); + return 0; } From cfeist@fedoraproject.org Mon Jul 27 20:24:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Mon, 27 Jul 2009 20:24:00 -0000 Subject: cluster: the annotated tag cmirror-kernel_0_1_22 has been created Message-ID: <20090727202325.6C3BF120308@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4c44704e67a6d7c4d18595d85afdc7f0c996c164 Commit: 4c44704e67a6d7c4d18595d85afdc7f0c996c164 Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-27 20:11 +0000 Committer: Chris Feist CommitterDate: 2009-07-27 20:11 +0000 annotated tag: cmirror-kernel_0_1_22 has been created at 4c44704e67a6d7c4d18595d85afdc7f0c996c164 (tag) tagging fa15cb16f0de9ddf06ddb50f2fcf26dd9c257931 (commit) replaces cman_2_0_110 Bob Peterson (2): GFS: Commited data evaporates Fix more man page references to gfs2_fsck Jonathan Brassow (1): clogd/dm-log-clustered.ko: Fix for bugs 506843, 479749, 507400 Marek Grac (1): fencing: #501586 - fence agents fails with pexpect exception From cfeist@fedoraproject.org Mon Jul 27 20:24:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Mon, 27 Jul 2009 20:24:00 -0000 Subject: cluster: the annotated tag cmirror_1_1_39 has been created Message-ID: <20090727202325.ACBAA120312@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=58f62a69fc45c27f26e65da148f30c9d6b639857 Commit: 58f62a69fc45c27f26e65da148f30c9d6b639857 Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-27 20:11 +0000 Committer: Chris Feist CommitterDate: 2009-07-27 20:11 +0000 annotated tag: cmirror_1_1_39 has been created at 58f62a69fc45c27f26e65da148f30c9d6b639857 (tag) tagging fa15cb16f0de9ddf06ddb50f2fcf26dd9c257931 (commit) replaces cman_2_0_110 Bob Peterson (2): GFS: Commited data evaporates Fix more man page references to gfs2_fsck Jonathan Brassow (1): clogd/dm-log-clustered.ko: Fix for bugs 506843, 479749, 507400 Marek Grac (1): fencing: #501586 - fence agents fails with pexpect exception From cfeist@fedoraproject.org Mon Jul 27 20:24:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Mon, 27 Jul 2009 20:24:00 -0000 Subject: cluster: the annotated tag cman_2_0_112 has been created Message-ID: <20090727202325.27386120307@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=35fbaa16634307fe435a33269417d6f5ec82a530 Commit: 35fbaa16634307fe435a33269417d6f5ec82a530 Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-27 20:23 +0000 Committer: Chris Feist CommitterDate: 2009-07-27 20:23 +0000 annotated tag: cman_2_0_112 has been created at 35fbaa16634307fe435a33269417d6f5ec82a530 (tag) tagging fa15cb16f0de9ddf06ddb50f2fcf26dd9c257931 (commit) replaces cman_2_0_110 Bob Peterson (2): GFS: Commited data evaporates Fix more man page references to gfs2_fsck Jonathan Brassow (1): clogd/dm-log-clustered.ko: Fix for bugs 506843, 479749, 507400 Marek Grac (1): fencing: #501586 - fence agents fails with pexpect exception From cfeist@fedoraproject.org Mon Jul 27 20:24:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Mon, 27 Jul 2009 20:24:00 -0000 Subject: cluster: the annotated tag gfs2_0_1_62 has been created Message-ID: <20090727202326.8530E120328@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=505eda29ae32c3e31598891440967e7086455382 Commit: 505eda29ae32c3e31598891440967e7086455382 Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-27 20:11 +0000 Committer: Chris Feist CommitterDate: 2009-07-27 20:11 +0000 annotated tag: gfs2_0_1_62 has been created at 505eda29ae32c3e31598891440967e7086455382 (tag) tagging 6326334d93408ebe5ec43d0bef6365c7c82e8849 (commit) replaces gfs-kernel_0_1_34 Bob Peterson (1): Fix more man page references to gfs2_fsck Marek Grac (1): fencing: #501586 - fence agents fails with pexpect exception From cfeist@fedoraproject.org Mon Jul 27 20:24:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Mon, 27 Jul 2009 20:24:00 -0000 Subject: cluster: the annotated tag gfs-kernel_0_1_34 has been created Message-ID: <20090727202326.07235120325@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0ba3ba6e85f67fceed4a44d6810dfee151226e5a Commit: 0ba3ba6e85f67fceed4a44d6810dfee151226e5a Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-23 16:36 +0000 Committer: Chris Feist CommitterDate: 2009-07-23 16:36 +0000 annotated tag: gfs-kernel_0_1_34 has been created at 0ba3ba6e85f67fceed4a44d6810dfee151226e5a (tag) tagging 188db164825505dfecd32b8eb4a53a1349557280 (commit) replaces cman_2_0_110 Bob Peterson (1): GFS: Commited data evaporates From teigland@fedoraproject.org Mon Jul 27 21:14:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Mon, 27 Jul 2009 21:14:00 -0000 Subject: cluster: STABLE3 - cluster.rng: various fixes Message-ID: <20090727211416.EDCDF120307@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0fd3604ad2ee638f86cfe2b33a7588158391a8e5 Commit: 0fd3604ad2ee638f86cfe2b33a7588158391a8e5 Parent: 48aba4efedc8095260d3c0edc33edf572405137e Author: David Teigland AuthorDate: Mon Jul 27 16:01:30 2009 -0500 Committer: David Teigland CommitterDate: Mon Jul 27 16:03:25 2009 -0500 cluster.rng: various fixes Signed-off-by: David Teigland --- config/tools/xml/cluster.rng | 51 +++++++++++++++++++----------------------- 1 files changed, 23 insertions(+), 28 deletions(-) diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index c424087..fe90dc9 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -33,7 +33,7 @@ To validate your cluster.conf against this schema, run: top-level element and contains attributes that define the cluster name and the configuration version number."> + it can be up to 16 characters long." rha:sample="my_cluster"/> + rha:sample="My Cluster"/> @@ -194,9 +194,6 @@ To validate your cluster.conf against this schema, run: - @@ -241,6 +238,24 @@ following elements and attributes. --> + + + + + + + + + + + + + + + + + + @@ -290,24 +305,6 @@ following elements and attributes. --> that a cached resource should be unused before consideration for dropping." rha:sample="5000" rha:default="10000"/> - - - - - - - - - - - - - - - - - - @@ -915,8 +912,8 @@ block before determining success or failure. - - + + @@ -985,7 +982,7 @@ block before determining success or failure. slightly lower latency from transmit to delivery in faulty network environments but with less performance. Passive replication may nearly double the speed of the totem protocol - if the protocol doesn????????????????????????t become cpu bound. The final option is + if the protocol doesn't become cpu bound. The final option is none, in which case only one network interface is used to operate the totem protocol. If only one interface directive is specified, none is automatically chosen. If multiple interface @@ -1218,8 +1215,6 @@ block before determining success or failure. to prevent any startup fencing the daemon might do." rha:default="0" rha:sample="1"/> - - - - - - + + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + - + + - + - + + - + - + - + - + @@ -134,92 +194,114 @@ To validate your cluster.conf against this schema, run: - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - + + + @@ -228,82 +310,174 @@ To validate your cluster.conf against this schema, run: - + - + - + + + + - + - - + + - + - - - + + + - + + - + - + - + - + - + - + - + - + - + - - + + - + + - + + - + @@ -658,49 +832,57 @@ To validate your cluster.conf against this schema, run: - + - + - + - + - + - + - + - + - + - + @@ -710,51 +892,51 @@ To validate your cluster.conf against this schema, run: - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + @@ -762,45 +944,82 @@ To validate your cluster.conf against this schema, run: - + - + - + - + - + + - + - + - + - + - + - + - + - + - + @@ -808,58 +1027,89 @@ To validate your cluster.conf against this schema, run: - + - + + - + - + - + - + - + - + - - + + - + - + - + - + - + - + @@ -867,47 +1117,47 @@ To validate your cluster.conf against this schema, run: - + - - + + - + - + - + - + - + - + - + - + - + - + - + @@ -916,7 +1166,7 @@ To validate your cluster.conf against this schema, run: - + @@ -933,81 +1183,139 @@ To validate your cluster.conf against this schema, run: - + + + + - + - + - + - + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + - + - + - + @@ -2047,10 +2355,18 @@ To validate your cluster.conf against this schema, run: - + - - + + @@ -2060,7 +2376,7 @@ To validate your cluster.conf against this schema, run: - + @@ -2068,8 +2384,8 @@ To validate your cluster.conf against this schema, run: - - + + From teigland@fedoraproject.org Mon Jul 27 21:14:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Mon, 27 Jul 2009 21:14:00 -0000 Subject: cluster: STABLE3 - cluster.rng: remove trailing whitespace Message-ID: <20090727211419.18EDF120307@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4be2a85079cd05df9dd07b555f88ad0184d9f7a5 Commit: 4be2a85079cd05df9dd07b555f88ad0184d9f7a5 Parent: 0fd3604ad2ee638f86cfe2b33a7588158391a8e5 Author: David Teigland AuthorDate: Mon Jul 27 16:04:50 2009 -0500 Committer: David Teigland CommitterDate: Mon Jul 27 16:04:50 2009 -0500 cluster.rng: remove trailing whitespace Signed-off-by: David Teigland --- config/tools/xml/cluster.rng | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index fe90dc9..1fb1b65 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -5,7 +5,7 @@ xmlns:rha="http://redhat.com/~pkennedy/annotation_namespace/cluster_conf_annot_n + - + @@ -317,7 +317,7 @@ To validate your cluster.conf against this schema, run: - + - + - @@ -2783,4 +2783,4 @@ rha:sample=""/> - + From teigland@fedoraproject.org Mon Jul 27 21:23:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Mon, 27 Jul 2009 21:23:00 -0000 Subject: cluster: STABLE3 - cluster.rng: cluster_id and nodeid Message-ID: <20090727212314.30537120307@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5d55508f14db4363cd78759e6988a915fed1a417 Commit: 5d55508f14db4363cd78759e6988a915fed1a417 Parent: 4be2a85079cd05df9dd07b555f88ad0184d9f7a5 Author: David Teigland AuthorDate: Mon Jul 27 16:14:10 2009 -0500 Committer: David Teigland CommitterDate: Mon Jul 27 16:14:10 2009 -0500 cluster.rng: cluster_id and nodeid add cluster_id, fix up nodeid Signed-off-by: David Teigland --- config/tools/xml/cluster.rng | 21 +++++++-------------- 1 files changed, 7 insertions(+), 14 deletions(-) diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index 1fb1b65..7954ab0 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -104,6 +104,11 @@ To validate your cluster.conf against this schema, run: + + + + + @@ -149,19 +154,9 @@ To validate your cluster.conf against this schema, run: - - + @@ -1220,8 +1215,6 @@ block before determining success or failure. fencing of nodes with no fence methods defined." rha:default="0" rha:sample="1"/> - --> - From chrissie@fedoraproject.org Tue Jul 28 07:48:00 2009 From: chrissie@fedoraproject.org (Christine Caulfield) Date: Tue, 28 Jul 2009 07:48:00 -0000 Subject: cluster: STABLE3 - cman: make cman_tool leave remove work even when no services are running. Message-ID: <20090728074813.9D86C120378@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cacde1952b0bd5f913185527349f6c9ad4d2400b Commit: cacde1952b0bd5f913185527349f6c9ad4d2400b Parent: 5d55508f14db4363cd78759e6988a915fed1a417 Author: Christine Caulfield AuthorDate: Tue Jul 28 08:46:36 2009 +0100 Committer: Christine Caulfield CommitterDate: Tue Jul 28 08:46:36 2009 +0100 cman: make cman_tool leave remove work even when no services are running. cman_tool leave takes a shortcut internally if no services are listening for shutdown events. Unfortunately, a bug in this shortcut means that the leave flags gets lost, so quorum is not adjusted downwards. This patch fixes that shortcut. I should make it clear that 'leave remove' works fine if any cluster services are running. Signed-off-by: Christine Caulfield --- cman/daemon/commands.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index 3607864..23ea810 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -1070,8 +1070,13 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf) /* If no-one is listening for events then we can just go down now */ if (shutdown_expected == 0) { + int leaveflags = CLUSTER_LEAVEFLAG_DOWN; + quit_threads = 1; - send_leave(CLUSTER_LEAVEFLAG_DOWN); + if (shutdown_flags & SHUTDOWN_REMOVE) + leaveflags |= CLUSTER_LEAVEFLAG_REMOVED; + + send_leave(leaveflags); return 0; } else { From chrissie@fedoraproject.org Tue Jul 28 08:26:00 2009 From: chrissie@fedoraproject.org (Christine Caulfield) Date: Tue, 28 Jul 2009 08:26:00 -0000 Subject: cluster: RHEL5 - cman: make cman_tool leave remove work even when no services are running. Message-ID: <20090728082607.7B486120378@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9c41df00092d785b3ad9fcb094bd0461581d3d95 Commit: 9c41df00092d785b3ad9fcb094bd0461581d3d95 Parent: 470a0f93bc2071a1ef26177b854cd7279730c247 Author: Christine Caulfield AuthorDate: Tue Jul 28 08:46:36 2009 +0100 Committer: Christine Caulfield CommitterDate: Tue Jul 28 08:51:46 2009 +0100 cman: make cman_tool leave remove work even when no services are running. cman_tool leave takes a shortcut internally if no services are listening for shutdown events. Unfortunately, a bug in this shortcut means that the leave flags gets lost, so quorum is not adjusted downwards. This patch fixes that shortcut. I should make it clear that 'leave remove' works fine if any cluster services are running. Signed-off-by: Christine Caulfield --- cman/daemon/commands.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index 710449e..d400b25 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -947,6 +947,13 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf) /* If no-one is listening for events then we can just go down now */ if (shutdown_expected == 0) { send_leave(CLUSTER_LEAVEFLAG_DOWN); + int leaveflags = CLUSTER_LEAVEFLAG_DOWN; + + quit_threads = 1; + if (shutdown_flags & SHUTDOWN_REMOVE) + leaveflags |= CLUSTER_LEAVEFLAG_REMOVED; + + send_leave(leaveflags); return 0; } else { From fabbione@fedoraproject.org Tue Jul 28 09:20:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Tue, 28 Jul 2009 09:20:00 -0000 Subject: cluster: STABLE3 - dlm_controld: fix protocol initialization Message-ID: <20090728092025.4C5D0120378@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9509dcec6bdf1c830ee34edfb0b8b175cdf4dc63 Commit: 9509dcec6bdf1c830ee34edfb0b8b175cdf4dc63 Parent: cacde1952b0bd5f913185527349f6c9ad4d2400b Author: Fabio M. Di Nitto AuthorDate: Tue Jul 28 11:17:20 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Tue Jul 28 11:17:20 2009 +0200 dlm_controld: fix protocol initialization the fs/dlm/lowcomms.c check for protocol value assume 0 for TCP and any other value for SCTP. dlm_controld copies pristine the value into configfs with TCP set to 1 and SCTP set to 2. By specifing in cluster.conf, configfs value will be set to 1, therefor enabling SCTP. Align PROTO_* values to kernel check and initialize the correct procotol. Signed-off-by: Fabio M. Di Nitto --- group/dlm_controld/config.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/group/dlm_controld/config.c b/group/dlm_controld/config.c index d7a12c4..16c4efb 100644 --- a/group/dlm_controld/config.c +++ b/group/dlm_controld/config.c @@ -25,8 +25,8 @@ #include "config.h" #include "ccs.h" -#define PROTO_TCP 1 -#define PROTO_SCTP 2 +#define PROTO_TCP 0 +#define PROTO_SCTP 1 int ccs_handle; From fabbione@fedoraproject.org Tue Jul 28 09:23:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Tue, 28 Jul 2009 09:23:00 -0000 Subject: dlm: master - dlm_controld: fix protocol initialization Message-ID: <20090728092304.1F426120378@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/dlm.git?p=dlm.git;a=commitdiff;h=8d9ac6b0e990b3d48bf0d5b57da841cb11a68ba5 Commit: 8d9ac6b0e990b3d48bf0d5b57da841cb11a68ba5 Parent: 041ee1d89567c842287dfc0bf1f707535fa03bbe Author: Fabio M. Di Nitto AuthorDate: Tue Jul 28 11:17:20 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Tue Jul 28 11:22:54 2009 +0200 dlm_controld: fix protocol initialization the fs/dlm/lowcomms.c check for protocol value assume 0 for TCP and any other value for SCTP. dlm_controld copies pristine the value into configfs with TCP set to 1 and SCTP set to 2. By specifing in cluster.conf, configfs value will be set to 1, therefor enabling SCTP. Align PROTO_* values to kernel check and initialize the correct procotol. Signed-off-by: Fabio M. Di Nitto --- group/dlm_controld/config.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/group/dlm_controld/config.c b/group/dlm_controld/config.c index 548b47a..04f1987 100644 --- a/group/dlm_controld/config.c +++ b/group/dlm_controld/config.c @@ -26,8 +26,8 @@ #include "config.h" #include "ccs.h" -#define PROTO_TCP 1 -#define PROTO_SCTP 2 +#define PROTO_TCP 0 +#define PROTO_SCTP 1 int ccs_handle; From rohara@fedoraproject.org Tue Jul 28 16:18:00 2009 From: rohara@fedoraproject.org (rohara) Date: Tue, 28 Jul 2009 16:18:00 -0000 Subject: fence-agents: master - BZ 512998 - Add comment about fence_scsi limitations. Message-ID: <20090728161820.B2AC812022C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=4fa914ea8252924d607c663f113a11e4dc362aa3 Commit: 4fa914ea8252924d607c663f113a11e4dc362aa3 Parent: 7f97f16699739fcbc2304bf35322a1495b1131b0 Author: Ryan O'Hara AuthorDate: Tue Jul 28 11:17:24 2009 -0500 Committer: Ryan O'Hara CommitterDate: Tue Jul 28 11:17:24 2009 -0500 BZ 512998 - Add comment about fence_scsi limitations. --- fence/man/fence_scsi.8 | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/fence/man/fence_scsi.8 b/fence/man/fence_scsi.8 index c714fc7..39843cd 100644 --- a/fence/man/fence_scsi.8 +++ b/fence/man/fence_scsi.8 @@ -99,5 +99,12 @@ Name of the node that will perform the fencing operation. \fIverbose = < param >\fR Verbose output. +.SH LIMITATIONS +The fence_scsi fencing agent requires a minimum of three nodes in the +cluster to operate. For SAN devices connected via fiber channel, +these must be physical nodes. SAN devices connected via iSCSI may use +virtual or physical nodes. In addition, fence_scsi cannot be used in +conjunction with qdisk. + .SH SEE ALSO fence(8), fence_node(8), sg_persist(8), lvs(8), lvm.conf(5) From rohara@fedoraproject.org Tue Jul 28 17:37:00 2009 From: rohara@fedoraproject.org (rohara) Date: Tue, 28 Jul 2009 17:37:00 -0000 Subject: cluster: STABLE3 - BZ 512998 - Add comment about fence_scsi limitations. Message-ID: <20090728173548.6E90512022C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0539e2446709463d0b5036f5d6e5d8a87a3dccb5 Commit: 0539e2446709463d0b5036f5d6e5d8a87a3dccb5 Parent: 9509dcec6bdf1c830ee34edfb0b8b175cdf4dc63 Author: Ryan O'Hara AuthorDate: Tue Jul 28 12:34:39 2009 -0500 Committer: Ryan O'Hara CommitterDate: Tue Jul 28 12:34:39 2009 -0500 BZ 512998 - Add comment about fence_scsi limitations. --- fence/man/fence_scsi.8 | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/fence/man/fence_scsi.8 b/fence/man/fence_scsi.8 index c714fc7..39843cd 100644 --- a/fence/man/fence_scsi.8 +++ b/fence/man/fence_scsi.8 @@ -99,5 +99,12 @@ Name of the node that will perform the fencing operation. \fIverbose = < param >\fR Verbose output. +.SH LIMITATIONS +The fence_scsi fencing agent requires a minimum of three nodes in the +cluster to operate. For SAN devices connected via fiber channel, +these must be physical nodes. SAN devices connected via iSCSI may use +virtual or physical nodes. In addition, fence_scsi cannot be used in +conjunction with qdisk. + .SH SEE ALSO fence(8), fence_node(8), sg_persist(8), lvs(8), lvm.conf(5) From rohara@fedoraproject.org Tue Jul 28 17:41:00 2009 From: rohara@fedoraproject.org (rohara) Date: Tue, 28 Jul 2009 17:41:00 -0000 Subject: cluster: STABLE2 - BZ 512998 - Add comment about fence_scsi limitations. Message-ID: <20090728173801.7E70C12022C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=790e78730c64db0335eb753e7c13c3a83d8264e2 Commit: 790e78730c64db0335eb753e7c13c3a83d8264e2 Parent: 9d256d792a6a1812fcbf0a044a84de8c823a8d65 Author: Ryan O'Hara AuthorDate: Tue Jul 28 12:34:39 2009 -0500 Committer: Ryan O'Hara CommitterDate: Tue Jul 28 12:37:34 2009 -0500 BZ 512998 - Add comment about fence_scsi limitations. --- fence/man/fence_scsi.8 | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/fence/man/fence_scsi.8 b/fence/man/fence_scsi.8 index c714fc7..39843cd 100644 --- a/fence/man/fence_scsi.8 +++ b/fence/man/fence_scsi.8 @@ -99,5 +99,12 @@ Name of the node that will perform the fencing operation. \fIverbose = < param >\fR Verbose output. +.SH LIMITATIONS +The fence_scsi fencing agent requires a minimum of three nodes in the +cluster to operate. For SAN devices connected via fiber channel, +these must be physical nodes. SAN devices connected via iSCSI may use +virtual or physical nodes. In addition, fence_scsi cannot be used in +conjunction with qdisk. + .SH SEE ALSO fence(8), fence_node(8), sg_persist(8), lvs(8), lvm.conf(5) From rohara@fedoraproject.org Tue Jul 28 17:42:00 2009 From: rohara@fedoraproject.org (rohara) Date: Tue, 28 Jul 2009 17:42:00 -0000 Subject: cluster: RHEL54 - BZ 512998 - Add comment about fence_scsi limitations. Message-ID: <20090728174021.238D212022C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=00e7c9c70e8ff1f39aa12b15d99ed240e314ec30 Commit: 00e7c9c70e8ff1f39aa12b15d99ed240e314ec30 Parent: fa15cb16f0de9ddf06ddb50f2fcf26dd9c257931 Author: Ryan O'Hara AuthorDate: Tue Jul 28 12:34:39 2009 -0500 Committer: Ryan O'Hara CommitterDate: Tue Jul 28 12:39:54 2009 -0500 BZ 512998 - Add comment about fence_scsi limitations. --- fence/man/fence_scsi.8 | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/fence/man/fence_scsi.8 b/fence/man/fence_scsi.8 index 09f15fd..7b93422 100644 --- a/fence/man/fence_scsi.8 +++ b/fence/man/fence_scsi.8 @@ -105,5 +105,12 @@ Name of the node that will perform the fencing operation. \fIverbose = < param >\fR Verbose output. +.SH LIMITATIONS +The fence_scsi fencing agent requires a minimum of three nodes in the +cluster to operate. For SAN devices connected via fiber channel, +these must be physical nodes. SAN devices connected via iSCSI may use +virtual or physical nodes. In addition, fence_scsi cannot be used in +conjunction with qdisk. + .SH SEE ALSO fence(8), fence_node(8), sg_persist(8), lvs(8), lvm.conf(5) From teigland@fedoraproject.org Tue Jul 28 18:57:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Tue, 28 Jul 2009 18:57:00 -0000 Subject: cluster: STABLE3 - cluster.rng: move blocks around Message-ID: <20090728185637.9212112022C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=25dd066e31c42b188fbd686f3b85358d0435db9e Commit: 25dd066e31c42b188fbd686f3b85358d0435db9e Parent: 0539e2446709463d0b5036f5d6e5d8a87a3dccb5 Author: David Teigland AuthorDate: Tue Jul 28 13:42:40 2009 -0500 Committer: David Teigland CommitterDate: Tue Jul 28 13:47:52 2009 -0500 cluster.rng: move blocks around put the managable non-agent-related blocks at the beginning, and the fencing and resource agent related stuff at the end. Signed-off-by: David Teigland --- config/tools/xml/cluster.rng | 827 ++++++++++++++++++++---------------------- 1 files changed, 394 insertions(+), 433 deletions(-) diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index 7954ab0..ee54f04 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -6,17 +6,17 @@ xmlns:rha="http://redhat.com/~pkennedy/annotation_namespace/cluster_conf_annot_n cluster - cman -- clusternodes +- totem +- quorumd +- fence_daemon +- fence_xvmd - dlm - gfs_controld - group -- fencedevices -- fence_xvmd - logging -- totem +- clusternodes +- fencedevices - rm -- fence_daemon -- quorumd Element defnitions: - Resource @@ -46,9 +46,7 @@ To validate your cluster.conf against this schema, run: - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -314,50 +539,115 @@ To validate your cluster.conf against this schema, run: - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From teigland@fedoraproject.org Tue Jul 28 19:36:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Tue, 28 Jul 2009 19:36:00 -0000 Subject: cluster: STABLE3 - cluster.rng: comments around fence devices Message-ID: <20090728193605.BF56012022C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ac9ba8add8ef6fdacdaf766026741e42101ba11b Commit: ac9ba8add8ef6fdacdaf766026741e42101ba11b Parent: 25dd066e31c42b188fbd686f3b85358d0435db9e Author: David Teigland AuthorDate: Tue Jul 28 14:26:46 2009 -0500 Committer: David Teigland CommitterDate: Tue Jul 28 14:26:46 2009 -0500 cluster.rng: comments around fence devices trying to understand the structure Signed-off-by: David Teigland --- config/tools/xml/cluster.rng | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index ee54f04..2936cf7 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -672,6 +672,9 @@ To validate your cluster.conf against this schema, run: be used." rha:sample="fence_apc"/> + + + + - + @@ -1097,15 +1101,15 @@ To validate your cluster.conf against this schema, run: + - - - + + @@ -2301,7 +2305,7 @@ To validate your cluster.conf against this schema, run: - + + - + @@ -2662,8 +2667,9 @@ To validate your cluster.conf against this schema, run: + - + @@ -2734,7 +2740,12 @@ To validate your cluster.conf against this schema, run: - - - + + + + + + + + From cfeist@fedoraproject.org Tue Jul 28 20:12:00 2009 From: cfeist@fedoraproject.org (Chris Feist) Date: Tue, 28 Jul 2009 20:12:00 -0000 Subject: cluster: the annotated tag cman_2_0_113 has been created Message-ID: <20090728201228.627E312022C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=878e78ffef6d8059815f3cd58bfd5fdea0d77614 Commit: 878e78ffef6d8059815f3cd58bfd5fdea0d77614 Parent: 0000000000000000000000000000000000000000 Author: Chris Feist AuthorDate: 2009-07-28 20:12 +0000 Committer: Chris Feist CommitterDate: 2009-07-28 20:12 +0000 annotated tag: cman_2_0_113 has been created at 878e78ffef6d8059815f3cd58bfd5fdea0d77614 (tag) tagging 00e7c9c70e8ff1f39aa12b15d99ed240e314ec30 (commit) replaces cman_2_0_112 Ryan O'Hara (1): BZ 512998 - Add comment about fence_scsi limitations. From teigland@fedoraproject.org Tue Jul 28 20:45:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Tue, 28 Jul 2009 20:45:00 -0000 Subject: cluster: STABLE3 - cluster.rng: dlm and gfs_controld descriptions Message-ID: <20090728204456.0943112022C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1558f71870f78c2101d8ef0833c178d2f2d86f8d Commit: 1558f71870f78c2101d8ef0833c178d2f2d86f8d Parent: ac9ba8add8ef6fdacdaf766026741e42101ba11b Author: David Teigland AuthorDate: Tue Jul 28 15:36:07 2009 -0500 Committer: David Teigland CommitterDate: Tue Jul 28 15:36:07 2009 -0500 cluster.rng: dlm and gfs_controld descriptions Signed-off-by: David Teigland --- config/tools/xml/cluster.rng | 80 +++++++++++++++++++++++++++++++----------- 1 files changed, 59 insertions(+), 21 deletions(-) diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index 2936cf7..f7ad55f 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -418,58 +418,91 @@ To validate your cluster.conf against this schema, run: - - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - - + + + @@ -485,13 +518,18 @@ To validate your cluster.conf against this schema, run: - + - + - + cmd = CLUSTER_MSG_TRANSITION; @@ -1889,9 +1891,9 @@ static void do_process_transition(int nodeid, char *data) return; } - /* If the remote node can see AISONLY nodes then we can't join as we don't - know the full state */ - if (msg->flags & NODE_FLAGS_SEESDISALLOWED && !have_disallowed()) { + /* If the remote node can see AISONLY nodes and we want to join, + then we can't, as we don't know the full state */ + if (local_first_trans && msg->flags & NODE_FLAGS_SEESDISALLOWED && !have_disallowed()) { /* Must use syslog directly here or the message will never arrive */ syslog(LOG_CRIT, "CMAN: Joined a cluster with disallowed nodes. must die"); cman_finish(); @@ -1953,10 +1955,10 @@ static void do_process_transition(int nodeid, char *data) add_ais_node(nodeid, incarnation, num_ais_nodes); } - /* If the cluster already has some AISONLY nodes then we can't make - sense of the membership. So the new node has to also be AISONLY - until we are consistent again */ - if (have_disallowed() && !node->us) + /* If the new node is joining and the existing cluster already has some AISONLY + nodes then we can't make sense of the membership. + So the new node has to also be AISONLY until we are consistent again */ + if (msg->first_trans && !node->us && have_disallowed()) node->state = NODESTATE_AISONLY; node->flags = msg->flags; /* This will clear the BEENDOWN flag of course */ From swhiteho@fedoraproject.org Wed Jul 29 13:43:00 2009 From: swhiteho@fedoraproject.org (Steven Whitehouse) Date: Wed, 29 Jul 2009 13:43:00 -0000 Subject: gfs1-utils: master - gfs: Make gfs build with newer kernels Message-ID: <20090729132353.036FB12026C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs1-utils.git?p=gfs1-utils.git;a=commitdiff;h=59273e07bc76d2520c1c14b57d2bc5f5410c7ce6 Commit: 59273e07bc76d2520c1c14b57d2bc5f5410c7ce6 Parent: a5b702ebca0ef783d1c4dc3b6cf0d55221fb45d5 Author: Steven Whitehouse AuthorDate: Wed Jul 29 15:21:27 2009 +0100 Committer: Steven Whitehouse CommitterDate: Wed Jul 29 15:21:27 2009 +0100 gfs: Make gfs build with newer kernels Now builds with the latest upstream kernel: 2.6.31-rc4 Signed-off-by: Steven Whitehouse --- gfs-kernel/src/gfs/acl.c | 1 + gfs-kernel/src/gfs/ops_file.c | 2 +- gfs-kernel/src/gfs/ops_fstype.c | 4 ++-- gfs-kernel/src/gfs/proc.c | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gfs-kernel/src/gfs/acl.c b/gfs-kernel/src/gfs/acl.c index a9312ba..3936baa 100644 --- a/gfs-kernel/src/gfs/acl.c +++ b/gfs-kernel/src/gfs/acl.c @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/gfs-kernel/src/gfs/ops_file.c b/gfs-kernel/src/gfs/ops_file.c index e5b6c4c..fa72924 100644 --- a/gfs-kernel/src/gfs/ops_file.c +++ b/gfs-kernel/src/gfs/ops_file.c @@ -352,7 +352,7 @@ do_read_direct(struct file *file, char *buf, size_t size, loff_t *offset, goto out_gunlock; if (gfs_is_stuffed(ip)) { - size_t mask = bdev_hardsect_size(inode->i_sb->s_bdev) - 1; + size_t mask = bdev_logical_block_size(inode->i_sb->s_bdev) - 1; if (((*offset) & mask) || (((unsigned long)buf) & mask)) goto out_gunlock; diff --git a/gfs-kernel/src/gfs/ops_fstype.c b/gfs-kernel/src/gfs/ops_fstype.c index 93bf4d1..d72b74a 100644 --- a/gfs-kernel/src/gfs/ops_fstype.c +++ b/gfs-kernel/src/gfs/ops_fstype.c @@ -300,9 +300,9 @@ static int init_sb(struct gfs_sbd *sdp, int silent, int undo) sizes, version #s, locations of important on-disk inodes, etc. */ error = -EINVAL; - if (sdp->sd_sb.sb_bsize < bdev_hardsect_size(sb->s_bdev)) { + if (sdp->sd_sb.sb_bsize < bdev_logical_block_size(sb->s_bdev)) { printk("GFS: fsid=%s: FS block size (%u) is too small for device block size (%u)\n", - sdp->sd_fsname, sdp->sd_sb.sb_bsize, bdev_hardsect_size(sb->s_bdev)); + sdp->sd_fsname, sdp->sd_sb.sb_bsize, bdev_logical_block_size(sb->s_bdev)); goto fail; } if (sdp->sd_sb.sb_bsize > PAGE_SIZE) { diff --git a/gfs-kernel/src/gfs/proc.c b/gfs-kernel/src/gfs/proc.c index b25cd1c..069b39d 100644 --- a/gfs-kernel/src/gfs/proc.c +++ b/gfs-kernel/src/gfs/proc.c @@ -470,7 +470,6 @@ gfs_proc_init(void) if (!pde) return -ENOMEM; - pde->owner = THIS_MODULE; pde->proc_fops = &gfs_proc_fops; return 0; From lon@fedoraproject.org Wed Jul 29 14:31:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Wed, 29 Jul 2009 14:31:00 -0000 Subject: cluster: STABLE3 - rgmanager: Assume 'no state' is OK for VMs Message-ID: <20090729143103.8D2C112026C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=df5af75eb7d1c2978340ac3bcd1dd4402d7840c2 Commit: df5af75eb7d1c2978340ac3bcd1dd4402d7840c2 Parent: aa2ea305eb1c7b706a8a3f81adb84f90ecd880d0 Author: Shane Bradley AuthorDate: Wed Jul 29 10:16:41 2009 -0400 Committer: Lon Hohberger CommitterDate: Wed Jul 29 10:30:32 2009 -0400 rgmanager: Assume 'no state' is OK for VMs When vm.sh does a status check, sometimes "no state" is returned. That state is currently not a "running" state. Thus the status check fails. The "no state" should be treated as a running state per recommendation from libvirt developers. Bugzilla: 514044 Signed-off-by: Lon Hohberger Signed-off-by: Shane Bradley --- rgmanager/src/resources/vm.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh index f0e474d..4e701e5 100644 --- a/rgmanager/src/resources/vm.sh +++ b/rgmanager/src/resources/vm.sh @@ -527,7 +527,7 @@ virsh_status() echo $state - if [ "$state" = "running" ] || [ "$state" = "paused" ] || + if [ "$state" = "running" ] || [ "$state" = "paused" ] || [ "$state" = "no state" ] || [ "$state" = "idle" ]; then return 0 fi From lon@fedoraproject.org Wed Jul 29 14:32:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Wed, 29 Jul 2009 14:32:00 -0000 Subject: cluster: RHEL5 - rgmanager: Assume 'no state' is OK for VMs Message-ID: <20090729143153.3023D12026C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d7c71606883ec2f935e8f55152ae673bd1e2d981 Commit: d7c71606883ec2f935e8f55152ae673bd1e2d981 Parent: 5a117a03288275710e987fdd309482ae13cae242 Author: Shane Bradley AuthorDate: Wed Jul 29 10:16:41 2009 -0400 Committer: Lon Hohberger CommitterDate: Wed Jul 29 10:31:39 2009 -0400 rgmanager: Assume 'no state' is OK for VMs When vm.sh does a status check, sometimes "no state" is returned. That state is currently not a "running" state. Thus the status check fails. The "no state" should be treated as a running state per recommendation from libvirt developers. Bugzilla: 514044 Signed-off-by: Lon Hohberger Signed-off-by: Shane Bradley --- rgmanager/src/resources/vm.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh index 8285cd6..24e286d 100755 --- a/rgmanager/src/resources/vm.sh +++ b/rgmanager/src/resources/vm.sh @@ -512,7 +512,7 @@ virsh_status() echo $state - if [ "$state" = "running" ] || [ "$state" = "paused" ] || + if [ "$state" = "running" ] || [ "$state" = "paused" ] || [ "$state" = "no state" ] || [ "$state" = "idle" ]; then return 0 fi From lon@fedoraproject.org Wed Jul 29 14:32:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Wed, 29 Jul 2009 14:32:00 -0000 Subject: cluster: RHEL54 - rgmanager: Assume 'no state' is OK for VMs Message-ID: <20090729143221.943B112026C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=08f5d180d1a6e3b376a2f0864368840ff264700b Commit: 08f5d180d1a6e3b376a2f0864368840ff264700b Parent: 00e7c9c70e8ff1f39aa12b15d99ed240e314ec30 Author: Shane Bradley AuthorDate: Wed Jul 29 10:16:41 2009 -0400 Committer: Lon Hohberger CommitterDate: Wed Jul 29 10:32:10 2009 -0400 rgmanager: Assume 'no state' is OK for VMs When vm.sh does a status check, sometimes "no state" is returned. That state is currently not a "running" state. Thus the status check fails. The "no state" should be treated as a running state per recommendation from libvirt developers. Bugzilla: 514044 Signed-off-by: Lon Hohberger Signed-off-by: Shane Bradley --- rgmanager/src/resources/vm.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh index 8285cd6..24e286d 100755 --- a/rgmanager/src/resources/vm.sh +++ b/rgmanager/src/resources/vm.sh @@ -512,7 +512,7 @@ virsh_status() echo $state - if [ "$state" = "running" ] || [ "$state" = "paused" ] || + if [ "$state" = "running" ] || [ "$state" = "paused" ] || [ "$state" = "no state" ] || [ "$state" = "idle" ]; then return 0 fi From lon@fedoraproject.org Wed Jul 29 14:34:00 2009 From: lon@fedoraproject.org (Lon Hohberger) Date: Wed, 29 Jul 2009 14:34:00 -0000 Subject: resource-agents: master - rgmanager: Assume 'no state' is OK for VMs Message-ID: <20090729143349.23FD912026C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/resource-agents.git?p=resource-agents.git;a=commitdiff;h=f29f45db2b6bb9c899791d3d769310ffdb50b969 Commit: f29f45db2b6bb9c899791d3d769310ffdb50b969 Parent: b3bc0b969f7bb69f5b2dd1ea39be8c9dc7524304 Author: Shane Bradley AuthorDate: Wed Jul 29 10:16:41 2009 -0400 Committer: Lon Hohberger CommitterDate: Wed Jul 29 10:33:05 2009 -0400 rgmanager: Assume 'no state' is OK for VMs When vm.sh does a status check, sometimes "no state" is returned. That state is currently not a "running" state. Thus the status check fails. The "no state" should be treated as a running state per recommendation from libvirt developers. Bugzilla: 514044 Signed-off-by: Lon Hohberger Signed-off-by: Shane Bradley --- rgmanager/src/resources/vm.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh index f0e474d..4e701e5 100644 --- a/rgmanager/src/resources/vm.sh +++ b/rgmanager/src/resources/vm.sh @@ -527,7 +527,7 @@ virsh_status() echo $state - if [ "$state" = "running" ] || [ "$state" = "paused" ] || + if [ "$state" = "running" ] || [ "$state" = "paused" ] || [ "$state" = "no state" ] || [ "$state" = "idle" ]; then return 0 fi From swhiteho@fedoraproject.org Wed Jul 29 14:37:00 2009 From: swhiteho@fedoraproject.org (Steven Whitehouse) Date: Wed, 29 Jul 2009 14:37:00 -0000 Subject: gfs1-utils: master - gfs: Fix build warnings due to print formats Message-ID: <20090729143639.5EF8512026C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs1-utils.git?p=gfs1-utils.git;a=commitdiff;h=5ed9a27e3b4cf5dfa83b05115a8c9772006fc1a1 Commit: 5ed9a27e3b4cf5dfa83b05115a8c9772006fc1a1 Parent: 59273e07bc76d2520c1c14b57d2bc5f5410c7ce6 Author: Steven Whitehouse AuthorDate: Wed Jul 29 16:34:36 2009 +0100 Committer: Steven Whitehouse CommitterDate: Wed Jul 29 16:34:36 2009 +0100 gfs: Fix build warnings due to print formats Signed-off-by: Steven Whitehouse --- gfs-kernel/src/gfs/dio.c | 14 +++++----- gfs-kernel/src/gfs/gfs.h | 24 ------------------- gfs-kernel/src/gfs/gfs_ondisk.h | 48 +++++++++++++++++++------------------- gfs-kernel/src/gfs/glock.c | 9 ++++--- gfs-kernel/src/gfs/inode.c | 5 ++- gfs-kernel/src/gfs/ioctl.c | 20 ++++++++-------- gfs-kernel/src/gfs/log.c | 12 ++++++--- gfs-kernel/src/gfs/lops.c | 15 ++++++----- gfs-kernel/src/gfs/lvb.c | 6 ++-- gfs-kernel/src/gfs/recovery.c | 16 ++++++------ gfs-kernel/src/gfs/util.c | 32 +++++++++++++++---------- 11 files changed, 95 insertions(+), 106 deletions(-) diff --git a/gfs-kernel/src/gfs/dio.c b/gfs-kernel/src/gfs/dio.c index 0d09023..56cb185 100644 --- a/gfs-kernel/src/gfs/dio.c +++ b/gfs-kernel/src/gfs/dio.c @@ -66,9 +66,9 @@ stuck_releasepage(struct buffer_head *bh) struct gfs_bufdata *bd = get_v2bd(bh); printk("GFS: fsid=%s: stuck in gfs_releasepage()...\n", sdp->sd_fsname); - printk("GFS: fsid=%s: blkno = %"PRIu64", bh->b_count = %d\n", + printk("GFS: fsid=%s: blkno = %llu, bh->b_count = %d\n", sdp->sd_fsname, - (uint64_t)bh->b_blocknr, + (unsigned long long)bh->b_blocknr, atomic_read(&bh->b_count)); printk("GFS: fsid=%s: get_v2bd(bh) = %s\n", sdp->sd_fsname, @@ -77,10 +77,10 @@ stuck_releasepage(struct buffer_head *bh) if (bd) { struct gfs_glock *gl = bd->bd_gl; - printk("GFS: fsid=%s: gl = (%u, %"PRIu64")\n", + printk("GFS: fsid=%s: gl = (%u, %llu)\n", sdp->sd_fsname, gl->gl_name.ln_type, - gl->gl_name.ln_number); + (unsigned long long)gl->gl_name.ln_number); printk("GFS: fsid=%s: bd_new_le.le_trans = %s\n", sdp->sd_fsname, @@ -103,10 +103,10 @@ stuck_releasepage(struct buffer_head *bh) if (ip) { unsigned int x; - printk("GFS: fsid=%s: ip = %"PRIu64"/%"PRIu64"\n", + printk("GFS: fsid=%s: ip = %llu/%llu\n", sdp->sd_fsname, - ip->i_num.no_formal_ino, - ip->i_num.no_addr); + (unsigned long long)ip->i_num.no_formal_ino, + (unsigned long long)ip->i_num.no_addr); printk("GFS: fsid=%s: ip->i_count = %d, ip->i_vnode = %s\n", sdp->sd_fsname, atomic_read(&ip->i_count), diff --git a/gfs-kernel/src/gfs/gfs.h b/gfs-kernel/src/gfs/gfs.h index 7cec09c..3229308 100644 --- a/gfs-kernel/src/gfs/gfs.h +++ b/gfs-kernel/src/gfs/gfs.h @@ -22,30 +22,6 @@ #define NO_CREATE (0) #define CREATE (1) -#if (BITS_PER_LONG == 64) -#define PRIu64 "lu" -#define PRId64 "ld" -#define PRIo64 "lo" -#define PRIx64 "lx" -#define PRIX64 "lX" -#define SCNu64 "lu" -#define SCNd64 "ld" -#define SCNo64 "lo" -#define SCNx64 "lx" -#define SCNX64 "lX" -#else -#define PRIu64 "Lu" -#define PRId64 "Ld" -#define PRIo64 "Lo" -#define PRIx64 "Lx" -#define PRIX64 "LX" -#define SCNu64 "Lu" -#define SCNd64 "Ld" -#define SCNo64 "Lo" -#define SCNx64 "Lx" -#define SCNX64 "LX" -#endif - /* Divide num by den. Round up if there is a remainder. */ #define DIV_RU(num, den) (((num) + (den) - 1) / (den)) #define MAKE_MULT8(x) (((x) + 7) & ~7) diff --git a/gfs-kernel/src/gfs/gfs_ondisk.h b/gfs-kernel/src/gfs/gfs_ondisk.h index eea9038..11637c6 100644 --- a/gfs-kernel/src/gfs/gfs_ondisk.h +++ b/gfs-kernel/src/gfs/gfs_ondisk.h @@ -788,8 +788,8 @@ gfs_inum_out(struct gfs_inum *no, char *buf) void gfs_inum_print(struct gfs_inum *no) { - pv(no, no_formal_ino, "%"PRIu64); - pv(no, no_addr, "%"PRIu64); + pv(no, no_formal_ino, "%llu"); + pv(no, no_addr, "%llu"); } /** @@ -847,7 +847,7 @@ gfs_meta_header_print(struct gfs_meta_header *mh) { pv(mh, mh_magic, "0x%.8X"); pv(mh, mh_type, "%u"); - pv(mh, mh_generation, "%"PRIu64); + pv(mh, mh_generation, "%llu"); pv(mh, mh_format, "%u"); pv(mh, mh_incarn, "%u"); } @@ -1001,7 +1001,7 @@ gfs_jindex_out(struct gfs_jindex *jindex, char *buf) void gfs_jindex_print(struct gfs_jindex *ji) { - pv(ji, ji_addr, "%"PRIu64); + pv(ji, ji_addr, "%llu"); pv(ji, ji_nsegment, "%u"); pv(ji, ji_pad, "%u"); @@ -1065,11 +1065,11 @@ gfs_rindex_out(struct gfs_rindex *grindex, char *buf) void gfs_rindex_print(struct gfs_rindex *ri) { - pv(ri, ri_addr, "%"PRIu64); + pv(ri, ri_addr, "%llu"); pv(ri, ri_length, "%u"); pv(ri, ri_pad, "%u"); - pv(ri, ri_data1, "%"PRIu64); + pv(ri, ri_data1, "%llu"); pv(ri, ri_data, "%u"); pv(ri, ri_bitbytes, "%u"); @@ -1205,9 +1205,9 @@ gfs_quota_out(struct gfs_quota *quota, char *buf) void gfs_quota_print(struct gfs_quota *quota) { - pv(quota, qu_limit, "%"PRIu64); - pv(quota, qu_warn, "%"PRIu64); - pv(quota, qu_value, "%"PRId64); + pv(quota, qu_limit, "%llu"); + pv(quota, qu_warn, "%llu"); + pv(quota, qu_value, "%llu"); pa(quota, qu_reserved, 64); } @@ -1327,16 +1327,16 @@ gfs_dinode_print(struct gfs_dinode *di) pv(di, di_uid, "%u"); pv(di, di_gid, "%u"); pv(di, di_nlink, "%u"); - pv(di, di_size, "%"PRIu64); - pv(di, di_blocks, "%"PRIu64); - pv(di, di_atime, "%"PRId64); - pv(di, di_mtime, "%"PRId64); - pv(di, di_ctime, "%"PRId64); + pv(di, di_size, "%llu"); + pv(di, di_blocks, "%llu"); + pv(di, di_atime, "%lld"); + pv(di, di_mtime, "%llu"); + pv(di, di_ctime, "%llu"); pv(di, di_major, "%u"); pv(di, di_minor, "%u"); - pv(di, di_rgrp, "%"PRIu64); - pv(di, di_goal_rgrp, "%"PRIu64); + pv(di, di_rgrp, "%llu"); + pv(di, di_goal_rgrp, "%llu"); pv(di, di_goal_dblk, "%u"); pv(di, di_goal_mblk, "%u"); pv(di, di_flags, "0x%.8X"); @@ -1351,7 +1351,7 @@ gfs_dinode_print(struct gfs_dinode *di) gfs_inum_print(&di->di_next_unused); - pv(di, di_eattr, "%"PRIu64); + pv(di, di_eattr, "%llu"); pa(di, di_reserved, 56); } @@ -1529,7 +1529,7 @@ gfs_leaf_print(struct gfs_leaf *lf) pv(lf, lf_depth, "%u"); pv(lf, lf_entries, "%u"); pv(lf, lf_dirent_format, "%u"); - pv(lf, lf_next, "%"PRIu64); + pv(lf, lf_next, "%llu"); pa(lf, lf_reserved, 64); } @@ -1600,11 +1600,11 @@ gfs_log_header_print(struct gfs_log_header *lh) pv(lh, lh_flags, "0x%.8X"); pv(lh, lh_pad, "%u"); - pv(lh, lh_first, "%"PRIu64); - pv(lh, lh_sequence, "%"PRIu64); + pv(lh, lh_first, "%llu"); + pv(lh, lh_sequence, "%llu"); - pv(lh, lh_tail, "%"PRIu64); - pv(lh, lh_last_dump, "%"PRIu64); + pv(lh, lh_tail, "%llu"); + pv(lh, lh_last_dump, "%llu"); pa(lh, lh_reserved, 64); } @@ -1715,7 +1715,7 @@ gfs_block_tag_out(struct gfs_block_tag *tag, char *buf) void gfs_block_tag_print(struct gfs_block_tag *tag) { - pv(tag, bt_blkno, "%"PRIu64); + pv(tag, bt_blkno, "%llu"); pv(tag, bt_flags, "%u"); pv(tag, bt_pad, "%u"); } @@ -1763,7 +1763,7 @@ gfs_quota_tag_out(struct gfs_quota_tag *tag, char *buf) void gfs_quota_tag_print(struct gfs_quota_tag *tag) { - pv(tag, qt_change, "%"PRId64); + pv(tag, qt_change, "%llu"); pv(tag, qt_flags, "0x%.8X"); pv(tag, qt_id, "%u"); } diff --git a/gfs-kernel/src/gfs/glock.c b/gfs-kernel/src/gfs/glock.c index 57a829d..3040c60 100644 --- a/gfs-kernel/src/gfs/glock.c +++ b/gfs-kernel/src/gfs/glock.c @@ -2806,8 +2806,9 @@ dump_inode(struct gfs_inode *ip, int error = -ENOBUFS; gfs_printf(" Inode:\n"); - gfs_printf(" num = %" PRIu64 "/%" PRIu64 "\n", - ip->i_num.no_formal_ino, ip->i_num.no_addr); + gfs_printf(" num = %llu/%llu\n", + (unsigned long long)ip->i_num.no_formal_ino, + (unsigned long long)ip->i_num.no_addr); gfs_printf(" type = %u\n", ip->i_di.di_type); gfs_printf(" i_count = %d\n", atomic_read(&ip->i_count)); gfs_printf(" i_flags ="); @@ -2844,9 +2845,9 @@ dump_glock(struct gfs_glock *gl, spin_lock(&gl->gl_spin); - gfs_printf("Glock (%u, %" PRIu64 ")\n", + gfs_printf("Glock (%u, %llu)\n", gl->gl_name.ln_type, - gl->gl_name.ln_number); + (unsigned long long)gl->gl_name.ln_number); gfs_printf(" gl_flags ="); for (x = 0; x < 32; x++) if (test_bit(x, &gl->gl_flags)) diff --git a/gfs-kernel/src/gfs/inode.c b/gfs-kernel/src/gfs/inode.c index 1e3684a..68c94e6 100644 --- a/gfs-kernel/src/gfs/inode.c +++ b/gfs-kernel/src/gfs/inode.c @@ -1173,8 +1173,9 @@ make_dinode(struct gfs_inode *dip, rgd = gfs_blk2rgrpd(sdp, inum->no_addr); if (!rgd) { if (gfs_consist(sdp)) - printk("GFS: fsid=%s: block = %"PRIu64"\n", - sdp->sd_fsname, inum->no_addr); + printk("GFS: fsid=%s: block = %llu\n", + sdp->sd_fsname, + (unsigned long long)inum->no_addr); brelse(dibh); return -EIO; } diff --git a/gfs-kernel/src/gfs/ioctl.c b/gfs-kernel/src/gfs/ioctl.c index b875b4a..afc08f0 100644 --- a/gfs-kernel/src/gfs/ioctl.c +++ b/gfs-kernel/src/gfs/ioctl.c @@ -273,12 +273,12 @@ gi_get_stat_gfs(struct gfs_inode *ip, gfs_printf("version 0\n"); gfs_printf("bsize %u\n", ip->i_sbd->sd_sb.sb_bsize); - gfs_printf("total_blocks %"PRIu64"\n", sg.sg_total_blocks); - gfs_printf("free %"PRIu64"\n", sg.sg_free); - gfs_printf("used_dinode %"PRIu64"\n", sg.sg_used_dinode); - gfs_printf("free_dinode %"PRIu64"\n", sg.sg_free_dinode); - gfs_printf("used_meta %"PRIu64"\n", sg.sg_used_meta); - gfs_printf("free_meta %"PRIu64"\n", sg.sg_free_meta); + gfs_printf("total_blocks %llu\n", (unsigned long long)sg.sg_total_blocks); + gfs_printf("free %llu\n", (unsigned long long)sg.sg_free); + gfs_printf("used_dinode %llu\n", (unsigned long long)sg.sg_used_dinode); + gfs_printf("free_dinode %llu\n", (unsigned long long)sg.sg_free_dinode); + gfs_printf("used_meta %llu\n", (unsigned long long)sg.sg_used_meta); + gfs_printf("free_meta %llu\n", (unsigned long long)sg.sg_free_meta); error = 0; @@ -357,8 +357,8 @@ gi_get_counters(struct gfs_inode *ip, atomic_read(&sdp->sd_depend_count)); gfs_printf("sd_reclaim_count:glocks on reclaim list::%d\n", atomic_read(&sdp->sd_reclaim_count)); - gfs_printf("sd_log_wrap:log wraps::%"PRIu64"\n", - sdp->sd_log_wrap); + gfs_printf("sd_log_wrap:log wraps::%llu\n", + (unsigned long long)sdp->sd_log_wrap); gfs_printf("sd_lm_outstanding:outstanding LM calls::%d\n", atomic_read(&sdp->sd_lm_outstanding)); gfs_printf("sd_bio_outstanding:outstanding BIO calls::%u\n", @@ -804,8 +804,8 @@ gi_do_reclaim(struct gfs_inode *ip, error = -ENOBUFS; gfs_printf("version 0\n"); - gfs_printf("inodes %"PRIu64"\n", inodes); - gfs_printf("metadata %"PRIu64"\n", metadata); + gfs_printf("inodes %llu\n", (unsigned long long)inodes); + gfs_printf("metadata %llu\n", (unsigned long long)metadata); error = 0; diff --git a/gfs-kernel/src/gfs/log.c b/gfs-kernel/src/gfs/log.c index 21b0404..f8f2f6c 100644 --- a/gfs-kernel/src/gfs/log.c +++ b/gfs-kernel/src/gfs/log.c @@ -551,10 +551,14 @@ check_seg_usage(struct gfs_sbd *sdp, struct gfs_trans *tr) default: gfs_assert(sdp, FALSE, - printk("GFS: fsid=%s: head_off = %"PRIu64", head_wrap = %"PRIu64"\n" - "GFS: fsid=%s: dump_off = %"PRIu64", dump_wrap = %"PRIu64"\n", - sdp->sd_fsname, head_off, head_wrap, - sdp->sd_fsname, dump_off, dump_wrap);); + printk("GFS: fsid=%s: head_off = %llu, head_wrap = %llu\n" + "GFS: fsid=%s: dump_off = %llu, dump_wrap = %llu\n", + sdp->sd_fsname, + (unsigned long long)head_off, + (unsigned long long)head_wrap, + sdp->sd_fsname, + (unsigned long long)dump_off, + (unsigned long long)dump_wrap);); break; } } diff --git a/gfs-kernel/src/gfs/lops.c b/gfs-kernel/src/gfs/lops.c index 6010444..70f2a32 100644 --- a/gfs-kernel/src/gfs/lops.c +++ b/gfs-kernel/src/gfs/lops.c @@ -85,9 +85,9 @@ glock_print(struct gfs_sbd *sdp, struct gfs_log_element *le, unsigned int where) return; } - printk(" Glock: (%u, %"PRIu64")\n", + printk(" Glock: (%u, %llu)\n", gl->gl_name.ln_type, - gl->gl_name.ln_number); + (unsigned long long)gl->gl_name.ln_number); } /** @@ -222,7 +222,7 @@ buf_print(struct gfs_sbd *sdp, struct gfs_log_element *le, unsigned int where) return; } - printk(" Buffer: %"PRIu64"\n", (uint64_t)bd->bd_bh->b_blocknr); + printk(" Buffer: %llu\n", (unsigned long long)bd->bd_bh->b_blocknr); } /** @@ -726,8 +726,9 @@ unlinked_print(struct gfs_sbd *sdp, struct gfs_log_element *le, return; } - printk(" unlinked: %"PRIu64"/%"PRIu64", %s\n", - ul->ul_inum.no_formal_ino, ul->ul_inum.no_addr, + printk(" unlinked: %llu/%llu, %s\n", + (unsigned long long)ul->ul_inum.no_formal_ino, + (unsigned long long)ul->ul_inum.no_addr, type); } @@ -1172,9 +1173,9 @@ quota_print(struct gfs_sbd *sdp, struct gfs_log_element *le, unsigned int where) struct gfs_quota_le *ql; ql = container_of(le, struct gfs_quota_le, ql_le); - printk(" quota: %s %u: %"PRId64" blocks\n", + printk(" quota: %s %u: %lld blocks\n", (test_bit(QDF_USER, &ql->ql_data->qd_flags)) ? "user" : "group", - ql->ql_data->qd_id, ql->ql_change); + ql->ql_data->qd_id, (long long)ql->ql_change); } /** diff --git a/gfs-kernel/src/gfs/lvb.c b/gfs-kernel/src/gfs/lvb.c index 41fc26f..8e7d75d 100644 --- a/gfs-kernel/src/gfs/lvb.c +++ b/gfs-kernel/src/gfs/lvb.c @@ -129,7 +129,7 @@ gfs_quota_lvb_print(struct gfs_quota_lvb *qb) { pv(qb, qb_magic, "%u"); pv(qb, qb_pad, "%u"); - pv(qb, qb_limit, "%"PRIu64); - pv(qb, qb_warn, "%"PRIu64); - pv(qb, qb_value, "%"PRId64); + pv(qb, qb_limit, "%llu"); + pv(qb, qb_warn, "%llu"); + pv(qb, qb_value, "%lld"); } diff --git a/gfs-kernel/src/gfs/recovery.c b/gfs-kernel/src/gfs/recovery.c index ba5f34d..d014272 100644 --- a/gfs-kernel/src/gfs/recovery.c +++ b/gfs-kernel/src/gfs/recovery.c @@ -311,14 +311,14 @@ gfs_increment_blkno(struct gfs_sbd *sdp, struct gfs_jindex *jdesc, if (error) { /* Corrupt headers here are bad */ if (gfs_consist(sdp)) - printk("GFS: fsid=%s: *addr = %"PRIu64"\n", - sdp->sd_fsname, *addr); + printk("GFS: fsid=%s: *addr = %llu\n", + sdp->sd_fsname, (unsigned long long)*addr); return -EIO; } if (header.lh_first == *addr) { if (gfs_consist(sdp)) - printk("GFS: fsid=%s: *addr = %"PRIu64"\n", - sdp->sd_fsname, *addr); + printk("GFS: fsid=%s: *addr = %llu\n", + sdp->sd_fsname, (unsigned long long)*addr); gfs_log_header_print(&header); return -EIO; } @@ -367,14 +367,14 @@ foreach_descriptor(struct gfs_sbd *sdp, struct gfs_jindex *jdesc, if (error) { /* Corrupt headers here are bad */ if (gfs_consist(sdp)) - printk("GFS: fsid=%s: start = %"PRIu64"\n", - sdp->sd_fsname, start); + printk("GFS: fsid=%s: start = %llu\n", + sdp->sd_fsname, (unsigned long long)start); return -EIO; } if (header.lh_first != start) { if (gfs_consist(sdp)) - printk("GFS: fsid=%s: start = %"PRIu64"\n", - sdp->sd_fsname, start); + printk("GFS: fsid=%s: start = %llu\n", + sdp->sd_fsname, (unsigned long long)start); gfs_log_header_print(&header); return -EIO; } diff --git a/gfs-kernel/src/gfs/util.c b/gfs-kernel/src/gfs/util.c index 7d1c0e4..0367424 100644 --- a/gfs-kernel/src/gfs/util.c +++ b/gfs-kernel/src/gfs/util.c @@ -327,12 +327,14 @@ gfs_consist_inode_i(struct gfs_inode *ip, int cluster_wide, struct gfs_sbd *sdp = ip->i_sbd; return gfs_lm_withdraw(sdp, "GFS: fsid=%s: fatal: filesystem consistency error\n" - "GFS: fsid=%s: inode = %"PRIu64"/%"PRIu64"\n" + "GFS: fsid=%s: inode = %llu/%llu\n" "GFS: fsid=%s: function = %s\n" "GFS: fsid=%s: file = %s, line = %u\n" "GFS: fsid=%s: time = %lu\n", sdp->sd_fsname, - sdp->sd_fsname, ip->i_num.no_formal_ino, ip->i_num.no_addr, + sdp->sd_fsname, + (unsigned long long)ip->i_num.no_formal_ino, + (unsigned long long)ip->i_num.no_addr, sdp->sd_fsname, function, sdp->sd_fsname, file, line, sdp->sd_fsname, get_seconds()); @@ -358,12 +360,13 @@ gfs_consist_rgrpd_i(struct gfs_rgrpd *rgd, int cluster_wide, struct gfs_sbd *sdp = rgd->rd_sbd; return gfs_lm_withdraw(sdp, "GFS: fsid=%s: fatal: filesystem consistency error\n" - "GFS: fsid=%s: RG = %"PRIu64"\n" + "GFS: fsid=%s: RG = %llu\n" "GFS: fsid=%s: function = %s\n" "GFS: fsid=%s: file = %s, line = %u\n" "GFS: fsid=%s: time = %lu\n", sdp->sd_fsname, - sdp->sd_fsname, rgd->rd_ri.ri_addr, + sdp->sd_fsname, + (unsigned long long)rgd->rd_ri.ri_addr, sdp->sd_fsname, function, sdp->sd_fsname, file, line, sdp->sd_fsname, get_seconds()); @@ -389,12 +392,12 @@ gfs_meta_check_ii(struct gfs_sbd *sdp, struct buffer_head *bh, int me; me = gfs_lm_withdraw(sdp, "GFS: fsid=%s: fatal: invalid metadata block\n" - "GFS: fsid=%s: bh = %"PRIu64" (magic)\n" + "GFS: fsid=%s: bh = %llu (magic)\n" "GFS: fsid=%s: function = %s\n" "GFS: fsid=%s: file = %s, line = %u\n" "GFS: fsid=%s: time = %lu\n", sdp->sd_fsname, - sdp->sd_fsname, (uint64_t)bh->b_blocknr, + sdp->sd_fsname, (unsigned long long)bh->b_blocknr, sdp->sd_fsname, function, sdp->sd_fsname, file, line, sdp->sd_fsname, get_seconds()); @@ -424,13 +427,13 @@ gfs_metatype_check_ii(struct gfs_sbd *sdp, struct buffer_head *bh, int me; me = gfs_lm_withdraw(sdp, "GFS: fsid=%s: fatal: invalid metadata block\n" - "GFS: fsid=%s: bh = %"PRIu64" (type: exp=%u, found=%u)\n" + "GFS: fsid=%s: bh = %llu (type: exp=%u, found=%u)\n" "GFS: fsid=%s: function = %s\n" "GFS: fsid=%s: file = %s, line = %u\n" "GFS: fsid=%s: time = %lu\n", sdp->sd_fsname, - sdp->sd_fsname, (uint64_t)bh->b_blocknr, type, t, - sdp->sd_fsname, function, + sdp->sd_fsname, (unsigned long long)bh->b_blocknr, + type, t, sdp->sd_fsname, function, sdp->sd_fsname, file, line, sdp->sd_fsname, get_seconds()); return (me) ? -1 : -2; @@ -482,12 +485,14 @@ gfs_io_error_inode_i(struct gfs_inode *ip, struct gfs_sbd *sdp = ip->i_sbd; return gfs_lm_withdraw(sdp, "GFS: fsid=%s: fatal: I/O error\n" - "GFS: fsid=%s: inode = %"PRIu64"/%"PRIu64"\n" + "GFS: fsid=%s: inode = %llu/%llu\n" "GFS: fsid=%s: function = %s\n" "GFS: fsid=%s: file = %s, line = %u\n" "GFS: fsid=%s: time = %lu\n", sdp->sd_fsname, - sdp->sd_fsname, ip->i_num.no_formal_ino, ip->i_num.no_addr, + sdp->sd_fsname, + (unsigned long long)ip->i_num.no_formal_ino, + (unsigned long long)ip->i_num.no_addr, sdp->sd_fsname, function, sdp->sd_fsname, file, line, sdp->sd_fsname, get_seconds()); @@ -512,12 +517,13 @@ gfs_io_error_bh_i(struct gfs_sbd *sdp, struct buffer_head *bh, { return gfs_lm_withdraw(sdp, "GFS: fsid=%s: fatal: I/O error\n" - "GFS: fsid=%s: block = %"PRIu64"\n" + "GFS: fsid=%s: block = %llu\n" "GFS: fsid=%s: function = %s\n" "GFS: fsid=%s: file = %s, line = %u\n" "GFS: fsid=%s: time = %lu\n", sdp->sd_fsname, - sdp->sd_fsname, (uint64_t)bh->b_blocknr, + sdp->sd_fsname, + (unsigned long long)bh->b_blocknr, sdp->sd_fsname, function, sdp->sd_fsname, file, line, sdp->sd_fsname, get_seconds()); From swhiteho@fedoraproject.org Wed Jul 29 15:05:00 2009 From: swhiteho@fedoraproject.org (Steven Whitehouse) Date: Wed, 29 Jul 2009 15:05:00 -0000 Subject: gfs1-utils: master - gfs2: Use GFP_NOFS in a few places to be safe Message-ID: <20090729150457.733DD12026C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs1-utils.git?p=gfs1-utils.git;a=commitdiff;h=25accee401db0e37bb0880581cdaa998e3dbe726 Commit: 25accee401db0e37bb0880581cdaa998e3dbe726 Parent: 5ed9a27e3b4cf5dfa83b05115a8c9772006fc1a1 Author: Steven Whitehouse AuthorDate: Wed Jul 29 17:02:14 2009 +0100 Committer: Steven Whitehouse CommitterDate: Wed Jul 29 17:02:14 2009 +0100 gfs2: Use GFP_NOFS in a few places to be safe Just a few updates to avoid any problems resulting from memory allocation during transactions. Signed-off-by: Steven Whitehouse --- gfs-kernel/src/gfs/acl.c | 8 ++++---- gfs-kernel/src/gfs/eattr.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gfs-kernel/src/gfs/acl.c b/gfs-kernel/src/gfs/acl.c index 3936baa..3e9d358 100644 --- a/gfs-kernel/src/gfs/acl.c +++ b/gfs-kernel/src/gfs/acl.c @@ -127,7 +127,7 @@ gfs_acl_get(struct gfs_inode *ip, int access, struct posix_acl **acl) if (!GFS_EA_DATA_LEN(el.el_ea)) goto out; - er.er_data = kmalloc(GFS_EA_DATA_LEN(el.el_ea), GFP_KERNEL); + er.er_data = kmalloc(GFS_EA_DATA_LEN(el.el_ea), GFP_NOFS); error = -ENOMEM; if (!er.er_data) goto out; @@ -214,7 +214,7 @@ gfs_acl_new_prep(struct gfs_inode *dip, } { - struct posix_acl *clone = posix_acl_clone(acl, GFP_KERNEL); + struct posix_acl *clone = posix_acl_clone(acl, GFP_NOFS); error = -ENOMEM; if (!clone) goto out; @@ -250,7 +250,7 @@ gfs_acl_new_prep(struct gfs_inode *dip, b *= 2; b++; - d = kmalloc(s, GFP_KERNEL); + d = kmalloc(s, GFP_NOFS); error = -ENOMEM; if (!d) goto out; @@ -355,7 +355,7 @@ gfs_acl_chmod(struct gfs_inode *ip, struct iattr *attr) if (!GFS_EA_DATA_LEN(el.el_ea)) goto simple; - er.er_data = kmalloc(GFS_EA_DATA_LEN(el.el_ea), GFP_KERNEL); + er.er_data = kmalloc(GFS_EA_DATA_LEN(el.el_ea), GFP_NOFS); error = -ENOMEM; if (!er.er_data) goto out; diff --git a/gfs-kernel/src/gfs/eattr.c b/gfs-kernel/src/gfs/eattr.c index 062b682..0558300 100644 --- a/gfs-kernel/src/gfs/eattr.c +++ b/gfs-kernel/src/gfs/eattr.c @@ -596,7 +596,7 @@ ea_get_unstuffed(struct gfs_inode *ip, struct gfs_ea_header *ea, unsigned int x; int error = 0; - bh = kmalloc(nptrs * sizeof(struct buffer_head *), GFP_KERNEL); + bh = kmalloc(nptrs * sizeof(struct buffer_head *), GFP_NOFS); if (!bh) return -ENOMEM; @@ -1621,7 +1621,7 @@ ea_acl_chmod_unstuffed(struct gfs_inode *ip, unsigned int x; int error; - bh = kmalloc(nptrs * sizeof(struct buffer_head *), GFP_KERNEL); + bh = kmalloc(nptrs * sizeof(struct buffer_head *), GFP_NOFS); if (!bh) return -ENOMEM; From swhiteho@fedoraproject.org Wed Jul 29 15:11:00 2009 From: swhiteho@fedoraproject.org (Steven Whitehouse) Date: Wed, 29 Jul 2009 15:11:00 -0000 Subject: gfs1-utils: master - gfs: Fabio's Makefile fix Message-ID: <20090729151122.D9D3512026C@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs1-utils.git?p=gfs1-utils.git;a=commitdiff;h=ae891161ac24349b115e96593b9a655189313fdf Commit: ae891161ac24349b115e96593b9a655189313fdf Parent: 25accee401db0e37bb0880581cdaa998e3dbe726 Author: Steven Whitehouse AuthorDate: Wed Jul 29 17:08:34 2009 +0100 Committer: Steven Whitehouse CommitterDate: Wed Jul 29 17:08:34 2009 +0100 gfs: Fabio's Makefile fix Adds a .PHONY line so that gfs-kernel will rebuild when it should. Signed-off-by: Steven Whitehouse Signed-off-by: Fabio M. Di Nitto --- gfs-kernel/src/gfs/Makefile | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/gfs-kernel/src/gfs/Makefile b/gfs-kernel/src/gfs/Makefile index aa12e01..b85eaeb 100644 --- a/gfs-kernel/src/gfs/Makefile +++ b/gfs-kernel/src/gfs/Makefile @@ -1,3 +1,4 @@ +.PHONY: gfs.ko TARGET= gfs.ko KMODT=$(TARGET) From marx@fedoraproject.org Thu Jul 30 09:59:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 30 Jul 2009 09:59:00 -0000 Subject: cluster: RHEL5 - fencing: #508722 - Fence agent for HP iLO 2 MP Message-ID: <20090730095924.E222512035D@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=d0517e88112d8e04be3dbac15ffba11f823250e0 Commit: d0517e88112d8e04be3dbac15ffba11f823250e0 Parent: d7c71606883ec2f935e8f55152ae673bd1e2d981 Author: Marek 'marx' Grac AuthorDate: Thu Jul 30 11:53:38 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Thu Jul 30 11:53:38 2009 +0200 fencing: #508722 - Fence agent for HP iLO 2 MP New fence agent for HP iLO2 MP used in Blade Servers. It uses SMASH interface over telnet/ssh. fence_ilo uses RIBCL over SSL what is not supported on these machines. --- fence/agents/Makefile | 3 +++ fence/agents/lib/fencing.py.py | 3 +++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/fence/agents/Makefile b/fence/agents/Makefile index c8ef06a..4a043ae 100644 --- a/fence/agents/Makefile +++ b/fence/agents/Makefile @@ -27,6 +27,7 @@ all: ${MAKE} -C egenera all # ${MAKE} -C ibmblade all ${MAKE} -C ilo all + ${MAKE} -C ilo_mp all ${MAKE} -C ipmilan all ${MAKE} -C lpar all ${MAKE} -C manual all @@ -58,6 +59,7 @@ install: all ${MAKE} -C egenera install # ${MAKE} -C ibmblade install ${MAKE} -C ilo install + ${MAKE} -C ilo_mp install ${MAKE} -C ipmilan install ${MAKE} -C lpar install ${MAKE} -C manual install @@ -89,6 +91,7 @@ clean: ${MAKE} -C egenera clean # ${MAKE} -C ibmblade clean ${MAKE} -C ilo clean + ${MAKE} -C ilo_mp clean ${MAKE} -C ipmilan clean ${MAKE} -C lpar clean ${MAKE} -C manual clean diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 480150b..343220a 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -327,7 +327,10 @@ def process_input(avail_opt): ## password script to set a correct password ###### def check_input(device_opt, opt): + global all_opt + options = dict(opt) + options["device_opt"] = device_opt if options.has_key("-h"): usage(device_opt) From marx@fedoraproject.org Thu Jul 30 10:07:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 30 Jul 2009 10:07:00 -0000 Subject: cluster: RHEL5 - fencing: #508722 - Fence agent for HP iLO 2 MP (agent included) Message-ID: <20090730100628.492D612035D@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0c68763dfaed3b2ca3d7f5e107eb813b3b38aee3 Commit: 0c68763dfaed3b2ca3d7f5e107eb813b3b38aee3 Parent: d0517e88112d8e04be3dbac15ffba11f823250e0 Author: Marek 'marx' Grac AuthorDate: Thu Jul 30 12:01:50 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Thu Jul 30 12:01:50 2009 +0200 fencing: #508722 - Fence agent for HP iLO 2 MP (agent included) Forgot to add agent itself to previous commit. --- fence/agents/ilo_mp/Makefile | 38 ++++++++++++++++++++++ fence/agents/ilo_mp/fence_ilo_mp.py | 59 +++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 0 deletions(-) diff --git a/fence/agents/ilo_mp/Makefile b/fence/agents/ilo_mp/Makefile new file mode 100644 index 0000000..db03a8a --- /dev/null +++ b/fence/agents/ilo_mp/Makefile @@ -0,0 +1,38 @@ +############################################################################### +############################################################################### +## +## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. +## Copyright (C) 2004 Red Hat, Inc. All rights reserved. +## +## This copyrighted material is made available to anyone wishing to use, +## modify, copy, or redistribute it subject to the terms and conditions +## of the GNU General Public License v.2. +## +############################################################################### +############################################################################### + +SOURCE= fence_ilo_mp.py +TARGET= fence_ilo_mp + +top_srcdir=../.. +include ${top_srcdir}/make/defines.mk + +all: $(TARGET) + +fence_ilo_mp: fence_ilo_mp.py + : > $(TARGET) + awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE) >> $(TARGET) + echo "FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET) + ${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf sh REDHAT_COPYRIGHT >> $(TARGET) + echo "BUILD_DATE=\"(built `date`)\";" >> $(TARGET) + awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(SOURCE) >> $(TARGET) + chmod +x $(TARGET) + +install: all + if [ ! -d ${sbindir} ]; then \ + install -d ${sbindir}; \ + fi + install -m755 ${TARGET} ${sbindir} + +clean: + rm -f $(TARGET) diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py new file mode 100644 index 0000000..7b3dabe --- /dev/null +++ b/fence/agents/ilo_mp/fence_ilo_mp.py @@ -0,0 +1,59 @@ +#!/usr/bin/python + +## +## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. +## +##### + +import sys, re, pexpect, socket +sys.path.append("/usr/lib/fence") +from fencing import * + +#BEGIN_VERSION_GENERATION +FENCE_RELEASE_NAME="" +REDHAT_COPYRIGHT="" +BUILD_DATE="" +#END_VERSION_GENERATION + +def get_power_status(conn, options): + conn.send("show /system1\n") + conn.log_expect(options, "EnabledState=(.*)", POWER_TIMEOUT) + + status = conn.match.group(1) + + if status.startswith("Enabled"): + return "on" + else: + return "off" + +def set_power_status(conn, options): + if options["-o"] == "on": + conn.send("start /system1\n") + else: + conn.send("stop -f /system1\n") + return + +def main(): + device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug", + "action", "ipaddr", "login", "passwd", "passwd_script", + "secure", "cmd_prompt", "ipport", "login_eol_lf" ] + + options = check_input(device_opt, process_input(device_opt)) + + ## + ## Login + #### + + options["-c"] = "MP>" + conn = fence_login(options) + conn.send("SMCLP\n") + + ## + ## Fence operations + #### + fence_action(conn, options, set_power_status, get_power_status) + + conn.send("exit\n") + +if __name__ == "__main__": + main() From marx@fedoraproject.org Thu Jul 30 10:28:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 30 Jul 2009 10:28:00 -0000 Subject: cluster: STABLE3 - [fencing] Fence agent for HP iLO2 MP Message-ID: <20090730102724.A34DE12035D@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=beb2da8139a20d81af6bb1e11a6de66838cf0c90 Commit: beb2da8139a20d81af6bb1e11a6de66838cf0c90 Parent: df5af75eb7d1c2978340ac3bcd1dd4402d7840c2 Author: Marek 'marx' Grac AuthorDate: Thu Jul 30 12:22:44 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Thu Jul 30 12:22:44 2009 +0200 [fencing] Fence agent for HP iLO2 MP New fence agent for HP iLO2 MP used in Blade Servers. It uses SMASH interface over telnet/ssh. fence_ilo uses RIBCL over SSL what is not supported on these machines. --- fence/agents/ilo_mp/Makefile | 5 +++ fence/agents/ilo_mp/fence_ilo_mp.py | 66 +++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 0 deletions(-) diff --git a/fence/agents/ilo_mp/Makefile b/fence/agents/ilo_mp/Makefile new file mode 100644 index 0000000..6405a8f --- /dev/null +++ b/fence/agents/ilo_mp/Makefile @@ -0,0 +1,5 @@ +include ../../../make/defines.mk + +TARGET= fence_ilo_mp + +include $(OBJDIR)/make/fencebuild.mk diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py new file mode 100644 index 0000000..511ff4b --- /dev/null +++ b/fence/agents/ilo_mp/fence_ilo_mp.py @@ -0,0 +1,66 @@ +#!/usr/bin/python + +## +## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. +## +##### + +import sys, re, pexpect, socket +sys.path.append("@FENCEAGENTSLIBDIR@") +from fencing import * + +#BEGIN_VERSION_GENERATION +FENCE_RELEASE_NAME="" +REDHAT_COPYRIGHT="" +BUILD_DATE="" +#END_VERSION_GENERATION + +def get_power_status(conn, options): + conn.send("show /system1\n") + conn.log_expect(options, "EnabledState=(.*)", POWER_TIMEOUT) + + status = conn.match.group(1) + + if status.startswith("Enabled"): + return "on" + else: + return "off" + +def set_power_status(conn, options): + if options["-o"] == "on": + conn.send("start /system1\n") + else: + conn.send("stop -f /system1\n") + return + +def main(): + device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug", + "action", "ipaddr", "login", "passwd", "passwd_script", + "secure", "cmd_prompt", "ipport", "login_eol_lf", + "separator", "inet4_only", "inet6_only" ] + + atexit.register(atexit_handler) + + options = check_input(device_opt, process_input(device_opt)) + if 0 == options.has_key("-c"): + options["-c"] = "MP>" + + show_docs(options) + + conn = fence_login(options) + conn.send("SMCLP\n") + + ## + ## Fence operations + #### + fence_action(conn, options, set_power_status, get_power_status) + + try: + conn.send("exit\n") + except exceptions.OSError: + pass + except pexpect.ExceptionPexpect: + pass + +if __name__ == "__main__": + main() From marx@fedoraproject.org Thu Jul 30 10:42:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 30 Jul 2009 10:42:00 -0000 Subject: cluster: STABLE2 - fencing: #508722 - Fence agent for HP iLO 2 MP Message-ID: <20090730104210.DC27612035D@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=ff488f4c8dcac3e5c09a6eae77e1c083663a18f8 Commit: ff488f4c8dcac3e5c09a6eae77e1c083663a18f8 Parent: 790e78730c64db0335eb753e7c13c3a83d8264e2 Author: Marek 'marx' Grac AuthorDate: Thu Jul 30 12:36:15 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Thu Jul 30 12:36:15 2009 +0200 fencing: #508722 - Fence agent for HP iLO 2 MP New fence agent for HP iLO2 MP used in Blade Servers. It uses SMASH interface over telnet/ssh. fence_ilo uses RIBCL over SSL what is not supported on these machines. --- fence/agents/ilo_mp/Makefile | 5 +++ fence/agents/ilo_mp/fence_ilo_mp.py | 59 +++++++++++++++++++++++++++++++++++ fence/agents/lib/fencing.py.py | 3 ++ 3 files changed, 67 insertions(+), 0 deletions(-) diff --git a/fence/agents/ilo_mp/Makefile b/fence/agents/ilo_mp/Makefile new file mode 100644 index 0000000..6405a8f --- /dev/null +++ b/fence/agents/ilo_mp/Makefile @@ -0,0 +1,5 @@ +include ../../../make/defines.mk + +TARGET= fence_ilo_mp + +include $(OBJDIR)/make/fencebuild.mk diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py new file mode 100644 index 0000000..7b3dabe --- /dev/null +++ b/fence/agents/ilo_mp/fence_ilo_mp.py @@ -0,0 +1,59 @@ +#!/usr/bin/python + +## +## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. +## +##### + +import sys, re, pexpect, socket +sys.path.append("/usr/lib/fence") +from fencing import * + +#BEGIN_VERSION_GENERATION +FENCE_RELEASE_NAME="" +REDHAT_COPYRIGHT="" +BUILD_DATE="" +#END_VERSION_GENERATION + +def get_power_status(conn, options): + conn.send("show /system1\n") + conn.log_expect(options, "EnabledState=(.*)", POWER_TIMEOUT) + + status = conn.match.group(1) + + if status.startswith("Enabled"): + return "on" + else: + return "off" + +def set_power_status(conn, options): + if options["-o"] == "on": + conn.send("start /system1\n") + else: + conn.send("stop -f /system1\n") + return + +def main(): + device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug", + "action", "ipaddr", "login", "passwd", "passwd_script", + "secure", "cmd_prompt", "ipport", "login_eol_lf" ] + + options = check_input(device_opt, process_input(device_opt)) + + ## + ## Login + #### + + options["-c"] = "MP>" + conn = fence_login(options) + conn.send("SMCLP\n") + + ## + ## Fence operations + #### + fence_action(conn, options, set_power_status, get_power_status) + + conn.send("exit\n") + +if __name__ == "__main__": + main() diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 57bc246..bfa358f 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -321,7 +321,10 @@ def process_input(avail_opt): ## password script to set a correct password ###### def check_input(device_opt, opt): + global all_opt + options = dict(opt) + options["device_opt"] = device_opt if options.has_key("-h"): usage(device_opt) From marx@fedoraproject.org Thu Jul 30 11:12:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Thu, 30 Jul 2009 11:12:00 -0000 Subject: fence-agents: master - fencing: #508722 - Fence agent for HP iLO 2 MP Message-ID: <20090730111147.C59F31201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=7ba70e33140d9346d98f78a93dc97c37e065bf8f Commit: 7ba70e33140d9346d98f78a93dc97c37e065bf8f Parent: 4fa914ea8252924d607c663f113a11e4dc362aa3 Author: Marek 'marx' Grac AuthorDate: Thu Jul 30 13:07:00 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Thu Jul 30 13:07:00 2009 +0200 fencing: #508722 - Fence agent for HP iLO 2 MP New fence agent for HP iLO2 MP used in Blade Servers. It uses SMASH interface over telnet/ssh. fence_ilo uses RIBCL over SSL what is not supported on these machines. --- fence/agents/Makefile.am | 1 + fence/agents/ilo_mp/Makefile.am | 12 ++++++ fence/agents/ilo_mp/fence_ilo_mp.py | 66 +++++++++++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 0 deletions(-) diff --git a/fence/agents/Makefile.am b/fence/agents/Makefile.am index 453993f..aea77ac 100644 --- a/fence/agents/Makefile.am +++ b/fence/agents/Makefile.am @@ -15,6 +15,7 @@ SUBDIRS = alom \ ibmblade \ ifmib \ ilo \ + ilo_mp \ intelmodular \ ipmilan \ ldom \ diff --git a/fence/agents/ilo_mp/Makefile.am b/fence/agents/ilo_mp/Makefile.am new file mode 100644 index 0000000..c961ba3 --- /dev/null +++ b/fence/agents/ilo_mp/Makefile.am @@ -0,0 +1,12 @@ +MAINTAINERCLEANFILES = Makefile.in + +TARGET = fence_ilo_mp + +EXTRA_DIST = $(TARGET).py + +sbin_SCRIPTS = $(TARGET) + +include $(top_srcdir)/make/fencebuild.mk + +clean-local: + rm -f $(TARGET) diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py new file mode 100644 index 0000000..511ff4b --- /dev/null +++ b/fence/agents/ilo_mp/fence_ilo_mp.py @@ -0,0 +1,66 @@ +#!/usr/bin/python + +## +## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. +## +##### + +import sys, re, pexpect, socket +sys.path.append("@FENCEAGENTSLIBDIR@") +from fencing import * + +#BEGIN_VERSION_GENERATION +FENCE_RELEASE_NAME="" +REDHAT_COPYRIGHT="" +BUILD_DATE="" +#END_VERSION_GENERATION + +def get_power_status(conn, options): + conn.send("show /system1\n") + conn.log_expect(options, "EnabledState=(.*)", POWER_TIMEOUT) + + status = conn.match.group(1) + + if status.startswith("Enabled"): + return "on" + else: + return "off" + +def set_power_status(conn, options): + if options["-o"] == "on": + conn.send("start /system1\n") + else: + conn.send("stop -f /system1\n") + return + +def main(): + device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug", + "action", "ipaddr", "login", "passwd", "passwd_script", + "secure", "cmd_prompt", "ipport", "login_eol_lf", + "separator", "inet4_only", "inet6_only" ] + + atexit.register(atexit_handler) + + options = check_input(device_opt, process_input(device_opt)) + if 0 == options.has_key("-c"): + options["-c"] = "MP>" + + show_docs(options) + + conn = fence_login(options) + conn.send("SMCLP\n") + + ## + ## Fence operations + #### + fence_action(conn, options, set_power_status, get_power_status) + + try: + conn.send("exit\n") + except exceptions.OSError: + pass + except pexpect.ExceptionPexpect: + pass + +if __name__ == "__main__": + main() From chrissie@fedoraproject.org Thu Jul 30 11:46:00 2009 From: chrissie@fedoraproject.org (Christine Caulfield) Date: Thu, 30 Jul 2009 11:46:00 -0000 Subject: cluster: STABLE3 - cman: Enable error reporting from config modules Message-ID: <20090730114554.C83A61201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9e528cda909d18026aae484958e07303d7cdf0d9 Commit: 9e528cda909d18026aae484958e07303d7cdf0d9 Parent: beb2da8139a20d81af6bb1e11a6de66838cf0c90 Author: Christine Caulfield AuthorDate: Thu Jul 30 12:39:06 2009 +0100 Committer: Christine Caulfield CommitterDate: Thu Jul 30 12:39:06 2009 +0100 cman: Enable error reporting from config modules The closure of stderr has been moved from cman_tool into cman-preconfig, this means that any errors reported to stderr by (eg) libXML will appear on the console when cman starts up. Signed-off-by: Christine Caulfield --- cman/cman_tool/join.c | 17 ++++++----------- cman/daemon/cman-preconfig.c | 6 ++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/cman/cman_tool/join.c b/cman/cman_tool/join.c index 2a0e017..78c400e 100644 --- a/cman/cman_tool/join.c +++ b/cman/cman_tool/join.c @@ -10,7 +10,7 @@ static char *argv[MAX_ARGS]; static char *envp[MAX_ARGS]; -static void be_daemon(int close_stderr) +static void be_daemon(void) { int devnull = open("/dev/null", O_RDWR); if (devnull == -1) { @@ -27,15 +27,10 @@ static void be_daemon(int close_stderr) die("Error setting terminal FDs to /dev/null: %m"); } - if (close_stderr) { - if (close(2)) { - die("Error closing stderr FD"); - } - if (!dup2(devnull, 2) < 0) { - die("Error setting stderr FD to /dev/null: %m"); - } - } - + /* We leave stderr open to allow error messags through. + the cman plugin will close it when it's all started + up properly. + */ setsid(); } @@ -226,7 +221,7 @@ int join(commandline_t *comline, char *main_envp[]) fprintf(stderr, "%s\n", envp[i]); } } - be_daemon(!(comline->verbose & ~DEBUG_STARTUP_ONLY)); + be_daemon(); sprintf(scratch, "FORKED: %d\n", getpid()); err = write(p[1], scratch, strlen(scratch)); diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c index 8c490df..4cdd00d 100644 --- a/cman/daemon/cman-preconfig.c +++ b/cman/daemon/cman-preconfig.c @@ -1232,6 +1232,12 @@ static int cmanpre_readconfig(struct objdb_iface_ver0 *objdb, const char **error } *error_string = error_reason; + + /* Close stderr, because cman_tool tells corosync not to. + This helps pass error messages back to the command-line + */ + if (!debug) + close(STDERR_FILENO); return ret; } From fabbione@fedoraproject.org Thu Jul 30 12:06:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 30 Jul 2009 12:06:00 -0000 Subject: cluster: STABLE3 - fence agents: drop unrequired and wrong copyright statement Message-ID: <20090730120536.80FF21201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=63ca248ef3b79c93f33c83b7a1894c6da776fec2 Commit: 63ca248ef3b79c93f33c83b7a1894c6da776fec2 Parent: 9e528cda909d18026aae484958e07303d7cdf0d9 Author: Fabio M. Di Nitto AuthorDate: Thu Jul 30 14:04:59 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 30 14:04:59 2009 +0200 fence agents: drop unrequired and wrong copyright statement Signed-off-by: Fabio M. Di Nitto --- fence/agents/ilo_mp/fence_ilo_mp.py | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py index 511ff4b..baaf076 100644 --- a/fence/agents/ilo_mp/fence_ilo_mp.py +++ b/fence/agents/ilo_mp/fence_ilo_mp.py @@ -1,10 +1,5 @@ #!/usr/bin/python -## -## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. -## -##### - import sys, re, pexpect, socket sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * From fabbione@fedoraproject.org Thu Jul 30 12:07:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 30 Jul 2009 12:07:00 -0000 Subject: cluster: STABLE2 - fence agents: drop unrequired and wrong copyright statement Message-ID: <20090730120705.E24231201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=64783adc61537af71f000c763e512a9a5293970b Commit: 64783adc61537af71f000c763e512a9a5293970b Parent: ff488f4c8dcac3e5c09a6eae77e1c083663a18f8 Author: Fabio M. Di Nitto AuthorDate: Thu Jul 30 14:04:59 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 30 14:06:50 2009 +0200 fence agents: drop unrequired and wrong copyright statement Signed-off-by: Fabio M. Di Nitto --- fence/agents/ilo_mp/fence_ilo_mp.py | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py index 7b3dabe..da90cd2 100644 --- a/fence/agents/ilo_mp/fence_ilo_mp.py +++ b/fence/agents/ilo_mp/fence_ilo_mp.py @@ -1,10 +1,5 @@ #!/usr/bin/python -## -## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. -## -##### - import sys, re, pexpect, socket sys.path.append("/usr/lib/fence") from fencing import * From fabbione@fedoraproject.org Thu Jul 30 12:09:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 30 Jul 2009 12:09:00 -0000 Subject: fence-agents: master - build: fix fence_ilo_mp and add files to EXTRA_DIST Message-ID: <20090730120903.91E651201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=d07c924e6c5637f0731e76d7d5fcf84288854b24 Commit: d07c924e6c5637f0731e76d7d5fcf84288854b24 Parent: 2282982bc4f0f853952ed6ea86c0adefb7c900ba Author: Fabio M. Di Nitto AuthorDate: Thu Jul 30 14:08:26 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 30 14:08:26 2009 +0200 build: fix fence_ilo_mp and add files to EXTRA_DIST Signed-off-by: Fabio M. Di Nitto --- configure.ac | 1 + fence/agents/lib/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/configure.ac b/configure.ac index d143056..da47c76 100644 --- a/configure.ac +++ b/configure.ac @@ -253,6 +253,7 @@ AC_CONFIG_FILES([Makefile fence/agents/ibmblade/Makefile fence/agents/ifmib/Makefile fence/agents/ilo/Makefile + fence/agents/ilo_mp/Makefile fence/agents/intelmodular/Makefile fence/agents/ipmilan/Makefile fence/agents/ldom/Makefile diff --git a/fence/agents/lib/Makefile.am b/fence/agents/lib/Makefile.am index 35170e8..7bf9e8f 100644 --- a/fence/agents/lib/Makefile.am +++ b/fence/agents/lib/Makefile.am @@ -2,7 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in TARGET = fencing.py fencing_snmp.py -EXTRA_DIST = fencing.py.py fencing_snmp.py.py +EXTRA_DIST = fencing.py.py fencing_snmp.py.py ra2man.xsl fencelibdir = ${FENCEAGENTSLIBDIR} From fabbione@fedoraproject.org Thu Jul 30 12:09:00 2009 From: fabbione@fedoraproject.org (Fabio M. Di Nitto) Date: Thu, 30 Jul 2009 12:09:00 -0000 Subject: fence-agents: master - fence agents: drop unrequired and wrong copyright statement Message-ID: <20090730120901.1C06C1201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=2282982bc4f0f853952ed6ea86c0adefb7c900ba Commit: 2282982bc4f0f853952ed6ea86c0adefb7c900ba Parent: 7ba70e33140d9346d98f78a93dc97c37e065bf8f Author: Fabio M. Di Nitto AuthorDate: Thu Jul 30 14:04:59 2009 +0200 Committer: Fabio M. Di Nitto CommitterDate: Thu Jul 30 14:07:28 2009 +0200 fence agents: drop unrequired and wrong copyright statement Signed-off-by: Fabio M. Di Nitto --- fence/agents/ilo_mp/fence_ilo_mp.py | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/fence/agents/ilo_mp/fence_ilo_mp.py b/fence/agents/ilo_mp/fence_ilo_mp.py index 511ff4b..baaf076 100644 --- a/fence/agents/ilo_mp/fence_ilo_mp.py +++ b/fence/agents/ilo_mp/fence_ilo_mp.py @@ -1,10 +1,5 @@ #!/usr/bin/python -## -## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. -## -##### - import sys, re, pexpect, socket sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * From rpeterso@fedoraproject.org Thu Jul 30 19:00:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Thu, 30 Jul 2009 19:00:00 -0000 Subject: gfs2-utils: master - "fsck.gfs2: invalid option -- a" on boot when mounting gfs2 root Message-ID: <20090730185935.8041A1201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=efd003c0a4c772424b553d90c8afaa964ee13d6e Commit: efd003c0a4c772424b553d90c8afaa964ee13d6e Parent: ddcef5918351da50754670cb524e41f163077578 Author: Bob Peterson AuthorDate: Thu Jul 30 13:58:25 2009 -0500 Committer: Bob Peterson CommitterDate: Thu Jul 30 14:01:41 2009 -0500 "fsck.gfs2: invalid option -- a" on boot when mounting gfs2 root bz 507596 This patch adds three new parameters to fsck.gfs2: -a Same as -p (repair file system if dirty) -p Preen (Check file system and repair if it is dirty and if it's safe) -f force check, even if the file system seems clean --- gfs2/fsck/fs_recovery.c | 101 +++++++++++++++++++++++++++++++++++++++++----- gfs2/fsck/fs_recovery.h | 4 +- gfs2/fsck/fsck.h | 4 +- gfs2/fsck/initialize.c | 50 +++++++++++++---------- gfs2/fsck/main.c | 27 +++++++++++-- gfs2/man/fsck.gfs2.8 | 31 ++++++++++++++- 6 files changed, 177 insertions(+), 40 deletions(-) diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c index d0ca88f..c05b780 100644 --- a/gfs2/fsck/fs_recovery.c +++ b/gfs2/fsck/fs_recovery.c @@ -374,8 +374,34 @@ static int fix_journal_seq_no(struct gfs2_inode *ip) } /** + * preen_is_safe - Can we safely preen the file system? + * + * If a preen option was specified (-a or -p) we're likely to have been + * called from rc.sysinit. We need to determine whether this is shared + * storage or not. If it's local storage (locking protocol==lock_nolock) + * it's safe to preen the file system. If it's lock_dlm, it's likely + * mounted by other nodes in the cluster, which is dangerous and therefore, + * we should warn the user to run fsck.gfs2 manually when it's safe. + */ +int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check) +{ + if (!preen) /* If preen was not specified */ + return 1; /* not called by rc.sysinit--we're okay to preen */ + if (force_check) /* If check was forced by the user? */ + return 1; /* user's responsibility--we're okay to preen */ + if(!memcmp(sdp->sd_sb.sb_lockproto + 5, "nolock", 6)) + return 1; /* local file system--preen is okay */ + return 0; /* might be mounted on another node--not guaranteed safe */ +} + +/** * gfs2_recover_journal - recovery a given journal * @ip: the journal incore inode + * j: which journal to check + * preen: Was preen (-a or -p) specified? + * force_check: Was -f specified to force the check? + * @was_clean: if the journal was originally clean, this is set to 1. + * if the journal was dirty from the start, this is set to 0. * * Acquire the journal's lock, check to see if the journal is clean, and * do recovery if necessary. @@ -383,18 +409,37 @@ static int fix_journal_seq_no(struct gfs2_inode *ip) * Returns: errno */ -static int gfs2_recover_journal(struct gfs2_inode *ip, int j) +static int gfs2_recover_journal(struct gfs2_inode *ip, int j, int preen, + int force_check, int *was_clean) { struct gfs2_sbd *sdp = ip->i_sbd; struct gfs2_log_header head; unsigned int pass; int error; + *was_clean = 0; log_info( _("jid=%u: Looking at journal...\n"), j); osi_list_init(&sd_revoke_list); error = gfs2_find_jhead(ip, &head); if (error) { + if (opts.no) { + log_err( _("Journal #%d (\"journal%d\") is corrupt.\n" + "Not fixing it due to the -n option.\n"), + j+1, j); + goto out; + } + if (!preen_is_safe(sdp, preen, force_check)) { + log_err(_("Journal #%d (\"journal%d\") is corrupt.\n"), + j+1, j); + log_err(_("I'm not fixing it because it may be unsafe:\n" + "Locking protocol is not lock_nolock and " + "the -a or -p option was specified.\n")); + log_err(_("Please make sure no node has the file system " + "mounted then rerun fsck.gfs2 manually " + "without -a or -p.\n")); + goto out; + } if (!query(&opts, _("\nJournal #%d (\"journal%d\") is " "corrupt. Okay to repair it? (y/n)"), j+1, j)) { @@ -420,10 +465,28 @@ static int gfs2_recover_journal(struct gfs2_inode *ip, int j) } if (head.lh_flags & GFS2_LOG_HEAD_UNMOUNT) { log_info( _("jid=%u: Journal is clean.\n"), j); + *was_clean = 1; return 0; } - if (query(&opts, _("\nJournal #%d (\"journal%d\") is dirty. Okay to replay it? (y/n)"), - j+1, j)) { + if (opts.no) { + log_err(_("Journal #%d (\"journal%d\") is dirty; not replaying" + " due to the -n option.\n"), + j+1, j); + goto out; + } + if (!preen_is_safe(sdp, preen, force_check)) { + log_err( _("Journal #%d (\"journal%d\") is dirty.\n"), j+1, j); + log_err( _("I'm not replaying it because it may be unsafe:\n" + "Locking protocol is not lock_nolock and " + "the -a or -p option was specified.\n")); + log_err( _("Please make sure no node has the file system " + "mounted then rerun fsck.gfs2 manually " + "without -a or -p.\n")); + error = FSCK_ERROR; + goto out; + } + if (query(&opts, _("\nJournal #%d (\"journal%d\") is dirty. Okay to " + "replay it? (y/n)"), j+1, j)) { log_info( _("jid=%u: Replaying journal...\n"), j); sd_found_jblocks = sd_replayed_jblocks = 0; @@ -457,13 +520,16 @@ static int gfs2_recover_journal(struct gfs2_inode *ip, int j) } out: - log_info( _("jid=%u: %s\n"), j, (error) ? "Failed" : "Done"); + log_info( _("jid=%u: %s\n"), j, (error) ? _("Failed") : _("Done")); return error; } /* * replay_journals - replay the journals * sdp: the super block + * preen: Was preen (-a or -p) specified? + * force_check: Was -f specified to force the check? + * @clean_journals - set to the number of clean journals we find * * There should be a flag to the fsck to enable/disable this * feature. The fsck falls back to clearing the journal if an @@ -471,10 +537,13 @@ out: * * Returns: 0 on success, -1 on failure */ -int replay_journals(struct gfs2_sbd *sdp){ +int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check, + int *clean_journals) +{ int i; + int clean = 0, dirty_journals = 0, error = 0, gave_msg = 0; - log_notice( _("Recovering journals (this may take a while)")); + *clean_journals = 0; /* Get master dinode */ sdp->master_dir = gfs2_load_inode(sdp, @@ -488,17 +557,27 @@ int replay_journals(struct gfs2_sbd *sdp){ } for(i = 0; i < sdp->md.journals; i++) { - if((i % 2) == 0) - log_at_notice("."); - gfs2_recover_journal(sdp->md.journal[i], i); + if (!error) { + error = gfs2_recover_journal(sdp->md.journal[i], i, + preen, force_check, + &clean); + if (!clean) + dirty_journals++; + if (!gave_msg && dirty_journals == 1 && !opts.no && + preen_is_safe(sdp, preen, force_check)) { + gave_msg = 1; + log_notice( _("Recovering journals (this may " + "take a while)\n")); + } + *clean_journals += clean; + } inode_put(sdp->md.journal[i], (opts.no ? not_updated : updated)); } - log_notice( _("\nJournal recovery complete.\n")); inode_put(sdp->master_dir, not_updated); inode_put(sdp->md.jiinode, not_updated); /* Sync the buffers to disk so we get a fresh start. */ bsync(&sdp->buf_list); bsync(&sdp->nvbuf_list); - return 0; + return error; } diff --git a/gfs2/fsck/fs_recovery.h b/gfs2/fsck/fs_recovery.h index 484ea67..a61884d 100644 --- a/gfs2/fsck/fs_recovery.h +++ b/gfs2/fsck/fs_recovery.h @@ -3,7 +3,9 @@ #include "libgfs2.h" -int replay_journals(struct gfs2_sbd *sdp); +int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check, + int *clean_journals); +int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check); #endif /* __FS_RECOVERY_H__ */ diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h index ac04593..1b479e9 100644 --- a/gfs2/fsck/fsck.h +++ b/gfs2/fsck/fsck.h @@ -65,9 +65,9 @@ struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh); void fsck_inode_put(struct gfs2_inode *ip, enum update_flags update); -int initialize(struct gfs2_sbd *sbp); +int initialize(struct gfs2_sbd *sbp, int force_check, int preen, + int *all_clean); void destroy(struct gfs2_sbd *sbp); -int block_mounters(struct gfs2_sbd *sbp, int block_em); int pass1(struct gfs2_sbd *sbp); int pass1b(struct gfs2_sbd *sbp); int pass1c(struct gfs2_sbd *sbp); diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c index 3012ce8..8bf5782 100644 --- a/gfs2/fsck/initialize.c +++ b/gfs2/fsck/initialize.c @@ -10,6 +10,8 @@ #include #include #include +#include + #define _(String) gettext(String) #include "libgfs2.h" @@ -24,20 +26,6 @@ } /** - * init_journals - * - * Go through journals and replay them - then clear them - */ -static int init_journals(struct gfs2_sbd *sbp) -{ - if(!opts.no) { - if(replay_journals(sbp)) - return 1; - } - return 0; -} - -/** * block_mounters * * Change the lock protocol so nobody can mount the fs @@ -111,7 +99,8 @@ static void empty_super_block(struct gfs2_sbd *sdp) } } - gfs2_block_list_destroy(sdp, bl); + if (bl) + gfs2_block_list_destroy(sdp, bl); } @@ -334,8 +323,13 @@ static int fill_super_block(struct gfs2_sbd *sdp) * initialize - initialize superblock pointer * */ -int initialize(struct gfs2_sbd *sbp) +int initialize(struct gfs2_sbd *sbp, int force_check, int preen, + int *all_clean) { + int clean_journals = 0; + + *all_clean = 0; + if(opts.no) { if ((sbp->device_fd = open(opts.device, O_RDONLY)) < 0) { log_crit( _("Unable to open device: %s\n"), opts.device); @@ -343,8 +337,13 @@ int initialize(struct gfs2_sbd *sbp) } } else { /* read in sb from disk */ - if ((sbp->device_fd = open(opts.device, O_RDWR)) < 0){ - log_crit( _("Unable to open device: %s\n"), opts.device); + if ((sbp->device_fd = open(opts.device, O_RDWR | O_EXCL)) < 0){ + if (errno == EBUSY) + log_crit( _("Device %s is busy.\n"), + opts.device); + else + log_crit( _("Unable to open device: %s\n"), + opts.device); return FSCK_USAGE; } } @@ -354,7 +353,7 @@ int initialize(struct gfs2_sbd *sbp) } /* Change lock protocol to be fsck_* instead of lock_* */ - if(!opts.no) { + if(!opts.no && preen_is_safe(sbp, preen, force_check)) { if(block_mounters(sbp, 1)) { log_err( _("Unable to block other mounters\n")); return FSCK_USAGE; @@ -363,12 +362,21 @@ int initialize(struct gfs2_sbd *sbp) /* verify various things */ - if(init_journals(sbp)) { - if(!opts.no) + if(replay_journals(sbp, preen, force_check, &clean_journals)) { + if(!opts.no && preen_is_safe(sbp, preen, force_check)) block_mounters(sbp, 0); stack; return FSCK_ERROR; } + if (sbp->md.journals == clean_journals) + *all_clean = 1; + else { + if (force_check || !preen) + log_notice( _("\nJournal recovery complete.\n")); + } + + if (!force_check && *all_clean && preen) + return FSCK_OK; if (init_system_inodes(sbp)) return FSCK_ERROR; diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c index ee73035..c4778ad 100644 --- a/gfs2/fsck/main.c +++ b/gfs2/fsck/main.c @@ -22,13 +22,14 @@ struct gfs2_options opts = {0}; struct gfs2_inode *lf_dip; /* Lost and found directory inode */ osi_list_t dir_hash[FSCK_HASH_SIZE]; osi_list_t inode_hash[FSCK_HASH_SIZE]; -struct gfs2_block_list *bl; +struct gfs2_block_list *bl = NULL; uint64_t last_fs_block, last_reported_block = -1; int skip_this_pass = FALSE, fsck_abort = FALSE; int errors_found = 0, errors_corrected = 0; const char *pass = ""; uint64_t last_data_block; uint64_t first_data_block; +int preen = 0, force_check = 0; /* This function is for libgfs2's sake. */ void print_it(const char *label, const char *fmt, const char *fmt2, ...) @@ -43,7 +44,7 @@ void print_it(const char *label, const char *fmt, const char *fmt2, ...) static void usage(char *name) { - printf( _("Usage: %s [-hnqvVy] \n"), basename(name)); + printf("Usage: %s [-afhnpqvVy] \n", basename(name)); } static void version(void) @@ -57,9 +58,16 @@ static int read_cmdline(int argc, char **argv, struct gfs2_options *gopts) { int c; - while((c = getopt(argc, argv, "hnqvyV")) != -1) { + while((c = getopt(argc, argv, "afhnpqvyV")) != -1) { switch(c) { + case 'a': + preen = 1; + gopts->yes = 1; + break; + case 'f': + force_check = 1; + break; case 'h': usage(argv[0]); exit(FSCK_OK); @@ -67,6 +75,10 @@ static int read_cmdline(int argc, char **argv, struct gfs2_options *gopts) case 'n': gopts->no = 1; break; + case 'p': + preen = 1; + gopts->yes = 1; + break; case 'q': decrease_verbosity(); break; @@ -256,6 +268,7 @@ int main(int argc, char **argv) int j; enum update_flags update_sys_files; int error = 0; + int all_clean = 0; setlocale(LC_ALL, ""); textdomain("gfs2-utils"); @@ -266,9 +279,15 @@ int main(int argc, char **argv) exit(error); setbuf(stdout, NULL); log_notice( _("Initializing fsck\n")); - if ((error = initialize(sbp))) + if ((error = initialize(sbp, force_check, preen, &all_clean))) exit(error); + if (!force_check && all_clean && preen) { + log_err( _("%s: clean.\n"), opts.device); + destroy(sbp); + exit(FSCK_OK); + } + signal(SIGINT, interrupt); log_notice( _("Starting pass1\n")); pass = "pass 1"; diff --git a/gfs2/man/fsck.gfs2.8 b/gfs2/man/fsck.gfs2.8 index 7c8fd99..462e918 100644 --- a/gfs2/man/fsck.gfs2.8 +++ b/gfs2/man/fsck.gfs2.8 @@ -19,15 +19,29 @@ fsck.gfs2 can do. If important file system structures are destroyed, such that the checker cannot determine what the repairs should be, reparations could fail. -GFS2 is a journaled file system, and as such should be able to repair damages to +GFS2 is a journaled file system, and as such should be able to repair damage to the file system on its own. However, faulty hardware has the ability to write incomplete blocks to a file system thereby causing corruption that GFS2 cannot fix. The first step to ensuring a healthy file system is the selection of reliable hardware (i.e. storage systems that will write complete blocks - even in the event of power failure). +Note: Most file system checkers will not check the file system if it is +"clean" (i.e. unmounted since the last use). The fsck.gfs program behaves +differently because the storage may be shared among several nodes in a +cluster, and therefore problems may have been introduced on a different +computer. Therefore, fsck.gfs2 will always check the file system unless +the -p (preen) option is used, in which case it follows special rules +(see below). + .SH OPTIONS .TP +\fB-a\fP +Same as the -p (preen) option. +.TP +\fB-f\fP +Force checking even if the file system seems clean. +.TP \fB-h\fP Help. @@ -42,6 +56,21 @@ No to all questions. By specifying this option, fsck.gfs2 will only show the changes that would be made, but not make any changes to the filesystem. .TP +\fB-p\fP +Preen (same as -a: automatically repair the file system if it is dirty, +and safe to do so, otherwise exit.) + +Note: If the file system has locking protocol lock_nolock, the file system +is considered a non-shared storage device and the fsck is deemed safe. +However, fsck.gfs2 does not know whether it was called automatically +from the init process, due to options in the /etc/fstab file. Therefore, if +the locking protocol is lock_dlm and -a or -p was specified, fsck.gfs2 +cannot determine whether the disk is mounted by other nodes in the cluster. +Therefore, the fsck is deemed to be unsafe and a warning is given +if any damage or dirty journals are found. In that case, the file system +should be unmounted from all nodes in the cluster and fsck.gfs2 should be +run manually without the -a or -p options. +.TP \fB-V\fP Version. From rpeterso@fedoraproject.org Thu Jul 30 19:01:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Thu, 30 Jul 2009 19:01:00 -0000 Subject: cluster: STABLE3 - "fsck.gfs2: invalid option -- a" on boot when mounting gfs2 root Message-ID: <20090730190056.16E861201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4011cf6737f4155f8e4f277c10ce4fb568024a9c Commit: 4011cf6737f4155f8e4f277c10ce4fb568024a9c Parent: 63ca248ef3b79c93f33c83b7a1894c6da776fec2 Author: Bob Peterson AuthorDate: Thu Jul 30 13:58:25 2009 -0500 Committer: Bob Peterson CommitterDate: Thu Jul 30 13:58:25 2009 -0500 "fsck.gfs2: invalid option -- a" on boot when mounting gfs2 root bz 507596 This patch adds three new parameters to fsck.gfs2: -a Same as -p (repair file system if dirty) -p Preen (Check file system and repair if it is dirty and if it's safe) -f force check, even if the file system seems clean --- gfs2/fsck/fs_recovery.c | 101 +++++++++++++++++++++++++++++++++++++++++----- gfs2/fsck/fs_recovery.h | 4 +- gfs2/fsck/fsck.h | 4 +- gfs2/fsck/initialize.c | 50 +++++++++++++---------- gfs2/fsck/main.c | 27 +++++++++++-- gfs2/man/fsck.gfs2.8 | 31 ++++++++++++++- 6 files changed, 177 insertions(+), 40 deletions(-) diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c index cbae916..16480be 100644 --- a/gfs2/fsck/fs_recovery.c +++ b/gfs2/fsck/fs_recovery.c @@ -372,8 +372,34 @@ static int fix_journal_seq_no(struct gfs2_inode *ip) } /** + * preen_is_safe - Can we safely preen the file system? + * + * If a preen option was specified (-a or -p) we're likely to have been + * called from rc.sysinit. We need to determine whether this is shared + * storage or not. If it's local storage (locking protocol==lock_nolock) + * it's safe to preen the file system. If it's lock_dlm, it's likely + * mounted by other nodes in the cluster, which is dangerous and therefore, + * we should warn the user to run fsck.gfs2 manually when it's safe. + */ +int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check) +{ + if (!preen) /* If preen was not specified */ + return 1; /* not called by rc.sysinit--we're okay to preen */ + if (force_check) /* If check was forced by the user? */ + return 1; /* user's responsibility--we're okay to preen */ + if(!memcmp(sdp->sd_sb.sb_lockproto + 5, "nolock", 6)) + return 1; /* local file system--preen is okay */ + return 0; /* might be mounted on another node--not guaranteed safe */ +} + +/** * gfs2_recover_journal - recovery a given journal * @ip: the journal incore inode + * j: which journal to check + * preen: Was preen (-a or -p) specified? + * force_check: Was -f specified to force the check? + * @was_clean: if the journal was originally clean, this is set to 1. + * if the journal was dirty from the start, this is set to 0. * * Acquire the journal's lock, check to see if the journal is clean, and * do recovery if necessary. @@ -381,18 +407,37 @@ static int fix_journal_seq_no(struct gfs2_inode *ip) * Returns: errno */ -static int gfs2_recover_journal(struct gfs2_inode *ip, int j) +static int gfs2_recover_journal(struct gfs2_inode *ip, int j, int preen, + int force_check, int *was_clean) { struct gfs2_sbd *sdp = ip->i_sbd; struct gfs2_log_header head; unsigned int pass; int error; + *was_clean = 0; log_info( _("jid=%u: Looking at journal...\n"), j); osi_list_init(&sd_revoke_list); error = gfs2_find_jhead(ip, &head); if (error) { + if (opts.no) { + log_err( _("Journal #%d (\"journal%d\") is corrupt.\n" + "Not fixing it due to the -n option.\n"), + j+1, j); + goto out; + } + if (!preen_is_safe(sdp, preen, force_check)) { + log_err(_("Journal #%d (\"journal%d\") is corrupt.\n"), + j+1, j); + log_err(_("I'm not fixing it because it may be unsafe:\n" + "Locking protocol is not lock_nolock and " + "the -a or -p option was specified.\n")); + log_err(_("Please make sure no node has the file system " + "mounted then rerun fsck.gfs2 manually " + "without -a or -p.\n")); + goto out; + } if (!query(&opts, _("\nJournal #%d (\"journal%d\") is " "corrupt. Okay to repair it? (y/n)"), j+1, j)) { @@ -418,10 +463,28 @@ static int gfs2_recover_journal(struct gfs2_inode *ip, int j) } if (head.lh_flags & GFS2_LOG_HEAD_UNMOUNT) { log_info( _("jid=%u: Journal is clean.\n"), j); + *was_clean = 1; return 0; } - if (query(&opts, _("\nJournal #%d (\"journal%d\") is dirty. Okay to replay it? (y/n)"), - j+1, j)) { + if (opts.no) { + log_err(_("Journal #%d (\"journal%d\") is dirty; not replaying" + " due to the -n option.\n"), + j+1, j); + goto out; + } + if (!preen_is_safe(sdp, preen, force_check)) { + log_err( _("Journal #%d (\"journal%d\") is dirty.\n"), j+1, j); + log_err( _("I'm not replaying it because it may be unsafe:\n" + "Locking protocol is not lock_nolock and " + "the -a or -p option was specified.\n")); + log_err( _("Please make sure no node has the file system " + "mounted then rerun fsck.gfs2 manually " + "without -a or -p.\n")); + error = FSCK_ERROR; + goto out; + } + if (query(&opts, _("\nJournal #%d (\"journal%d\") is dirty. Okay to " + "replay it? (y/n)"), j+1, j)) { log_info( _("jid=%u: Replaying journal...\n"), j); sd_found_jblocks = sd_replayed_jblocks = 0; @@ -455,13 +518,16 @@ static int gfs2_recover_journal(struct gfs2_inode *ip, int j) } out: - log_info( _("jid=%u: %s\n"), j, (error) ? "Failed" : "Done"); + log_info( _("jid=%u: %s\n"), j, (error) ? _("Failed") : _("Done")); return error; } /* * replay_journals - replay the journals * sdp: the super block + * preen: Was preen (-a or -p) specified? + * force_check: Was -f specified to force the check? + * @clean_journals - set to the number of clean journals we find * * There should be a flag to the fsck to enable/disable this * feature. The fsck falls back to clearing the journal if an @@ -469,10 +535,13 @@ out: * * Returns: 0 on success, -1 on failure */ -int replay_journals(struct gfs2_sbd *sdp){ +int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check, + int *clean_journals) +{ int i; + int clean = 0, dirty_journals = 0, error = 0, gave_msg = 0; - log_notice( _("Recovering journals (this may take a while)")); + *clean_journals = 0; /* Get master dinode */ sdp->master_dir = gfs2_load_inode(sdp, @@ -486,17 +555,27 @@ int replay_journals(struct gfs2_sbd *sdp){ } for(i = 0; i < sdp->md.journals; i++) { - if((i % 2) == 0) - log_at_notice("."); - gfs2_recover_journal(sdp->md.journal[i], i); + if (!error) { + error = gfs2_recover_journal(sdp->md.journal[i], i, + preen, force_check, + &clean); + if (!clean) + dirty_journals++; + if (!gave_msg && dirty_journals == 1 && !opts.no && + preen_is_safe(sdp, preen, force_check)) { + gave_msg = 1; + log_notice( _("Recovering journals (this may " + "take a while)\n")); + } + *clean_journals += clean; + } inode_put(sdp->md.journal[i], (opts.no ? not_updated : updated)); } - log_notice( _("\nJournal recovery complete.\n")); inode_put(sdp->master_dir, not_updated); inode_put(sdp->md.jiinode, not_updated); /* Sync the buffers to disk so we get a fresh start. */ bsync(&sdp->buf_list); bsync(&sdp->nvbuf_list); - return 0; + return error; } diff --git a/gfs2/fsck/fs_recovery.h b/gfs2/fsck/fs_recovery.h index 484ea67..a61884d 100644 --- a/gfs2/fsck/fs_recovery.h +++ b/gfs2/fsck/fs_recovery.h @@ -3,7 +3,9 @@ #include "libgfs2.h" -int replay_journals(struct gfs2_sbd *sdp); +int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check, + int *clean_journals); +int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check); #endif /* __FS_RECOVERY_H__ */ diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h index ac04593..1b479e9 100644 --- a/gfs2/fsck/fsck.h +++ b/gfs2/fsck/fsck.h @@ -65,9 +65,9 @@ struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh); void fsck_inode_put(struct gfs2_inode *ip, enum update_flags update); -int initialize(struct gfs2_sbd *sbp); +int initialize(struct gfs2_sbd *sbp, int force_check, int preen, + int *all_clean); void destroy(struct gfs2_sbd *sbp); -int block_mounters(struct gfs2_sbd *sbp, int block_em); int pass1(struct gfs2_sbd *sbp); int pass1b(struct gfs2_sbd *sbp); int pass1c(struct gfs2_sbd *sbp); diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c index 502cb81..6954bfe 100644 --- a/gfs2/fsck/initialize.c +++ b/gfs2/fsck/initialize.c @@ -8,6 +8,8 @@ #include #include #include +#include + #define _(String) gettext(String) #include "libgfs2.h" @@ -22,20 +24,6 @@ } /** - * init_journals - * - * Go through journals and replay them - then clear them - */ -static int init_journals(struct gfs2_sbd *sbp) -{ - if(!opts.no) { - if(replay_journals(sbp)) - return 1; - } - return 0; -} - -/** * block_mounters * * Change the lock protocol so nobody can mount the fs @@ -109,7 +97,8 @@ static void empty_super_block(struct gfs2_sbd *sdp) } } - gfs2_block_list_destroy(sdp, bl); + if (bl) + gfs2_block_list_destroy(sdp, bl); } @@ -332,8 +321,13 @@ static int fill_super_block(struct gfs2_sbd *sdp) * initialize - initialize superblock pointer * */ -int initialize(struct gfs2_sbd *sbp) +int initialize(struct gfs2_sbd *sbp, int force_check, int preen, + int *all_clean) { + int clean_journals = 0; + + *all_clean = 0; + if(opts.no) { if ((sbp->device_fd = open(opts.device, O_RDONLY)) < 0) { log_crit( _("Unable to open device: %s\n"), opts.device); @@ -341,8 +335,13 @@ int initialize(struct gfs2_sbd *sbp) } } else { /* read in sb from disk */ - if ((sbp->device_fd = open(opts.device, O_RDWR)) < 0){ - log_crit( _("Unable to open device: %s\n"), opts.device); + if ((sbp->device_fd = open(opts.device, O_RDWR | O_EXCL)) < 0){ + if (errno == EBUSY) + log_crit( _("Device %s is busy.\n"), + opts.device); + else + log_crit( _("Unable to open device: %s\n"), + opts.device); return FSCK_USAGE; } } @@ -352,7 +351,7 @@ int initialize(struct gfs2_sbd *sbp) } /* Change lock protocol to be fsck_* instead of lock_* */ - if(!opts.no) { + if(!opts.no && preen_is_safe(sbp, preen, force_check)) { if(block_mounters(sbp, 1)) { log_err( _("Unable to block other mounters\n")); return FSCK_USAGE; @@ -361,12 +360,21 @@ int initialize(struct gfs2_sbd *sbp) /* verify various things */ - if(init_journals(sbp)) { - if(!opts.no) + if(replay_journals(sbp, preen, force_check, &clean_journals)) { + if(!opts.no && preen_is_safe(sbp, preen, force_check)) block_mounters(sbp, 0); stack; return FSCK_ERROR; } + if (sbp->md.journals == clean_journals) + *all_clean = 1; + else { + if (force_check || !preen) + log_notice( _("\nJournal recovery complete.\n")); + } + + if (!force_check && *all_clean && preen) + return FSCK_OK; if (init_system_inodes(sbp)) return FSCK_ERROR; diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c index ad71ba5..513c2b6 100644 --- a/gfs2/fsck/main.c +++ b/gfs2/fsck/main.c @@ -20,13 +20,14 @@ struct gfs2_options opts = {0}; struct gfs2_inode *lf_dip; /* Lost and found directory inode */ osi_list_t dir_hash[FSCK_HASH_SIZE]; osi_list_t inode_hash[FSCK_HASH_SIZE]; -struct gfs2_block_list *bl; +struct gfs2_block_list *bl = NULL; uint64_t last_fs_block, last_reported_block = -1; int skip_this_pass = FALSE, fsck_abort = FALSE; int errors_found = 0, errors_corrected = 0; const char *pass = ""; uint64_t last_data_block; uint64_t first_data_block; +int preen = 0, force_check = 0; /* This function is for libgfs2's sake. */ void print_it(const char *label, const char *fmt, const char *fmt2, ...) @@ -41,7 +42,7 @@ void print_it(const char *label, const char *fmt, const char *fmt2, ...) static void usage(char *name) { - printf( _("Usage: %s [-hnqvVy] \n"), basename(name)); + printf("Usage: %s [-afhnpqvVy] \n", basename(name)); } static void version(void) @@ -55,9 +56,16 @@ static int read_cmdline(int argc, char **argv, struct gfs2_options *gopts) { int c; - while((c = getopt(argc, argv, "hnqvyV")) != -1) { + while((c = getopt(argc, argv, "afhnpqvyV")) != -1) { switch(c) { + case 'a': + preen = 1; + gopts->yes = 1; + break; + case 'f': + force_check = 1; + break; case 'h': usage(argv[0]); exit(FSCK_OK); @@ -65,6 +73,10 @@ static int read_cmdline(int argc, char **argv, struct gfs2_options *gopts) case 'n': gopts->no = 1; break; + case 'p': + preen = 1; + gopts->yes = 1; + break; case 'q': decrease_verbosity(); break; @@ -254,6 +266,7 @@ int main(int argc, char **argv) int j; enum update_flags update_sys_files; int error = 0; + int all_clean = 0; setlocale(LC_ALL, ""); textdomain("gfs2-utils"); @@ -264,9 +277,15 @@ int main(int argc, char **argv) exit(error); setbuf(stdout, NULL); log_notice( _("Initializing fsck\n")); - if ((error = initialize(sbp))) + if ((error = initialize(sbp, force_check, preen, &all_clean))) exit(error); + if (!force_check && all_clean && preen) { + log_err( _("%s: clean.\n"), opts.device); + destroy(sbp); + exit(FSCK_OK); + } + signal(SIGINT, interrupt); log_notice( _("Starting pass1\n")); pass = "pass 1"; diff --git a/gfs2/man/fsck.gfs2.8 b/gfs2/man/fsck.gfs2.8 index 7c8fd99..462e918 100644 --- a/gfs2/man/fsck.gfs2.8 +++ b/gfs2/man/fsck.gfs2.8 @@ -19,15 +19,29 @@ fsck.gfs2 can do. If important file system structures are destroyed, such that the checker cannot determine what the repairs should be, reparations could fail. -GFS2 is a journaled file system, and as such should be able to repair damages to +GFS2 is a journaled file system, and as such should be able to repair damage to the file system on its own. However, faulty hardware has the ability to write incomplete blocks to a file system thereby causing corruption that GFS2 cannot fix. The first step to ensuring a healthy file system is the selection of reliable hardware (i.e. storage systems that will write complete blocks - even in the event of power failure). +Note: Most file system checkers will not check the file system if it is +"clean" (i.e. unmounted since the last use). The fsck.gfs program behaves +differently because the storage may be shared among several nodes in a +cluster, and therefore problems may have been introduced on a different +computer. Therefore, fsck.gfs2 will always check the file system unless +the -p (preen) option is used, in which case it follows special rules +(see below). + .SH OPTIONS .TP +\fB-a\fP +Same as the -p (preen) option. +.TP +\fB-f\fP +Force checking even if the file system seems clean. +.TP \fB-h\fP Help. @@ -42,6 +56,21 @@ No to all questions. By specifying this option, fsck.gfs2 will only show the changes that would be made, but not make any changes to the filesystem. .TP +\fB-p\fP +Preen (same as -a: automatically repair the file system if it is dirty, +and safe to do so, otherwise exit.) + +Note: If the file system has locking protocol lock_nolock, the file system +is considered a non-shared storage device and the fsck is deemed safe. +However, fsck.gfs2 does not know whether it was called automatically +from the init process, due to options in the /etc/fstab file. Therefore, if +the locking protocol is lock_dlm and -a or -p was specified, fsck.gfs2 +cannot determine whether the disk is mounted by other nodes in the cluster. +Therefore, the fsck is deemed to be unsafe and a warning is given +if any damage or dirty journals are found. In that case, the file system +should be unmounted from all nodes in the cluster and fsck.gfs2 should be +run manually without the -a or -p options. +.TP \fB-V\fP Version. From rpeterso@fedoraproject.org Thu Jul 30 19:06:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Thu, 30 Jul 2009 19:06:00 -0000 Subject: cluster: RHEL5 - "fsck.gfs2: invalid option -- a" on boot when mounting gfs2 root Message-ID: <20090730190536.AA0951201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=0fd6204d9b8c0a05493d1a050128be5d9a40b769 Commit: 0fd6204d9b8c0a05493d1a050128be5d9a40b769 Parent: 0c68763dfaed3b2ca3d7f5e107eb813b3b38aee3 Author: Bob Peterson AuthorDate: Thu Jul 30 14:06:22 2009 -0500 Committer: Bob Peterson CommitterDate: Thu Jul 30 14:08:03 2009 -0500 "fsck.gfs2: invalid option -- a" on boot when mounting gfs2 root bz 507596 This patch adds three new parameters to fsck.gfs2: -a Same as -p (repair file system if dirty) -p Preen (Check file system and repair if it is dirty and if it's safe) -f force check, even if the file system seems clean --- gfs2/fsck/fs_recovery.c | 107 +++++++++++++++++++++++++++++++++++++++++------ gfs2/fsck/fs_recovery.h | 4 +- gfs2/fsck/fsck.h | 4 +- gfs2/fsck/initialize.c | 48 ++++++++++++--------- gfs2/fsck/main.c | 27 ++++++++++-- gfs2/man/fsck.gfs2.8 | 31 +++++++++++++- 6 files changed, 179 insertions(+), 42 deletions(-) diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c index 63eda74..a90aa77 100644 --- a/gfs2/fsck/fs_recovery.c +++ b/gfs2/fsck/fs_recovery.c @@ -384,8 +384,34 @@ int fix_journal_seq_no(struct gfs2_inode *ip) } /** + * preen_is_safe - Can we safely preen the file system? + * + * If a preen option was specified (-a or -p) we're likely to have been + * called from rc.sysinit. We need to determine whether this is shared + * storage or not. If it's local storage (locking protocol==lock_nolock) + * it's safe to preen the file system. If it's lock_dlm, it's likely + * mounted by other nodes in the cluster, which is dangerous and therefore, + * we should warn the user to run fsck.gfs2 manually when it's safe. + */ +int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check) +{ + if (!preen) /* If preen was not specified */ + return 1; /* not called by rc.sysinit--we're okay to preen */ + if (force_check) /* If check was forced by the user? */ + return 1; /* user's responsibility--we're okay to preen */ + if(!memcmp(sdp->sd_sb.sb_lockproto + 5, "nolock", 6)) + return 1; /* local file system--preen is okay */ + return 0; /* might be mounted on another node--not guaranteed safe */ +} + +/** * gfs2_recover_journal - recovery a given journal * @ip: the journal incore inode + * j: which journal to check + * preen: Was preen (-a or -p) specified? + * force_check: Was -f specified to force the check? + * @was_clean: if the journal was originally clean, this is set to 1. + * if the journal was dirty from the start, this is set to 0. * * Acquire the journal's lock, check to see if the journal is clean, and * do recovery if necessary. @@ -393,21 +419,42 @@ int fix_journal_seq_no(struct gfs2_inode *ip) * Returns: errno */ -int gfs2_recover_journal(struct gfs2_inode *ip, int j) +static int gfs2_recover_journal(struct gfs2_inode *ip, int j, int preen, + int force_check, int *was_clean) { struct gfs2_sbd *sdp = ip->i_sbd; struct gfs2_log_header head; unsigned int pass; int error; + *was_clean = 0; log_info("jid=%u: Looking at journal...\n", j); osi_list_init(&sd_revoke_list); error = gfs2_find_jhead(ip, &head); if (error) { - if (!query(&opts, "\nJournal #%d (\"journal%d\") is corrupt. " - "Okay to repair it? (y/n)", j+1, j)) { - log_err("jid=%u: The journal was not repaired.\n", j); + if (opts.no) { + log_err("Journal #%d (\"journal%d\") is corrupt.\n" + "Not fixing it due to the -n option.\n", + j+1, j); + goto out; + } + if (!preen_is_safe(sdp, preen, force_check)) { + log_err("Journal #%d (\"journal%d\") is corrupt.\n", + j+1, j); + log_err("I'm not fixing it because it may be unsafe:\n" + "Locking protocol is not lock_nolock and " + "the -a or -p option was specified.\n"); + log_err("Please make sure no node has the file system " + "mounted then rerun fsck.gfs2 manually " + "without -a or -p.\n"); + goto out; + } + if (!query(&opts, "\nJournal #%d (\"journal%d\") is " + "corrupt. Okay to repair it? (y/n)", + j+1, j)) { + log_err("jid=%u: The journal was not repaired.\n", + j); goto out; } log_info("jid=%u: Repairing journal...\n", j); @@ -426,10 +473,28 @@ int gfs2_recover_journal(struct gfs2_inode *ip, int j) } if (head.lh_flags & GFS2_LOG_HEAD_UNMOUNT) { log_info("jid=%u: Journal is clean.\n", j); + *was_clean = 1; return 0; } - if (query(&opts, "\nJournal #%d (\"journal%d\") is dirty. Okay to replay it? (y/n)", - j+1, j)) { + if (opts.no) { + log_err("Journal #%d (\"journal%d\") is dirty; not replaying" + " due to the -n option.\n", + j+1, j); + goto out; + } + if (!preen_is_safe(sdp, preen, force_check)) { + log_err("Journal #%d (\"journal%d\") is dirty.\n", j+1, j); + log_err("I'm not replaying it because it may be unsafe:\n" + "Locking protocol is not lock_nolock and " + "the -a or -p option was specified.\n"); + log_err("Please make sure no node has the file system " + "mounted then rerun fsck.gfs2 manually " + "without -a or -p.\n"); + error = FSCK_ERROR; + goto out; + } + if (query(&opts, "\nJournal #%d (\"journal%d\") is dirty. Okay to " + "replay it? (y/n)", j+1, j)) { log_info("jid=%u: Replaying journal...\n", j); sd_found_jblocks = sd_replayed_jblocks = 0; @@ -470,6 +535,9 @@ out: /* * replay_journals - replay the journals * sdp: the super block + * preen: Was preen (-a or -p) specified? + * force_check: Was -f specified to force the check? + * @clean_journals - set to the number of clean journals we find * * There should be a flag to the fsck to enable/disable this * feature. The fsck falls back to clearing the journal if an @@ -477,10 +545,13 @@ out: * * Returns: 0 on success, -1 on failure */ -int replay_journals(struct gfs2_sbd *sdp){ +int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check, + int *clean_journals) +{ int i; + int clean = 0, dirty_journals = 0, error = 0, gave_msg = 0; - log_notice("Recovering journals (this may take a while)"); + *clean_journals = 0; /* Get master dinode */ sdp->master_dir = gfs2_load_inode(sdp, @@ -494,17 +565,27 @@ int replay_journals(struct gfs2_sbd *sdp){ } for(i = 0; i < sdp->md.journals; i++) { - if((i % 2) == 0) - log_at_notice("."); - gfs2_recover_journal(sdp->md.journal[i], i); + if (!error) { + error = gfs2_recover_journal(sdp->md.journal[i], i, + preen, force_check, + &clean); + if (!clean) + dirty_journals++; + if (!gave_msg && dirty_journals == 1 && !opts.no && + preen_is_safe(sdp, preen, force_check)) { + gave_msg = 1; + log_notice("Recovering journals (this may " + "take a while)\n"); + } + *clean_journals += clean; + } inode_put(sdp->md.journal[i], (opts.no ? not_updated : updated)); } - log_notice("\nJournal recovery complete.\n"); inode_put(sdp->master_dir, not_updated); inode_put(sdp->md.jiinode, not_updated); /* Sync the buffers to disk so we get a fresh start. */ bsync(&sdp->buf_list); bsync(&sdp->nvbuf_list); - return 0; + return error; } diff --git a/gfs2/fsck/fs_recovery.h b/gfs2/fsck/fs_recovery.h index b7ae2b0..c86a85d 100644 --- a/gfs2/fsck/fs_recovery.h +++ b/gfs2/fsck/fs_recovery.h @@ -16,7 +16,9 @@ #include "libgfs2.h" -int replay_journals(struct gfs2_sbd *sdp); +int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check, + int *clean_journals); +int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check); #endif /* __FS_RECOVERY_H__ */ diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h index e6043ac..57dd6b4 100644 --- a/gfs2/fsck/fsck.h +++ b/gfs2/fsck/fsck.h @@ -77,9 +77,9 @@ struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh); void fsck_inode_put(struct gfs2_inode *ip, enum update_flags update); -int initialize(struct gfs2_sbd *sbp); +int initialize(struct gfs2_sbd *sbp, int force_check, int preen, + int *all_clean); void destroy(struct gfs2_sbd *sbp); -int block_mounters(struct gfs2_sbd *sbp, int block_em); int pass1(struct gfs2_sbd *sbp); int pass1b(struct gfs2_sbd *sbp); int pass1c(struct gfs2_sbd *sbp); diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c index ede9f43..10c8ecc 100644 --- a/gfs2/fsck/initialize.c +++ b/gfs2/fsck/initialize.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "libgfs2.h" #include "fsck.h" @@ -35,20 +36,6 @@ } /** - * init_journals - * - * Go through journals and replay them - then clear them - */ -int init_journals(struct gfs2_sbd *sbp) -{ - if(!opts.no) { - if(replay_journals(sbp)) - return 1; - } - return 0; -} - -/** * block_mounters * * Change the lock protocol so nobody can mount the fs @@ -122,7 +109,8 @@ static void empty_super_block(struct gfs2_sbd *sdp) } } - gfs2_block_list_destroy(sdp, bl); + if (bl) + gfs2_block_list_destroy(sdp, bl); } @@ -339,8 +327,13 @@ static int fill_super_block(struct gfs2_sbd *sdp) * initialize - initialize superblock pointer * */ -int initialize(struct gfs2_sbd *sbp) +int initialize(struct gfs2_sbd *sbp, int force_check, int preen, + int *all_clean) { + int clean_journals = 0; + + *all_clean = 0; + if(opts.no) { if ((sbp->device_fd = open(opts.device, O_RDONLY)) < 0) { log_crit("Unable to open device: %s\n", opts.device); @@ -348,8 +341,12 @@ int initialize(struct gfs2_sbd *sbp) } } else { /* read in sb from disk */ - if ((sbp->device_fd = open(opts.device, O_RDWR)) < 0){ - log_crit("Unable to open device: %s\n", opts.device); + if ((sbp->device_fd = open(opts.device, O_RDWR | O_EXCL)) < 0){ + if (errno == EBUSY) + log_crit("Device %s is busy.\n", opts.device); + else + log_crit("Unable to open device: %s\n", + opts.device); return FSCK_USAGE; } } @@ -359,7 +356,7 @@ int initialize(struct gfs2_sbd *sbp) } /* Change lock protocol to be fsck_* instead of lock_* */ - if(!opts.no) { + if(!opts.no && preen_is_safe(sbp, preen, force_check)) { if(block_mounters(sbp, 1)) { log_err("Unable to block other mounters\n"); return FSCK_USAGE; @@ -368,12 +365,21 @@ int initialize(struct gfs2_sbd *sbp) /* verify various things */ - if(init_journals(sbp)) { - if(!opts.no) + if(replay_journals(sbp, preen, force_check, &clean_journals)) { + if(!opts.no && preen_is_safe(sbp, preen, force_check)) block_mounters(sbp, 0); stack; return FSCK_ERROR; } + if (sbp->md.journals == clean_journals) + *all_clean = 1; + else { + if (force_check || !preen) + log_notice("\nJournal recovery complete.\n"); + } + + if (!force_check && *all_clean && preen) + return FSCK_OK; if (init_system_inodes(sbp)) return FSCK_ERROR; diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c index a3759d2..8c85c8d 100644 --- a/gfs2/fsck/main.c +++ b/gfs2/fsck/main.c @@ -29,7 +29,7 @@ struct gfs2_options opts = {0}; struct gfs2_inode *lf_dip; /* Lost and found directory inode */ osi_list_t dir_hash[FSCK_HASH_SIZE]; osi_list_t inode_hash[FSCK_HASH_SIZE]; -struct gfs2_block_list *bl; +struct gfs2_block_list *bl = NULL; uint64_t last_fs_block, last_reported_block = -1; int skip_this_pass = FALSE, fsck_abort = FALSE; int errors_found = 0, errors_corrected = 0; @@ -37,6 +37,7 @@ const char *pass = ""; uint64_t last_data_block; uint64_t first_data_block; char *prog_name = "gfs2_fsck"; /* needed by libgfs2 */ +int preen = 0, force_check = 0; /* This function is for libgfs2's sake. */ void print_it(const char *label, const char *fmt, const char *fmt2, ...) @@ -51,7 +52,7 @@ void print_it(const char *label, const char *fmt, const char *fmt2, ...) void usage(char *name) { - printf("Usage: %s [-hnqvVy] \n", basename(name)); + printf("Usage: %s [-afhnpqvVy] \n", basename(name)); } void version(void) @@ -65,9 +66,16 @@ int read_cmdline(int argc, char **argv, struct gfs2_options *opts) { int c; - while((c = getopt(argc, argv, "hnqvyV")) != -1) { + while((c = getopt(argc, argv, "afhnpqvyV")) != -1) { switch(c) { + case 'a': + preen = 1; + opts->yes = 1; + break; + case 'f': + force_check = 1; + break; case 'h': usage(argv[0]); exit(FSCK_OK); @@ -75,6 +83,10 @@ int read_cmdline(int argc, char **argv, struct gfs2_options *opts) case 'n': opts->no = 1; break; + case 'p': + preen = 1; + opts->yes = 1; + break; case 'q': decrease_verbosity(); break; @@ -264,6 +276,7 @@ int main(int argc, char **argv) int j; enum update_flags update_sys_files; int error = 0; + int all_clean = 0; memset(sbp, 0, sizeof(*sbp)); @@ -271,9 +284,15 @@ int main(int argc, char **argv) exit(error); setbuf(stdout, NULL); log_notice("Initializing fsck\n"); - if ((error = initialize(sbp))) + if ((error = initialize(sbp, force_check, preen, &all_clean))) exit(error); + if (!force_check && all_clean && preen) { + log_err("%s: clean.\n", opts.device); + destroy(sbp); + exit(FSCK_OK); + } + signal(SIGINT, interrupt); log_notice("Starting pass1\n"); pass = "pass 1"; diff --git a/gfs2/man/fsck.gfs2.8 b/gfs2/man/fsck.gfs2.8 index ef6d43a..6910760 100644 --- a/gfs2/man/fsck.gfs2.8 +++ b/gfs2/man/fsck.gfs2.8 @@ -22,15 +22,29 @@ fsck.gfs2 can do. If important file system structures are destroyed, such that the checker cannot determine what the repairs should be, reparations could fail. -GFS2 is a journaled file system, and as such should be able to repair damages to +GFS2 is a journaled file system, and as such should be able to repair damage to the file system on its own. However, faulty hardware has the ability to write incomplete blocks to a file system thereby causing corruption that GFS2 cannot fix. The first step to ensuring a healthy file system is the selection of reliable hardware (i.e. storage systems that will write complete blocks - even in the event of power failure). +Note: Most file system checkers will not check the file system if it is +"clean" (i.e. unmounted since the last use). The fsck.gfs program behaves +differently because the storage may be shared among several nodes in a +cluster, and therefore problems may have been introduced on a different +computer. Therefore, fsck.gfs2 will always check the file system unless +the -p (preen) option is used, in which case it follows special rules +(see below). + .SH OPTIONS .TP +\fB-a\fP +Same as the -p (preen) option. +.TP +\fB-f\fP +Force checking even if the file system seems clean. +.TP \fB-h\fP Help. @@ -45,6 +59,21 @@ No to all questions. By specifying this option, fsck.gfs2 will only show the changes that would be made, but not make any changes to the filesystem. .TP +\fB-p\fP +Preen (same as -a: automatically repair the file system if it is dirty, +and safe to do so, otherwise exit.) + +Note: If the file system has locking protocol lock_nolock, the file system +is considered a non-shared storage device and the fsck is deemed safe. +However, fsck.gfs2 does not know whether it was called automatically +from the init process, due to options in the /etc/fstab file. Therefore, if +the locking protocol is lock_dlm and -a or -p was specified, fsck.gfs2 +cannot determine whether the disk is mounted by other nodes in the cluster. +Therefore, the fsck is deemed to be unsafe and a warning is given +if any damage or dirty journals are found. In that case, the file system +should be unmounted from all nodes in the cluster and fsck.gfs2 should be +run manually without the -a or -p options. +.TP \fB-V\fP Version. From rpeterso@fedoraproject.org Thu Jul 30 19:07:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Thu, 30 Jul 2009 19:07:00 -0000 Subject: cluster: STABLE2 - "fsck.gfs2: invalid option -- a" on boot when mounting gfs2 root Message-ID: <20090730190704.030FF1201A5@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a45ade0817c0e0169b612f70950d943ca7293985 Commit: a45ade0817c0e0169b612f70950d943ca7293985 Parent: 64783adc61537af71f000c763e512a9a5293970b Author: Bob Peterson AuthorDate: Thu Jul 30 14:06:22 2009 -0500 Committer: Bob Peterson CommitterDate: Thu Jul 30 14:10:14 2009 -0500 "fsck.gfs2: invalid option -- a" on boot when mounting gfs2 root bz 507596 This patch adds three new parameters to fsck.gfs2: -a Same as -p (repair file system if dirty) -p Preen (Check file system and repair if it is dirty and if it's safe) -f force check, even if the file system seems clean --- gfs2/fsck/fs_recovery.c | 107 +++++++++++++++++++++++++++++++++++++++++------ gfs2/fsck/fs_recovery.h | 4 +- gfs2/fsck/fsck.h | 4 +- gfs2/fsck/initialize.c | 48 ++++++++++++--------- gfs2/fsck/main.c | 27 ++++++++++-- gfs2/man/fsck.gfs2.8 | 31 +++++++++++++- 6 files changed, 179 insertions(+), 42 deletions(-) diff --git a/gfs2/fsck/fs_recovery.c b/gfs2/fsck/fs_recovery.c index 5c942b9..db6fbb3 100644 --- a/gfs2/fsck/fs_recovery.c +++ b/gfs2/fsck/fs_recovery.c @@ -374,8 +374,34 @@ int fix_journal_seq_no(struct gfs2_inode *ip) } /** + * preen_is_safe - Can we safely preen the file system? + * + * If a preen option was specified (-a or -p) we're likely to have been + * called from rc.sysinit. We need to determine whether this is shared + * storage or not. If it's local storage (locking protocol==lock_nolock) + * it's safe to preen the file system. If it's lock_dlm, it's likely + * mounted by other nodes in the cluster, which is dangerous and therefore, + * we should warn the user to run fsck.gfs2 manually when it's safe. + */ +int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check) +{ + if (!preen) /* If preen was not specified */ + return 1; /* not called by rc.sysinit--we're okay to preen */ + if (force_check) /* If check was forced by the user? */ + return 1; /* user's responsibility--we're okay to preen */ + if(!memcmp(sdp->sd_sb.sb_lockproto + 5, "nolock", 6)) + return 1; /* local file system--preen is okay */ + return 0; /* might be mounted on another node--not guaranteed safe */ +} + +/** * gfs2_recover_journal - recovery a given journal * @ip: the journal incore inode + * j: which journal to check + * preen: Was preen (-a or -p) specified? + * force_check: Was -f specified to force the check? + * @was_clean: if the journal was originally clean, this is set to 1. + * if the journal was dirty from the start, this is set to 0. * * Acquire the journal's lock, check to see if the journal is clean, and * do recovery if necessary. @@ -383,21 +409,42 @@ int fix_journal_seq_no(struct gfs2_inode *ip) * Returns: errno */ -int gfs2_recover_journal(struct gfs2_inode *ip, int j) +static int gfs2_recover_journal(struct gfs2_inode *ip, int j, int preen, + int force_check, int *was_clean) { struct gfs2_sbd *sdp = ip->i_sbd; struct gfs2_log_header head; unsigned int pass; int error; + *was_clean = 0; log_info("jid=%u: Looking at journal...\n", j); osi_list_init(&sd_revoke_list); error = gfs2_find_jhead(ip, &head); if (error) { - if (!query(&opts, "\nJournal #%d (\"journal%d\") is corrupt. " - "Okay to repair it? (y/n)", j+1, j)) { - log_err("jid=%u: The journal was not repaired.\n", j); + if (opts.no) { + log_err("Journal #%d (\"journal%d\") is corrupt.\n" + "Not fixing it due to the -n option.\n", + j+1, j); + goto out; + } + if (!preen_is_safe(sdp, preen, force_check)) { + log_err("Journal #%d (\"journal%d\") is corrupt.\n", + j+1, j); + log_err("I'm not fixing it because it may be unsafe:\n" + "Locking protocol is not lock_nolock and " + "the -a or -p option was specified.\n"); + log_err("Please make sure no node has the file system " + "mounted then rerun fsck.gfs2 manually " + "without -a or -p.\n"); + goto out; + } + if (!query(&opts, "\nJournal #%d (\"journal%d\") is " + "corrupt. Okay to repair it? (y/n)", + j+1, j)) { + log_err("jid=%u: The journal was not repaired.\n", + j); goto out; } log_info("jid=%u: Repairing journal...\n", j); @@ -416,10 +463,28 @@ int gfs2_recover_journal(struct gfs2_inode *ip, int j) } if (head.lh_flags & GFS2_LOG_HEAD_UNMOUNT) { log_info("jid=%u: Journal is clean.\n", j); + *was_clean = 1; return 0; } - if (query(&opts, "\nJournal #%d (\"journal%d\") is dirty. Okay to replay it? (y/n)", - j+1, j)) { + if (opts.no) { + log_err("Journal #%d (\"journal%d\") is dirty; not replaying" + " due to the -n option.\n", + j+1, j); + goto out; + } + if (!preen_is_safe(sdp, preen, force_check)) { + log_err("Journal #%d (\"journal%d\") is dirty.\n", j+1, j); + log_err("I'm not replaying it because it may be unsafe:\n" + "Locking protocol is not lock_nolock and " + "the -a or -p option was specified.\n"); + log_err("Please make sure no node has the file system " + "mounted then rerun fsck.gfs2 manually " + "without -a or -p.\n"); + error = FSCK_ERROR; + goto out; + } + if (query(&opts, "\nJournal #%d (\"journal%d\") is dirty. Okay to " + "replay it? (y/n)", j+1, j)) { log_info("jid=%u: Replaying journal...\n", j); sd_found_jblocks = sd_replayed_jblocks = 0; @@ -460,6 +525,9 @@ out: /* * replay_journals - replay the journals * sdp: the super block + * preen: Was preen (-a or -p) specified? + * force_check: Was -f specified to force the check? + * @clean_journals - set to the number of clean journals we find * * There should be a flag to the fsck to enable/disable this * feature. The fsck falls back to clearing the journal if an @@ -467,10 +535,13 @@ out: * * Returns: 0 on success, -1 on failure */ -int replay_journals(struct gfs2_sbd *sdp){ +int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check, + int *clean_journals) +{ int i; + int clean = 0, dirty_journals = 0, error = 0, gave_msg = 0; - log_notice("Recovering journals (this may take a while)"); + *clean_journals = 0; /* Get master dinode */ sdp->master_dir = gfs2_load_inode(sdp, @@ -484,17 +555,27 @@ int replay_journals(struct gfs2_sbd *sdp){ } for(i = 0; i < sdp->md.journals; i++) { - if((i % 2) == 0) - log_at_notice("."); - gfs2_recover_journal(sdp->md.journal[i], i); + if (!error) { + error = gfs2_recover_journal(sdp->md.journal[i], i, + preen, force_check, + &clean); + if (!clean) + dirty_journals++; + if (!gave_msg && dirty_journals == 1 && !opts.no && + preen_is_safe(sdp, preen, force_check)) { + gave_msg = 1; + log_notice("Recovering journals (this may " + "take a while)\n"); + } + *clean_journals += clean; + } inode_put(sdp->md.journal[i], (opts.no ? not_updated : updated)); } - log_notice("\nJournal recovery complete.\n"); inode_put(sdp->master_dir, not_updated); inode_put(sdp->md.jiinode, not_updated); /* Sync the buffers to disk so we get a fresh start. */ bsync(&sdp->buf_list); bsync(&sdp->nvbuf_list); - return 0; + return error; } diff --git a/gfs2/fsck/fs_recovery.h b/gfs2/fsck/fs_recovery.h index 484ea67..a61884d 100644 --- a/gfs2/fsck/fs_recovery.h +++ b/gfs2/fsck/fs_recovery.h @@ -3,7 +3,9 @@ #include "libgfs2.h" -int replay_journals(struct gfs2_sbd *sdp); +int replay_journals(struct gfs2_sbd *sdp, int preen, int force_check, + int *clean_journals); +int preen_is_safe(struct gfs2_sbd *sdp, int preen, int force_check); #endif /* __FS_RECOVERY_H__ */ diff --git a/gfs2/fsck/fsck.h b/gfs2/fsck/fsck.h index ac04593..1b479e9 100644 --- a/gfs2/fsck/fsck.h +++ b/gfs2/fsck/fsck.h @@ -65,9 +65,9 @@ struct gfs2_inode *fsck_inode_get(struct gfs2_sbd *sdp, struct gfs2_buffer_head *bh); void fsck_inode_put(struct gfs2_inode *ip, enum update_flags update); -int initialize(struct gfs2_sbd *sbp); +int initialize(struct gfs2_sbd *sbp, int force_check, int preen, + int *all_clean); void destroy(struct gfs2_sbd *sbp); -int block_mounters(struct gfs2_sbd *sbp, int block_em); int pass1(struct gfs2_sbd *sbp); int pass1b(struct gfs2_sbd *sbp); int pass1c(struct gfs2_sbd *sbp); diff --git a/gfs2/fsck/initialize.c b/gfs2/fsck/initialize.c index 4dc5661..8525c65 100644 --- a/gfs2/fsck/initialize.c +++ b/gfs2/fsck/initialize.c @@ -8,6 +8,7 @@ #include #include #include +#include #include "libgfs2.h" #include "fsck.h" @@ -22,20 +23,6 @@ } /** - * init_journals - * - * Go through journals and replay them - then clear them - */ -int init_journals(struct gfs2_sbd *sbp) -{ - if(!opts.no) { - if(replay_journals(sbp)) - return 1; - } - return 0; -} - -/** * block_mounters * * Change the lock protocol so nobody can mount the fs @@ -109,7 +96,8 @@ static void empty_super_block(struct gfs2_sbd *sdp) } } - gfs2_block_list_destroy(sdp, bl); + if (bl) + gfs2_block_list_destroy(sdp, bl); } @@ -326,8 +314,13 @@ static int fill_super_block(struct gfs2_sbd *sdp) * initialize - initialize superblock pointer * */ -int initialize(struct gfs2_sbd *sbp) +int initialize(struct gfs2_sbd *sbp, int force_check, int preen, + int *all_clean) { + int clean_journals = 0; + + *all_clean = 0; + if(opts.no) { if ((sbp->device_fd = open(opts.device, O_RDONLY)) < 0) { log_crit("Unable to open device: %s\n", opts.device); @@ -335,8 +328,12 @@ int initialize(struct gfs2_sbd *sbp) } } else { /* read in sb from disk */ - if ((sbp->device_fd = open(opts.device, O_RDWR)) < 0){ - log_crit("Unable to open device: %s\n", opts.device); + if ((sbp->device_fd = open(opts.device, O_RDWR | O_EXCL)) < 0){ + if (errno == EBUSY) + log_crit("Device %s is busy.\n", opts.device); + else + log_crit("Unable to open device: %s\n", + opts.device); return FSCK_USAGE; } } @@ -346,7 +343,7 @@ int initialize(struct gfs2_sbd *sbp) } /* Change lock protocol to be fsck_* instead of lock_* */ - if(!opts.no) { + if(!opts.no && preen_is_safe(sbp, preen, force_check)) { if(block_mounters(sbp, 1)) { log_err("Unable to block other mounters\n"); return FSCK_USAGE; @@ -355,12 +352,21 @@ int initialize(struct gfs2_sbd *sbp) /* verify various things */ - if(init_journals(sbp)) { - if(!opts.no) + if(replay_journals(sbp, preen, force_check, &clean_journals)) { + if(!opts.no && preen_is_safe(sbp, preen, force_check)) block_mounters(sbp, 0); stack; return FSCK_ERROR; } + if (sbp->md.journals == clean_journals) + *all_clean = 1; + else { + if (force_check || !preen) + log_notice("\nJournal recovery complete.\n"); + } + + if (!force_check && *all_clean && preen) + return FSCK_OK; if (init_system_inodes(sbp)) return FSCK_ERROR; diff --git a/gfs2/fsck/main.c b/gfs2/fsck/main.c index c076bf3..57c452a 100644 --- a/gfs2/fsck/main.c +++ b/gfs2/fsck/main.c @@ -17,7 +17,7 @@ struct gfs2_options opts = {0}; struct gfs2_inode *lf_dip; /* Lost and found directory inode */ osi_list_t dir_hash[FSCK_HASH_SIZE]; osi_list_t inode_hash[FSCK_HASH_SIZE]; -struct gfs2_block_list *bl; +struct gfs2_block_list *bl = NULL; uint64_t last_fs_block, last_reported_block = -1; int skip_this_pass = FALSE, fsck_abort = FALSE; int errors_found = 0, errors_corrected = 0; @@ -25,6 +25,7 @@ const char *pass = ""; uint64_t last_data_block; uint64_t first_data_block; char *prog_name = "gfs2_fsck"; /* needed by libgfs2 */ +int preen = 0, force_check = 0; /* This function is for libgfs2's sake. */ void print_it(const char *label, const char *fmt, const char *fmt2, ...) @@ -39,7 +40,7 @@ void print_it(const char *label, const char *fmt, const char *fmt2, ...) void usage(char *name) { - printf("Usage: %s [-hnqvVy] \n", basename(name)); + printf("Usage: %s [-afhnpqvVy] \n", basename(name)); } void version(void) @@ -53,9 +54,16 @@ int read_cmdline(int argc, char **argv, struct gfs2_options *opts) { int c; - while((c = getopt(argc, argv, "hnqvyV")) != -1) { + while((c = getopt(argc, argv, "afhnpqvyV")) != -1) { switch(c) { + case 'a': + preen = 1; + opts->yes = 1; + break; + case 'f': + force_check = 1; + break; case 'h': usage(argv[0]); exit(FSCK_OK); @@ -63,6 +71,10 @@ int read_cmdline(int argc, char **argv, struct gfs2_options *opts) case 'n': opts->no = 1; break; + case 'p': + preen = 1; + opts->yes = 1; + break; case 'q': decrease_verbosity(); break; @@ -252,6 +264,7 @@ int main(int argc, char **argv) int j; enum update_flags update_sys_files; int error = 0; + int all_clean = 0; memset(sbp, 0, sizeof(*sbp)); @@ -259,9 +272,15 @@ int main(int argc, char **argv) exit(error); setbuf(stdout, NULL); log_notice("Initializing fsck\n"); - if ((error = initialize(sbp))) + if ((error = initialize(sbp, force_check, preen, &all_clean))) exit(error); + if (!force_check && all_clean && preen) { + log_err("%s: clean.\n", opts.device); + destroy(sbp); + exit(FSCK_OK); + } + signal(SIGINT, interrupt); log_notice("Starting pass1\n"); pass = "pass 1"; diff --git a/gfs2/man/fsck.gfs2.8 b/gfs2/man/fsck.gfs2.8 index 7c8fd99..462e918 100644 --- a/gfs2/man/fsck.gfs2.8 +++ b/gfs2/man/fsck.gfs2.8 @@ -19,15 +19,29 @@ fsck.gfs2 can do. If important file system structures are destroyed, such that the checker cannot determine what the repairs should be, reparations could fail. -GFS2 is a journaled file system, and as such should be able to repair damages to +GFS2 is a journaled file system, and as such should be able to repair damage to the file system on its own. However, faulty hardware has the ability to write incomplete blocks to a file system thereby causing corruption that GFS2 cannot fix. The first step to ensuring a healthy file system is the selection of reliable hardware (i.e. storage systems that will write complete blocks - even in the event of power failure). +Note: Most file system checkers will not check the file system if it is +"clean" (i.e. unmounted since the last use). The fsck.gfs program behaves +differently because the storage may be shared among several nodes in a +cluster, and therefore problems may have been introduced on a different +computer. Therefore, fsck.gfs2 will always check the file system unless +the -p (preen) option is used, in which case it follows special rules +(see below). + .SH OPTIONS .TP +\fB-a\fP +Same as the -p (preen) option. +.TP +\fB-f\fP +Force checking even if the file system seems clean. +.TP \fB-h\fP Help. @@ -42,6 +56,21 @@ No to all questions. By specifying this option, fsck.gfs2 will only show the changes that would be made, but not make any changes to the filesystem. .TP +\fB-p\fP +Preen (same as -a: automatically repair the file system if it is dirty, +and safe to do so, otherwise exit.) + +Note: If the file system has locking protocol lock_nolock, the file system +is considered a non-shared storage device and the fsck is deemed safe. +However, fsck.gfs2 does not know whether it was called automatically +from the init process, due to options in the /etc/fstab file. Therefore, if +the locking protocol is lock_dlm and -a or -p was specified, fsck.gfs2 +cannot determine whether the disk is mounted by other nodes in the cluster. +Therefore, the fsck is deemed to be unsafe and a warning is given +if any damage or dirty journals are found. In that case, the file system +should be unmounted from all nodes in the cluster and fsck.gfs2 should be +run manually without the -a or -p options. +.TP \fB-V\fP Version. From marx@fedoraproject.org Mon Aug 3 14:03:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 03 Aug 2009 14:03:00 -0000 Subject: cluster: RHEL54 - fencing: #514758 - fence_apc_snmp: local variable 'verbose_filename' referenced before assignment Message-ID: <20090803140327.ED4E6120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cc5e4640d9005fd17c347ecca94986653e205891 Commit: cc5e4640d9005fd17c347ecca94986653e205891 Parent: 9525957d66b4a45e0352a29c37905fc9f40c0b48 Author: Marek 'marx' Grac AuthorDate: Mon Aug 3 15:58:57 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Aug 3 15:58:57 2009 +0200 fencing: #514758 - fence_apc_snmp: local variable 'verbose_filename' referenced before assignment --- fence/agents/apc_snmp/fence_apc_snmp.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fence/agents/apc_snmp/fence_apc_snmp.py b/fence/agents/apc_snmp/fence_apc_snmp.py index fb79054..c391809 100755 --- a/fence/agents/apc_snmp/fence_apc_snmp.py +++ b/fence/agents/apc_snmp/fence_apc_snmp.py @@ -268,6 +268,7 @@ def main2(): '.1.3.6.1.4.1.318.1.3.4.4' : MasterSwitchPlus} verbose = False + verbose_filename = "" params = {} if len(sys.argv) > 1: From marx@fedoraproject.org Mon Aug 3 14:03:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 03 Aug 2009 14:03:00 -0000 Subject: cluster: RHEL54 - fencing: #493802 - Providing support for ssh enabled RSA II fence devices Message-ID: <20090803140325.C6247120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=9525957d66b4a45e0352a29c37905fc9f40c0b48 Commit: 9525957d66b4a45e0352a29c37905fc9f40c0b48 Parent: 08f5d180d1a6e3b376a2f0864368840ff264700b Author: Marek 'marx' Grac AuthorDate: Mon Aug 3 14:33:16 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Aug 3 14:33:16 2009 +0200 fencing: #493802 - Providing support for ssh enabled RSA II fence devices Fixing differencies between branches. --- fence/agents/rsa/fence_rsa.py | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index e2ec4dd..487758a 100755 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -8,7 +8,7 @@ ##### import sys, re, pexpect, exceptions -sys.path.append("@FENCEAGENTSLIBDIR@") +sys.path.append("/usr/lib/fence") from fencing import * #BEGIN_VERSION_GENERATION @@ -43,8 +43,6 @@ def main(): "action", "ipaddr", "login", "passwd", "passwd_script", "cmd_prompt", "secure" ] - atexit.register(atexit_handler) - options = check_input(device_opt, process_input(device_opt)) ## From marx@fedoraproject.org Mon Aug 3 14:05:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Mon, 03 Aug 2009 14:05:00 -0000 Subject: cluster: RHEL5 - fencing: #493802 - Providing support for ssh enabled RSA II fence devices Message-ID: <20090803140519.BDFD9120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e21c93ed28d3e90d71302036e003b11251507197 Commit: e21c93ed28d3e90d71302036e003b11251507197 Parent: 0fd6204d9b8c0a05493d1a050128be5d9a40b769 Author: Marek 'marx' Grac AuthorDate: Mon Aug 3 14:33:16 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon Aug 3 16:00:57 2009 +0200 fencing: #493802 - Providing support for ssh enabled RSA II fence devices Fixing differencies between branches. --- fence/agents/rsa/fence_rsa.py | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index 399e3c0..9ef8664 100755 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -8,7 +8,7 @@ ##### import sys, re, pexpect, exceptions -sys.path.append("@FENCEAGENTSLIBDIR@") +sys.path.append("/usr/lib/fence") from fencing import * #BEGIN_VERSION_GENERATION @@ -43,8 +43,6 @@ def main(): "action", "ipaddr", "login", "passwd", "passwd_script", "cmd_prompt", "secure", "ipport" ] - atexit.register(atexit_handler) - options = check_input(device_opt, process_input(device_opt)) ## From jbrassow@fedoraproject.org Mon Aug 3 20:43:00 2009 From: jbrassow@fedoraproject.org (Jonathan Brassow) Date: Mon, 03 Aug 2009 20:43:00 -0000 Subject: cluster: RHEL5 - clogd/dm-log-clustered: Use cleaner upstream solution for bug 479749 Message-ID: <20090803204311.3DE34120196@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=119d922b917b504b6eefe531289550333eed1ebd Commit: 119d922b917b504b6eefe531289550333eed1ebd Parent: e21c93ed28d3e90d71302036e003b11251507197 Author: Jonathan Brassow AuthorDate: Mon Aug 3 15:41:32 2009 -0500 Committer: Jonathan Brassow CommitterDate: Mon Aug 3 15:41:32 2009 -0500 clogd/dm-log-clustered: Use cleaner upstream solution for bug 479749 There is no need to have a list or list spinlock in the kernel if we take the allocated ptr for the in-kernel log structure as the 'local unique id'. Also, if we use a 64-bit field, architecture porting is easier. --- cmirror-kernel/src/dm-clog-tfr.c | 6 +- cmirror-kernel/src/dm-clog-tfr.h | 6 +- cmirror-kernel/src/dm-clog.c | 34 ++++---------- cmirror/src/cluster.c | 24 +++++----- cmirror/src/cluster.h | 2 +- cmirror/src/functions.c | 94 ++++++++++++++++++------------------- cmirror/src/functions.h | 4 +- 7 files changed, 77 insertions(+), 93 deletions(-) diff --git a/cmirror-kernel/src/dm-clog-tfr.c b/cmirror-kernel/src/dm-clog-tfr.c index ddcf359..82bf9a8 100644 --- a/cmirror-kernel/src/dm-clog-tfr.c +++ b/cmirror-kernel/src/dm-clog-tfr.c @@ -147,7 +147,7 @@ static void cn_clog_callback(void *data) /* * dm_clog_consult_server * @uuid: log's uuid (must be DM_UUID_LEN in size) - * @uuid_instance: further identifier (if more than 1 log with same uuid) + * @luid: further identifier (if more than 1 log with same uuid) * @request_type: * @data: data to tx to the server * @data_size: size of data in bytes @@ -159,7 +159,7 @@ static void cn_clog_callback(void *data) * * Returns: 0 on success, -EXXX on failure */ -int dm_clog_consult_server(const char *uuid, uint32_t uuid_instance, +int dm_clog_consult_server(const char *uuid, uint64_t luid, int request_type, char *data, int data_size, char *rdata, int *rdata_size) @@ -190,7 +190,7 @@ resend: memset(tfr, 0, DM_CLOG_PREALLOCED_SIZE - overhead_size); memcpy(tfr->uuid, uuid, DM_UUID_LEN); - tfr->uuid_instance = uuid_instance; + tfr->luid = luid; tfr->seq = seq++; tfr->request_type = request_type; tfr->data_size = data_size; diff --git a/cmirror-kernel/src/dm-clog-tfr.h b/cmirror-kernel/src/dm-clog-tfr.h index 802db8b..b41426a 100644 --- a/cmirror-kernel/src/dm-clog-tfr.h +++ b/cmirror-kernel/src/dm-clog-tfr.h @@ -52,8 +52,8 @@ struct clog_tfr { uint64_t private[2]; char uuid[DM_UUID_LEN]; /* Ties a request to a specific mirror log */ - char uuid_padding[3]; /* DM_UUID_LEN == 129 */ - uint32_t uuid_instance; /* Allows more than one instance w/ same uuid */ + char uuid_padding[7]; /* DM_UUID_LEN == 129 */ + uint64_t luid; /* Allows more than one instance w/ same uuid */ int32_t error; /* Used by server to inform of errors */ uint32_t originator; /* Cluster ID of this machine */ @@ -69,7 +69,7 @@ struct clog_tfr { int dm_clog_tfr_init(void); void dm_clog_tfr_exit(void); -int dm_clog_consult_server(const char *uuid, uint32_t uuid_instance, +int dm_clog_consult_server(const char *uuid, uint64_t luid, int request_type, char *data, int data_size, char *rdata, int *rdata_size); diff --git a/cmirror-kernel/src/dm-clog.c b/cmirror-kernel/src/dm-clog.c index 17e7486..44e2ee8 100644 --- a/cmirror-kernel/src/dm-clog.c +++ b/cmirror-kernel/src/dm-clog.c @@ -24,7 +24,7 @@ struct log_c { uint32_t region_size; region_t region_count; char uuid[DM_UUID_LEN]; - uint32_t uuid_instance; + uint32_t luid; char *ctr_str; /* Gives ability to restart if userspace dies */ uint32_t ctr_size; @@ -44,8 +44,6 @@ struct log_c { struct dm_dev *disk_log; }; -static struct list_head log_list_head; -static spinlock_t log_list_lock; static mempool_t *flush_entry_pool = NULL; static void *flush_entry_alloc(gfp_t gfp_mask, void *pool_data) @@ -69,7 +67,7 @@ int cluster_do_request(struct log_c *lc, const char *uuid, int request_type, * restored. */ retry: - r = dm_clog_consult_server(uuid, lc->uuid_instance, request_type, data, + r = dm_clog_consult_server(uuid, lc->luid, request_type, data, data_size, rdata, rdata_size); if (r != -ESRCH) @@ -80,14 +78,14 @@ retry: set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(2*HZ); DMWARN("Attempting to contact cluster log server..."); - r = dm_clog_consult_server(uuid, lc->uuid_instance, + r = dm_clog_consult_server(uuid, lc->luid, DM_CLOG_CTR, lc->ctr_str, lc->ctr_size, NULL, NULL); if (!r) break; } DMINFO("Reconnected to cluster log server... CTR complete"); - r = dm_clog_consult_server(uuid, lc->uuid_instance, + r = dm_clog_consult_server(uuid, lc->luid, DM_CLOG_RESUME, NULL, 0, NULL, NULL); if (!r) @@ -136,15 +134,7 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti, spin_lock_init(&lc->flush_lock); INIT_LIST_HEAD(&lc->flush_list); - lc->uuid_instance = 1; - spin_lock(&log_list_lock); - list_for_each_entry(tmp, &log_list_head, list) - if (!strncmp(tmp->uuid, lc->uuid, DM_UUID_LEN) && - (tmp->uuid_instance >= lc->uuid_instance)) - lc->uuid_instance = tmp->uuid_instance + 1; - list_add(&lc->list, &log_list_head); - spin_unlock(&log_list_lock); - + lc->luid = (uint64_t)lc; for (i = 0, str_size = 0; i < argc; i++) str_size += strlen(argv[i]) + 1; /* +1 for space between args */ @@ -162,7 +152,7 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti, str_size += sprintf(ctr_str + str_size, "%llu", ti->len); /* Send table string */ - r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, DM_CLOG_CTR, + r = dm_clog_consult_server(lc->uuid, lc->luid, DM_CLOG_CTR, ctr_str, str_size, NULL, NULL); if (r == -ESRCH) @@ -258,15 +248,11 @@ static void cluster_dtr(struct dm_dirty_log *log) int r; struct log_c *lc = (struct log_c *)log->context; - r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, DM_CLOG_DTR, + r = dm_clog_consult_server(lc->uuid, lc->luid, DM_CLOG_DTR, NULL, 0, NULL, NULL); /* FIXME: What do we do on failure? */ - - spin_lock(&log_list_lock); - list_del(&lc->list); - spin_unlock(&log_list_lock); if (lc->disk_log) dm_put_device(lc->ti, lc->disk_log); kfree(lc->ctr_str); @@ -284,7 +270,7 @@ static int cluster_presuspend(struct dm_dirty_log *log) int r; struct log_c *lc = (struct log_c *)log->context; - r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, + r = dm_clog_consult_server(lc->uuid, lc->luid, DM_CLOG_PRESUSPEND, NULL, 0, NULL, NULL); @@ -301,7 +287,7 @@ static int cluster_postsuspend(struct dm_dirty_log *log) int r; struct log_c *lc = (struct log_c *)log->context; - r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, + r = dm_clog_consult_server(lc->uuid, lc->luid, DM_CLOG_POSTSUSPEND, NULL, 0, NULL, NULL); @@ -319,7 +305,7 @@ static int cluster_resume(struct dm_dirty_log *log) struct log_c *lc = (struct log_c *)log->context; lc->in_sync_hint = 0; - r = dm_clog_consult_server(lc->uuid, lc->uuid_instance, DM_CLOG_RESUME, + r = dm_clog_consult_server(lc->uuid, lc->luid, DM_CLOG_RESUME, NULL, 0, NULL, NULL); diff --git a/cmirror/src/cluster.c b/cmirror/src/cluster.c index 1ecef33..70acbbd 100644 --- a/cmirror/src/cluster.c +++ b/cmirror/src/cluster.c @@ -82,7 +82,7 @@ static int log_resp_rec = 0; struct checkpoint_data { uint32_t requester; char uuid[CPG_MAX_NAME_LENGTH]; - uint32_t uuid_instance; + uint64_t luid; int bitmap_size; /* in bytes */ char *sync_bits; @@ -102,7 +102,7 @@ struct clog_cpg { uint32_t lowest_id; cpg_handle_t handle; struct cpg_name name; - uint32_t uuid_instance; + uint64_t luid; /* Are we the first, or have we received checkpoint? */ int state; @@ -147,10 +147,10 @@ int cluster_send(struct clog_tfr *tfr) } /* - * uuid_instance is only valid per machine, it looses its meaning + * luid is only valid per machine, it looses its meaning * when sent to the cluster. */ - tfr->uuid_instance = 0; + tfr->luid = 0; iov.iov_base = tfr; iov.iov_len = sizeof(struct clog_tfr) + tfr->data_size; @@ -357,9 +357,9 @@ static struct checkpoint_data *prepare_checkpoint(struct clog_cpg *entry, memset(new, 0, sizeof(*new)); new->requester = cp_requester; strncpy(new->uuid, entry->name.value, entry->name.length); - new->uuid_instance = entry->uuid_instance; + new->luid = entry->luid; - new->bitmap_size = push_state(entry->name.value, entry->uuid_instance, + new->bitmap_size = push_state(entry->name.value, entry->luid, "clean_bits", &new->clean_bits, cp_requester); if (new->bitmap_size <= 0) { @@ -369,7 +369,7 @@ static struct checkpoint_data *prepare_checkpoint(struct clog_cpg *entry, return NULL; } - new->bitmap_size = push_state(entry->name.value, entry->uuid_instance, + new->bitmap_size = push_state(entry->name.value, entry->luid, "sync_bits", &new->sync_bits, cp_requester); if (new->bitmap_size <= 0) { LOG_ERROR("Failed to store sync_bits to checkpoint for node %u", @@ -379,7 +379,7 @@ static struct checkpoint_data *prepare_checkpoint(struct clog_cpg *entry, return NULL; } - r = push_state(entry->name.value, entry->uuid_instance, + r = push_state(entry->name.value, entry->luid, "recovering_region", &new->recovering_region, cp_requester); if (r <= 0) { @@ -708,7 +708,7 @@ init_retry: } if (iov.readSize) { - if (pull_state(entry->name.value, entry->uuid_instance, + if (pull_state(entry->name.value, entry->luid, (char *)desc.sectionId.id, bitmap, iov.readSize)) { LOG_ERROR("Error loading state"); @@ -1241,7 +1241,7 @@ static void cpg_leave_callback(struct clog_cpg *match, cpg_fd_get(match->handle, &fd); links_unregister(fd); - cluster_postsuspend(match->name.value, match->uuid_instance); + cluster_postsuspend(match->name.value, match->luid); list_for_each_safe(p, n, &match->working_list) { list_del_init(p); @@ -1446,7 +1446,7 @@ unlink_retry: return 1; } -int create_cluster_cpg(char *uuid, uint32_t uuid_instance) +int create_cluster_cpg(char *uuid, uint64_t luid) { int r; int size; @@ -1474,7 +1474,7 @@ int create_cluster_cpg(char *uuid, uint32_t uuid_instance) CPG_MAX_NAME_LENGTH : (strlen(uuid) + 1); strncpy(new->name.value, uuid, size); new->name.length = size; - new->uuid_instance = uuid_instance; + new->luid = luid; /* * Ensure there are no stale checkpoints around before we join diff --git a/cmirror/src/cluster.h b/cmirror/src/cluster.h index 176024b..891ce72 100644 --- a/cmirror/src/cluster.h +++ b/cmirror/src/cluster.h @@ -5,7 +5,7 @@ int init_cluster(void); void cleanup_cluster(void); void cluster_debug(void); -int create_cluster_cpg(char *uuid, uint32_t uuid_instance); +int create_cluster_cpg(char *uuid, uint64_t luid); int destroy_cluster_cpg(char *str); int cluster_send(struct clog_tfr *tfr); diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c index f7270a6..44c208b 100644 --- a/cmirror/src/functions.c +++ b/cmirror/src/functions.c @@ -49,7 +49,7 @@ struct log_c { struct list_head list; char uuid[DM_UUID_LEN]; - uint32_t uuid_instance; + uint64_t luid; time_t delay; /* limits how fast a resume can happen after suspend */ int touched; @@ -148,7 +148,7 @@ static uint64_t count_bits32(uint32_t *addr, uint32_t count) * * Returns: log if found, NULL otherwise */ -static struct log_c *get_log(const char *uuid, uint32_t uuid_instance) +static struct log_c *get_log(const char *uuid, uint64_t luid) { struct list_head *l; struct log_c *lc; @@ -157,8 +157,7 @@ static struct log_c *get_log(const char *uuid, uint32_t uuid_instance) __list_for_each(l, &log_list) { lc = list_entry(l, struct log_c, list); if (!strcmp(lc->uuid, uuid) && - (!uuid_instance || - (lc->uuid_instance == uuid_instance))) + (!luid || (lc->luid == luid))) return lc; } @@ -174,7 +173,7 @@ static struct log_c *get_log(const char *uuid, uint32_t uuid_instance) * * Returns: log if found, NULL otherwise */ -static struct log_c *get_pending_log(const char *uuid, uint32_t uuid_instance) +static struct log_c *get_pending_log(const char *uuid, uint64_t luid) { struct list_head *l; struct log_c *lc; @@ -183,8 +182,7 @@ static struct log_c *get_pending_log(const char *uuid, uint32_t uuid_instance) __list_for_each(l, &log_pending_list) { lc = list_entry(l, struct log_c, list); if (!strcmp(lc->uuid, uuid) && - (!uuid_instance || - (lc->uuid_instance == uuid_instance))) + (!luid || (lc->luid == luid))) return lc; } @@ -350,7 +348,7 @@ static int find_disk_path(char *major_minor_str, char *path_rtn, int *unlink_pat return r ? -errno : 0; } -static int _clog_ctr(int argc, char **argv, uint32_t uuid_instance, +static int _clog_ctr(int argc, char **argv, uint64_t luid, uint64_t device_size) { int i; @@ -441,20 +439,20 @@ static int _clog_ctr(int argc, char **argv, uint32_t uuid_instance, lc->disk_fd = -1; lc->log_dev_failed = 0; strncpy(lc->uuid, argv[1 + disk_log], DM_UUID_LEN); - lc->uuid_instance = uuid_instance; + lc->luid = luid; - if ((dup = get_log(lc->uuid, lc->uuid_instance))) { - LOG_ERROR("Duplicate log UUID and uuid_instance!"); + if ((dup = get_log(lc->uuid, lc->luid))) { + LOG_ERROR("Duplicate log UUID and luid!"); LOG_ERROR("UUID: %s", lc->uuid); - LOG_ERROR("uuid_instance: %u", lc->uuid_instance); + LOG_ERROR("luid: %u", lc->luid); free(lc); return -EINVAL; } - if ((dup = get_pending_log(lc->uuid, lc->uuid_instance))) { - LOG_ERROR("Duplicate pending log UUID and uuid_instance!"); + if ((dup = get_pending_log(lc->uuid, lc->luid))) { + LOG_ERROR("Duplicate pending log UUID and luid!"); LOG_ERROR("UUID: %s", lc->uuid); - LOG_ERROR("uuid_instance: %u", lc->uuid_instance); + LOG_ERROR("luid: %u", lc->luid); free(lc); return -EINVAL; } @@ -583,7 +581,7 @@ static int clog_ctr(struct clog_tfr *tfr) } argc--; /* We pass in the device_size separate */ - r = _clog_ctr(argc, argv, tfr->uuid_instance, device_size); + r = _clog_ctr(argc, argv, tfr->luid, device_size); /* We join the CPG when we resume */ @@ -608,7 +606,7 @@ static int clog_ctr(struct clog_tfr *tfr) */ static int clog_dtr(struct clog_tfr *tfr) { - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (lc) { /* @@ -618,7 +616,7 @@ static int clog_dtr(struct clog_tfr *tfr) LOG_ERROR("[%s] DTR before SUS: leaving CPG", SHORT_UUID(tfr->uuid)); destroy_cluster_cpg(tfr->uuid); - } else if (!(lc = get_pending_log(tfr->uuid, tfr->uuid_instance))) { + } else if (!(lc = get_pending_log(tfr->uuid, tfr->luid))) { LOG_ERROR("clog_dtr called on log that is not official or pending"); return -EINVAL; } @@ -644,7 +642,7 @@ static int clog_dtr(struct clog_tfr *tfr) */ static int clog_presuspend(struct clog_tfr *tfr) { - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -664,7 +662,7 @@ static int clog_presuspend(struct clog_tfr *tfr) */ static int clog_postsuspend(struct clog_tfr *tfr) { - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -685,9 +683,9 @@ static int clog_postsuspend(struct clog_tfr *tfr) * @tfr * */ -int cluster_postsuspend(char *uuid, uint32_t uuid_instance) +int cluster_postsuspend(char *uuid, uint64_t luid) { - struct log_c *lc = get_log(uuid, uuid_instance); + struct log_c *lc = get_log(uuid, luid); if (!lc) return -EINVAL; @@ -712,7 +710,7 @@ static int clog_resume(struct clog_tfr *tfr) { uint32_t i; int commit_log = 0; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); size_t size = lc->bitset_uint32_count * sizeof(uint32_t); if (!lc) @@ -838,11 +836,11 @@ int local_resume(struct clog_tfr *tfr) { int r; time_t t; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) { /* Is the log in the pending list? */ - lc = get_pending_log(tfr->uuid, tfr->uuid_instance); + lc = get_pending_log(tfr->uuid, tfr->luid); if (!lc) { LOG_ERROR("clog_resume called on log that is not official or pending"); return -EINVAL; @@ -877,19 +875,19 @@ int local_resume(struct clog_tfr *tfr) sleep(3 - t); /* Join the CPG */ - r = create_cluster_cpg(tfr->uuid, tfr->uuid_instance); + r = create_cluster_cpg(tfr->uuid, tfr->luid); if (r) { LOG_ERROR("clog_resume: Failed to create cluster CPG"); return r; } - if (get_log(lc->uuid, lc->uuid_instance)) { + if (get_log(lc->uuid, lc->luid)) { /* * Not being able to identify a log uniquely is fatal, * and represents a programming error. */ LOG_ERROR("[%s/%u] DUPLICATE LOG WITH SAME UUID[_INSTANCE]!", - SHORT_UUID(lc->uuid), lc->uuid_instance); + SHORT_UUID(lc->uuid), lc->luid); exit(EXIT_FAILURE); } @@ -914,7 +912,7 @@ int local_resume(struct clog_tfr *tfr) static int clog_get_region_size(struct clog_tfr *tfr) { uint64_t *rtn = (uint64_t *)tfr->data; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); LOG_PRINT("WARNING: kernel should not be calling clog_get_region_size"); if (!lc) @@ -937,7 +935,7 @@ static int clog_is_clean(struct clog_tfr *tfr) { int *rtn = (int *)tfr->data; uint64_t region = *((uint64_t *)(tfr->data)); - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -962,7 +960,7 @@ static int clog_in_sync(struct clog_tfr *tfr) { int *rtn = (int *)tfr->data; uint64_t region = *((uint64_t *)(tfr->data)); - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -991,7 +989,7 @@ static int clog_in_sync(struct clog_tfr *tfr) static int clog_flush(struct clog_tfr *tfr, int server) { int r = 0; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -1079,7 +1077,7 @@ static int clog_mark_region(struct clog_tfr *tfr) int r; int count; uint64_t *region; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -1146,7 +1144,7 @@ static int clog_clear_region(struct clog_tfr *tfr) int r; int count; uint64_t *region; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -1182,7 +1180,7 @@ static int clog_get_resync_work(struct clog_tfr *tfr) uint32_t arch_padding; uint64_t r; } *pkg = (void *)tfr->data; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -1276,7 +1274,7 @@ static int clog_set_region_sync(struct clog_tfr *tfr) uint32_t arch_padding; int32_t in_sync; } *pkg = (void *)tfr->data; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -1355,7 +1353,7 @@ static int clog_set_region_sync(struct clog_tfr *tfr) static int clog_get_sync_count(struct clog_tfr *tfr) { uint64_t *sync_count = (uint64_t *)tfr->data; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); /* * FIXME: Mirror requires us to be able to ask for @@ -1364,7 +1362,7 @@ static int clog_get_sync_count(struct clog_tfr *tfr) * the stored value may not be accurate. */ if (!lc) - lc = get_pending_log(tfr->uuid, tfr->uuid_instance); + lc = get_pending_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -1423,10 +1421,10 @@ static int disk_status_info(struct log_c *lc, struct clog_tfr *tfr) static int clog_status_info(struct clog_tfr *tfr) { int r; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) - lc = get_pending_log(tfr->uuid, tfr->uuid_instance); + lc = get_pending_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -1482,10 +1480,10 @@ static int disk_status_table(struct log_c *lc, struct clog_tfr *tfr) static int clog_status_table(struct clog_tfr *tfr) { int r; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) - lc = get_pending_log(tfr->uuid, tfr->uuid_instance); + lc = get_pending_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -1511,7 +1509,7 @@ static int clog_is_remote_recovering(struct clog_tfr *tfr) uint32_t arch_padding; uint64_t in_sync_hint; } *pkg = (void *)tfr->data; - struct log_c *lc = get_log(tfr->uuid, tfr->uuid_instance); + struct log_c *lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; @@ -1692,7 +1690,7 @@ static void print_bits(char *buf, int size, int print) } /* int store_bits(const char *uuid, const char *which, char **buf)*/ -int push_state(const char *uuid, uint32_t uuid_instance, const char *which, +int push_state(const char *uuid, uint64_t luid, const char *which, char **buf, uint32_t debug_who) { int bitset_size; @@ -1701,7 +1699,7 @@ int push_state(const char *uuid, uint32_t uuid_instance, const char *which, if (*buf) LOG_ERROR("store_bits: *buf != NULL"); - lc = get_log(uuid, uuid_instance); + lc = get_log(uuid, luid); if (!lc) { LOG_ERROR("store_bits: No log found for %s", uuid); return -EINVAL; @@ -1747,7 +1745,7 @@ int push_state(const char *uuid, uint32_t uuid_instance, const char *which, } /*int load_bits(const char *uuid, const char *which, char *buf, int size)*/ -int pull_state(const char *uuid, uint32_t uuid_instance, +int pull_state(const char *uuid, uint64_t luid, const char *which, char *buf, int size) { int bitset_size; @@ -1756,7 +1754,7 @@ int pull_state(const char *uuid, uint32_t uuid_instance, if (!buf) LOG_ERROR("pull_state: buf == NULL"); - lc = get_log(uuid, uuid_instance); + lc = get_log(uuid, luid); if (!lc) { LOG_ERROR("pull_state: No log found for %s", uuid); return -EINVAL; @@ -1800,7 +1798,7 @@ int log_get_state(struct clog_tfr *tfr) { struct log_c *lc; - lc = get_log(tfr->uuid, tfr->uuid_instance); + lc = get_log(tfr->uuid, tfr->luid); if (!lc) return -EINVAL; diff --git a/cmirror/src/functions.h b/cmirror/src/functions.h index 63ed49a..55b41bb 100644 --- a/cmirror/src/functions.h +++ b/cmirror/src/functions.h @@ -10,9 +10,9 @@ int local_resume(struct clog_tfr *tfr); int cluster_postsuspend(char *, uint32_t); int do_request(struct clog_tfr *tfr, int server); -int push_state(const char *uuid, uint32_t uuid_instance, +int push_state(const char *uuid, uint64_t luid, const char *which, char **buf, uint32_t debug_who); -int pull_state(const char *uuid, uint32_t uuid_instance, +int pull_state(const char *uuid, uint64_t luid, const char *which, char *buf, int size); int log_get_state(struct clog_tfr *tfr); From rpeterso@fedoraproject.org Tue Aug 4 13:19:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Tue, 04 Aug 2009 13:19:00 -0000 Subject: cluster: RHEL5 - gfs2_tool man page incorrectly references gfs2_mount Message-ID: <20090804131850.989651201DE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a5692f3df1853c6a12fd97c12ddc67728be56951 Commit: a5692f3df1853c6a12fd97c12ddc67728be56951 Parent: 119d922b917b504b6eefe531289550333eed1ebd Author: Bob Peterson AuthorDate: Tue Aug 4 08:07:54 2009 -0500 Committer: Bob Peterson CommitterDate: Tue Aug 4 08:07:54 2009 -0500 gfs2_tool man page incorrectly references gfs2_mount bz 514939 --- gfs2/man/gfs2_tool.8 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gfs2/man/gfs2_tool.8 b/gfs2/man/gfs2_tool.8 index 6753427..249438f 100644 --- a/gfs2/man/gfs2_tool.8 +++ b/gfs2/man/gfs2_tool.8 @@ -64,7 +64,7 @@ filesystem. .\".TP .\"\fBmargs\fP \fIarguments\fR .\"This loads arguments into the module what will override the mount -.\"options passed with the -o field on the next mount. See gfs2_mount(8). +.\"options passed with the -o field on the next mount. See mount.gfs2(8). .\".TP .\"\fBquota\fP \fIMountPoint\fR .\"Print out the quota file of a mounted filesystem. Also see From rpeterso@fedoraproject.org Tue Aug 4 13:19:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Tue, 04 Aug 2009 13:19:00 -0000 Subject: cluster: STABLE2 - gfs2_tool man page incorrectly references gfs2_mount Message-ID: <20090804131911.021CF1201DE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=26464d4bc01f1ad37c4456e85cf0c2af73f71778 Commit: 26464d4bc01f1ad37c4456e85cf0c2af73f71778 Parent: a45ade0817c0e0169b612f70950d943ca7293985 Author: Bob Peterson AuthorDate: Tue Aug 4 08:07:54 2009 -0500 Committer: Bob Peterson CommitterDate: Tue Aug 4 08:08:46 2009 -0500 gfs2_tool man page incorrectly references gfs2_mount bz 514939 --- gfs2/man/gfs2_tool.8 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gfs2/man/gfs2_tool.8 b/gfs2/man/gfs2_tool.8 index a938a49..cdffee9 100644 --- a/gfs2/man/gfs2_tool.8 +++ b/gfs2/man/gfs2_tool.8 @@ -61,7 +61,7 @@ filesystem. .\".TP .\"\fBmargs\fP \fIarguments\fR .\"This loads arguments into the module what will override the mount -.\"options passed with the -o field on the next mount. See gfs2_mount(8). +.\"options passed with the -o field on the next mount. See mount.gfs2(8). .\".TP .\"\fBquota\fP \fIMountPoint\fR .\"Print out the quota file of a mounted filesystem. Also see From jbrassow@fedoraproject.org Tue Aug 4 21:33:00 2009 From: jbrassow@fedoraproject.org (Jonathan Brassow) Date: Tue, 04 Aug 2009 21:33:00 -0000 Subject: cluster: RHEL5 - clogd: Minor clean-ups to last check-in Message-ID: <20090804213309.BBEAE1201DE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=527b0880da57f43b3b617e95119c0ad2f7328477 Commit: 527b0880da57f43b3b617e95119c0ad2f7328477 Parent: a5692f3df1853c6a12fd97c12ddc67728be56951 Author: Jonathan Brassow AuthorDate: Tue Aug 4 16:25:59 2009 -0500 Committer: Jonathan Brassow CommitterDate: Tue Aug 4 16:32:16 2009 -0500 clogd: Minor clean-ups to last check-in Pull unused variables and clean-up some messages. --- cmirror-kernel/src/dm-clog.c | 5 +---- cmirror/src/functions.c | 11 ++++++----- cmirror/src/functions.h | 2 +- cmirror/src/local.c | 3 ++- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cmirror-kernel/src/dm-clog.c b/cmirror-kernel/src/dm-clog.c index 44e2ee8..e23b687 100644 --- a/cmirror-kernel/src/dm-clog.c +++ b/cmirror-kernel/src/dm-clog.c @@ -105,7 +105,7 @@ static int cluster_ctr(struct dm_dirty_log *log, struct dm_target *ti, int str_size; int offset = (disk_log) ? 1 : 0; char *ctr_str = NULL; - struct log_c *lc = NULL, *tmp; + struct log_c *lc = NULL; uint32_t region_size; region_t region_count; @@ -754,9 +754,6 @@ static int __init cluster_dirty_log_init(void) { int r = 0; - INIT_LIST_HEAD(&log_list_head); - spin_lock_init(&log_list_lock); - flush_entry_pool = mempool_create(100, flush_entry_alloc, flush_entry_free, NULL); diff --git a/cmirror/src/functions.c b/cmirror/src/functions.c index 44c208b..f87d175 100644 --- a/cmirror/src/functions.c +++ b/cmirror/src/functions.c @@ -444,7 +444,7 @@ static int _clog_ctr(int argc, char **argv, uint64_t luid, if ((dup = get_log(lc->uuid, lc->luid))) { LOG_ERROR("Duplicate log UUID and luid!"); LOG_ERROR("UUID: %s", lc->uuid); - LOG_ERROR("luid: %u", lc->luid); + LOG_ERROR("luid: %"PRIu64, lc->luid); free(lc); return -EINVAL; } @@ -452,7 +452,7 @@ static int _clog_ctr(int argc, char **argv, uint64_t luid, if ((dup = get_pending_log(lc->uuid, lc->luid))) { LOG_ERROR("Duplicate pending log UUID and luid!"); LOG_ERROR("UUID: %s", lc->uuid); - LOG_ERROR("luid: %u", lc->luid); + LOG_ERROR("luid: %"PRIu64, lc->luid); free(lc); return -EINVAL; } @@ -886,7 +886,7 @@ int local_resume(struct clog_tfr *tfr) * Not being able to identify a log uniquely is fatal, * and represents a programming error. */ - LOG_ERROR("[%s/%u] DUPLICATE LOG WITH SAME UUID[_INSTANCE]!", + LOG_ERROR("[%s/%"PRIu64"] DUPLICATE LOG WITH SAME UUID[_INSTANCE]!", SHORT_UUID(lc->uuid), lc->luid); exit(EXIT_FAILURE); } @@ -1731,16 +1731,17 @@ int push_state(const char *uuid, uint64_t luid, const char *which, if (!strncmp(which, "sync_bits", 9)) { memcpy(*buf, lc->sync_bits, bitset_size); - LOG_DBG("[%s] storing sync_bits (sync_count = %llu):", + LOG_ERROR("[%s] storing sync_bits (sync_count = %llu):", SHORT_UUID(uuid), (unsigned long long) count_bits32(lc->sync_bits, lc->bitset_uint32_count)); print_bits(*buf, bitset_size, 0); } else if (!strncmp(which, "clean_bits", 9)) { memcpy(*buf, lc->clean_bits, bitset_size); - LOG_DBG("[%s] storing clean_bits:", SHORT_UUID(lc->uuid)); + LOG_ERROR("[%s] storing clean_bits:", SHORT_UUID(lc->uuid)); print_bits(*buf, bitset_size, 0); } + LOG_ERROR("bitset_size = %d", bitset_size); return bitset_size; } diff --git a/cmirror/src/functions.h b/cmirror/src/functions.h index 55b41bb..dee442c 100644 --- a/cmirror/src/functions.h +++ b/cmirror/src/functions.h @@ -7,7 +7,7 @@ #define LOG_SUSPENDED 2 int local_resume(struct clog_tfr *tfr); -int cluster_postsuspend(char *, uint32_t); +int cluster_postsuspend(char *, uint64_t); int do_request(struct clog_tfr *tfr, int server); int push_state(const char *uuid, uint64_t luid, diff --git a/cmirror/src/local.c b/cmirror/src/local.c index cf64855..50fb245 100644 --- a/cmirror/src/local.c +++ b/cmirror/src/local.c @@ -262,7 +262,8 @@ static int do_local_work(void *data) break; case DM_CLOG_GET_REGION_SIZE: default: - LOG_ERROR("Invalid log request received, ignoring."); + LOG_ERROR("Invalid log request (0x%x) received, ignoring.", + tfr->request_type); return 0; } From rpeterso@fedoraproject.org Tue Aug 4 22:06:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Tue, 04 Aug 2009 22:06:00 -0000 Subject: gfs2-utils: master - GFS2: gfs2_fsck segfault in rindex repair code Message-ID: <20090804220604.838F11201DE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=15e280c0799675d86ec33dcf5839b9f758ba90f9 Commit: 15e280c0799675d86ec33dcf5839b9f758ba90f9 Parent: efd003c0a4c772424b553d90c8afaa964ee13d6e Author: Bob Peterson AuthorDate: Tue Aug 4 17:00:16 2009 -0500 Committer: Bob Peterson CommitterDate: Tue Aug 4 17:02:38 2009 -0500 GFS2: gfs2_fsck segfault in rindex repair code bz 514018 --- gfs2/fsck/rgrepair.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c index 0aa20d4..64271cd 100644 --- a/gfs2/fsck/rgrepair.c +++ b/gfs2/fsck/rgrepair.c @@ -371,6 +371,11 @@ static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, osi_list_t *ret_list, /* ----------------------------------------------------------------- */ *num_rgs = sdp->md.riinode->i_di.di_size / sizeof(struct gfs2_rindex); log_warn( _("L2: number of rgs in the index = %d.\n"), *num_rgs); + /* Move the rg list to the return list */ + ret_list->next = sdp->rglist.next; + ret_list->prev = sdp->rglist.prev; + ret_list->next->prev = ret_list; + ret_list->prev->next = ret_list; return 0; } @@ -541,12 +546,11 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count) free(actual->bh); if (actual->bits) free(actual->bits); - gfs2_compute_bitstructs(sdp, actual); } else log_err( _("RG index not fixed.\n")); + gfs2_compute_bitstructs(sdp, actual); rindex_modified = FALSE; - } } /* ------------------------------------------------------------- */ From rpeterso@fedoraproject.org Tue Aug 4 22:07:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Tue, 04 Aug 2009 22:07:00 -0000 Subject: cluster: STABLE3 - GFS2: gfs2_fsck segfault in rindex repair code Message-ID: <20090804220724.DDC941201DE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=212f926220e45c0366ba23dc4bb9e5306fcc21ad Commit: 212f926220e45c0366ba23dc4bb9e5306fcc21ad Parent: 4011cf6737f4155f8e4f277c10ce4fb568024a9c Author: Bob Peterson AuthorDate: Tue Aug 4 17:00:16 2009 -0500 Committer: Bob Peterson CommitterDate: Tue Aug 4 17:00:16 2009 -0500 GFS2: gfs2_fsck segfault in rindex repair code bz 514018 --- gfs2/fsck/rgrepair.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c index ca16ba5..d0b8f33 100644 --- a/gfs2/fsck/rgrepair.c +++ b/gfs2/fsck/rgrepair.c @@ -369,6 +369,11 @@ static int gfs2_rindex_calculate(struct gfs2_sbd *sdp, osi_list_t *ret_list, /* ----------------------------------------------------------------- */ *num_rgs = sdp->md.riinode->i_di.di_size / sizeof(struct gfs2_rindex); log_warn( _("L2: number of rgs in the index = %d.\n"), *num_rgs); + /* Move the rg list to the return list */ + ret_list->next = sdp->rglist.next; + ret_list->prev = sdp->rglist.prev; + ret_list->next->prev = ret_list; + ret_list->prev->next = ret_list; return 0; } @@ -539,12 +544,11 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count) free(actual->bh); if (actual->bits) free(actual->bits); - gfs2_compute_bitstructs(sdp, actual); } else log_err( _("RG index not fixed.\n")); + gfs2_compute_bitstructs(sdp, actual); rindex_modified = FALSE; - } } /* ------------------------------------------------------------- */ From rpeterso@fedoraproject.org Tue Aug 4 22:08:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Tue, 04 Aug 2009 22:08:00 -0000 Subject: cluster: STABLE2 - GFS2: gfs2_fsck segfault in rindex repair code Message-ID: <20090804220748.386001201DE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5dfd1c68fc5821ca877712dac998ce87e1e54b63 Commit: 5dfd1c68fc5821ca877712dac998ce87e1e54b63 Parent: 26464d4bc01f1ad37c4456e85cf0c2af73f71778 Author: Bob Peterson AuthorDate: Tue Aug 4 16:52:01 2009 -0500 Committer: Bob Peterson CommitterDate: Tue Aug 4 16:53:58 2009 -0500 GFS2: gfs2_fsck segfault in rindex repair code bz 514018 --- gfs2/fsck/rgrepair.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c index 599cae6..66b7a4e 100644 --- a/gfs2/fsck/rgrepair.c +++ b/gfs2/fsck/rgrepair.c @@ -356,6 +356,11 @@ int gfs2_rindex_calculate(struct gfs2_sbd *sdp, osi_list_t *ret_list, /* ----------------------------------------------------------------- */ *num_rgs = sdp->md.riinode->i_di.di_size / sizeof(struct gfs2_rindex); log_warn("L2: number of rgs in the index = %d.\n", *num_rgs); + /* Move the rg list to the return list */ + ret_list->next = sdp->rglist.next; + ret_list->prev = sdp->rglist.prev; + ret_list->next->prev = ret_list; + ret_list->prev->next = ret_list; return 0; } @@ -527,12 +532,11 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count) free(actual->bh); if (actual->bits) free(actual->bits); - gfs2_compute_bitstructs(sdp, actual); } else log_err("RG index not fixed.\n"); + gfs2_compute_bitstructs(sdp, actual); rindex_modified = FALSE; - } } /* ------------------------------------------------------------- */ From rpeterso@fedoraproject.org Tue Aug 4 22:10:00 2009 From: rpeterso@fedoraproject.org (Bob Peterson) Date: Tue, 04 Aug 2009 22:10:00 -0000 Subject: cluster: RHEL5 - GFS2: gfs2_fsck segfault in rindex repair code Message-ID: <20090804220951.CEB531201DE@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8d43d79122b0a220707af527ecef67e1bd21bf26 Commit: 8d43d79122b0a220707af527ecef67e1bd21bf26 Parent: 527b0880da57f43b3b617e95119c0ad2f7328477 Author: Bob Peterson AuthorDate: Tue Aug 4 16:52:01 2009 -0500 Committer: Bob Peterson CommitterDate: Tue Aug 4 17:13:14 2009 -0500 GFS2: gfs2_fsck segfault in rindex repair code bz 514018 --- gfs2/fsck/rgrepair.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gfs2/fsck/rgrepair.c b/gfs2/fsck/rgrepair.c index 003e9ff..e11b72b 100644 --- a/gfs2/fsck/rgrepair.c +++ b/gfs2/fsck/rgrepair.c @@ -369,6 +369,11 @@ int gfs2_rindex_calculate(struct gfs2_sbd *sdp, osi_list_t *ret_list, /* ----------------------------------------------------------------- */ *num_rgs = sdp->md.riinode->i_di.di_size / sizeof(struct gfs2_rindex); log_warn("L2: number of rgs in the index = %d.\n", *num_rgs); + /* Move the rg list to the return list */ + ret_list->next = sdp->rglist.next; + ret_list->prev = sdp->rglist.prev; + ret_list->next->prev = ret_list; + ret_list->prev->next = ret_list; return 0; } @@ -540,12 +545,11 @@ int rg_repair(struct gfs2_sbd *sdp, int trust_lvl, int *rg_count) free(actual->bh); if (actual->bits) free(actual->bits); - gfs2_compute_bitstructs(sdp, actual); } else log_err("RG index not fixed.\n"); + gfs2_compute_bitstructs(sdp, actual); rindex_modified = FALSE; - } } /* ------------------------------------------------------------- */ From marx@fedoraproject.org Wed Aug 5 10:11:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Wed, 05 Aug 2009 10:11:00 -0000 Subject: cluster: RHEL54 - fencing: #493802 - Providing support for ssh enabled RSA II fence devices Message-ID: <20090805101037.3671E120355@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=5afd2776b87869189497eb722fe631de60cd09c1 Commit: 5afd2776b87869189497eb722fe631de60cd09c1 Parent: cc5e4640d9005fd17c347ecca94986653e205891 Author: Marek 'marx' Grac AuthorDate: Wed Aug 5 12:06:17 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Wed Aug 5 12:06:17 2009 +0200 fencing: #493802 - Providing support for ssh enabled RSA II fence devices Fixing differencies between branches. --- fence/agents/rsa/fence_rsa.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index 487758a..dab51c1 100755 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -58,7 +58,7 @@ def main(): ## Operate the fencing device ###### conn = fence_login(options) - fence_action(conn, options, set_power_status, get_power_status, None) + fence_action(conn, options, set_power_status, get_power_status) ## ## Logout from system From marx@fedoraproject.org Wed Aug 5 10:12:00 2009 From: marx@fedoraproject.org (=?utf-8?q?Marek_Gr=C3=A1c?=) Date: Wed, 05 Aug 2009 10:12:00 -0000 Subject: cluster: RHEL5 - fencing: #493802 - Providing support for ssh enabled RSA II fence devices Message-ID: <20090805101133.A80C1120355@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8bae5c5c8121dea9bd80382851020d17be3d8552 Commit: 8bae5c5c8121dea9bd80382851020d17be3d8552 Parent: 8d43d79122b0a220707af527ecef67e1bd21bf26 Author: Marek 'marx' Grac AuthorDate: Wed Aug 5 12:06:17 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Wed Aug 5 12:07:27 2009 +0200 fencing: #493802 - Providing support for ssh enabled RSA II fence devices Fixing differencies between branches. --- fence/agents/rsa/fence_rsa.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fence/agents/rsa/fence_rsa.py b/fence/agents/rsa/fence_rsa.py index 9ef8664..6b80653 100755 --- a/fence/agents/rsa/fence_rsa.py +++ b/fence/agents/rsa/fence_rsa.py @@ -58,7 +58,7 @@ def main(): ## Operate the fencing device ###### conn = fence_login(options) - fence_action(conn, options, set_power_status, get_power_status, None) + fence_action(conn, options, set_power_status, get_power_status) ## ## Logout from system From chrissie@fedoraproject.org Wed Aug 5 13:05:00 2009 From: chrissie@fedoraproject.org (Christine Caulfield) Date: Wed, 05 Aug 2009 13:05:00 -0000 Subject: cluster: STABLE3 - cman: Tidy the shutdown code. Message-ID: <20090805130511.6F656120197@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a0b7e5fc2d35021b5617cece6b959859efdfaba6 Commit: a0b7e5fc2d35021b5617cece6b959859efdfaba6 Parent: 212f926220e45c0366ba23dc4bb9e5306fcc21ad Author: Christine Caulfield AuthorDate: Wed Aug 5 14:04:41 2009 +0100 Committer: Christine Caulfield CommitterDate: Wed Aug 5 14:04:41 2009 +0100 cman: Tidy the shutdown code. Remove some duplicate code Signed-off-by: Christine Caulfield --- cman/daemon/commands.c | 14 +++++--------- 1 files changed, 5 insertions(+), 9 deletions(-) diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c index b7f7293..f31f47d 100644 --- a/cman/daemon/commands.c +++ b/cman/daemon/commands.c @@ -993,7 +993,8 @@ static void check_shutdown_status(void) /* All replies safely gathered in ? */ if (shutdown_yes + shutdown_no >= shutdown_expected) { - corosync->timer_delete(shutdown_timer); + if (shutdown_timer) + corosync->timer_delete(shutdown_timer); if (shutdown_yes >= shutdown_expected || shutdown_flags & SHUTDOWN_ANYWAY) { @@ -1071,14 +1072,8 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf) /* If no-one is listening for events then we can just go down now */ if (shutdown_expected == 0) { - int leaveflags = CLUSTER_LEAVEFLAG_DOWN; - - quit_threads = 1; - if (shutdown_flags & SHUTDOWN_REMOVE) - leaveflags |= CLUSTER_LEAVEFLAG_REMOVED; - - send_leave(leaveflags); - return 0; + shutdown_timer = 0; + check_shutdown_status(); } else { @@ -1091,6 +1086,7 @@ static int do_cmd_try_shutdown(struct connection *con, char *cmdbuf) return -EWOULDBLOCK; } + return 0; } static int do_cmd_register_quorum_device(char *cmdbuf, int *retlen) From teigland@fedoraproject.org Wed Aug 5 19:12:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Wed, 05 Aug 2009 19:12:00 -0000 Subject: cluster: RHEL48 - dlm-kernel: ignore unlock reply of zero Message-ID: <20090805191216.90FF612028E@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=46d20cd6ace7ed9e35507ac823aa41999271b954 Commit: 46d20cd6ace7ed9e35507ac823aa41999271b954 Parent: ceb646b1850c6a3f45fdebd62af2e18122a58db9 Author: David Teigland AuthorDate: Mon Apr 20 16:37:45 2009 -0500 Committer: David Teigland CommitterDate: Wed Aug 5 14:02:35 2009 -0500 dlm-kernel: ignore unlock reply of zero bz 495600 Studying bug 349001 and the patch for it seems to leave a small window for the same problem to occur. The symptoms seem consistent and it's the only possibility I can come up with. The problem that commit c92628dcc39e03a4e9eccc4fa76257c871e5ba00 aims to fix is a grant message followed by a convert reply message for the same lock. I think the following sequence of events could still cause that to happen, even though the patch closes the window most of the way. dlm_recv thread 1. receive convert -- process_cluster_request/GDLM_REMCMD_CONVREQUEST 2. lkb->lkb_request = freq 3. dlm_convert_stage2() 4. lkb can't be granted immediately, so it's put on the convert queue 6. if (lkb->lkb_request != NULL) 9. send convert reply other thread 5. unlocks another lkb, finds lkb above can be granted, calls remote_grant() 7. lkb->lkb_request = NULL 8. send grant message remote_grant() is supposed to prevent the convert reply from being sent at all by setting lkb_request = NULL. But, given the right race it doesn't work and both grant and convert reply messages are sent (and sent in the bad order). This isn't a general fix for the problem, but an additional work around. We check right away upon getting a reply (before doing anything) whether it's an unlock reply with status of 0, which shouldn't happen. If it is, we ignore the reply (which the previous work-around on the sender side failed to prevent.) Currently, we recognize this "condition which shouldn't happen" after we've made changes (removed the lkb from the queue), making it too late to avoid disrupting the proper handling of the real unlock reply. This just moves the check to earlier, where we can really effectively ignore the reply. Also, add more info to the process_lockqueue_reply state 0 message to help understand more about the cause. Signed-off-by: David Teigland --- dlm-kernel/src/dlm_internal.h | 3 ++- dlm-kernel/src/lockqueue.c | 22 ++++++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/dlm-kernel/src/dlm_internal.h b/dlm-kernel/src/dlm_internal.h index ff83a65..3400ee7 100644 --- a/dlm-kernel/src/dlm_internal.h +++ b/dlm-kernel/src/dlm_internal.h @@ -416,7 +416,8 @@ struct dlm_lkb { struct list_head lkb_lockqueue; /* queue of locks waiting for remote reply */ - int lkb_lockqueue_state; /* reason on lockqueue */ + int16_t lkb_lockqueue_state; /* reason on lockqueue */ + int16_t lkb_prev_lq_state; uint32_t lkb_lockqueue_flags; /* as passed into lock/unlock */ int lkb_ownpid; /* pid of lock owner */ diff --git a/dlm-kernel/src/lockqueue.c b/dlm-kernel/src/lockqueue.c index b996e3a..d203e16 100644 --- a/dlm-kernel/src/lockqueue.c +++ b/dlm-kernel/src/lockqueue.c @@ -326,8 +326,19 @@ static void process_lockqueue_reply(struct dlm_lkb *lkb, struct dlm_ls *ls = rsb->res_ls; int oldstate, state = lkb->lkb_lockqueue_state; - if (state) + /* hack to work around bug + https://bugzilla.redhat.com/show_bug.cgi?id=495600 */ + + if (state == GDLM_LQSTATE_WAIT_UNLOCK && reply->rl_status == 0) { + log_error(ls, "ignore zero unlock reply from %d %x %s", + nodeid, lkb->lkb_id, lkb->lkb_resource->res_name); + return; + } + + if (state) { remove_from_lockqueue(lkb); + lkb->lkb_prev_lq_state = state; + } switch (state) { case GDLM_LQSTATE_WAIT_RSB: @@ -565,14 +576,17 @@ static void process_lockqueue_reply(struct dlm_lkb *lkb, print_lkb(lkb);); queue_ast(lkb, AST_COMP | AST_DEL, 0); } else { - log_error(ls, "cancel reply ret %d", reply->rl_status); + /* should not get here due to hack at top */ + log_error(ls, "cancel reply ret %d %x", + reply->rl_status, lkb->lkb_id); queue_ast(lkb, AST_COMP, 0); } break; default: - log_error(ls, "process_lockqueue_reply id %x state %d", - lkb->lkb_id, state); + log_error(ls, "process_lockqueue_reply id %x state %d %d %d %d", + lkb->lkb_id, state, lkb->lkb_prev_lq_state, + reply->rl_status, lkb->lkb_retstatus); } } From teigland@fedoraproject.org Thu Aug 6 16:58:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Thu, 06 Aug 2009 16:58:00 -0000 Subject: cluster: STABLE3 - cman: wait for quorum Message-ID: <20090806165837.94F7512019B@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1bfe888048a09b324e7dd65b5d6c125530409327 Commit: 1bfe888048a09b324e7dd65b5d6c125530409327 Parent: a0b7e5fc2d35021b5617cece6b959859efdfaba6 Author: David Teigland AuthorDate: Thu Aug 6 11:13:57 2009 -0500 Committer: David Teigland CommitterDate: Thu Aug 6 11:13:57 2009 -0500 cman: wait for quorum Wait for quorum when starting. https://www.redhat.com/archives/cluster-devel/2009-August/msg00006.html Signed-off-by: David Teigland --- cman/init.d/cman.in | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-) diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in index 6481d6b..ff140fc 100644 --- a/cman/init.d/cman.in +++ b/cman/init.d/cman.in @@ -68,13 +68,13 @@ fi # a cluster is not joined. If CMAN_CLUSTER_TIMEOUT is zero, then # wait indefinately for a cluster join. If CMAN_CLUSTER_TIMEOUT is # negative, do not check to see that the cluster has been joined -[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=120 +[ -z "$CMAN_CLUSTER_TIMEOUT" ] && CMAN_CLUSTER_TIMEOUT=60 # CMAN_QUORUM_TIMEOUT -- amount of time to wait for a quorate cluster on # startup quorum is needed by many other applications, so we may as -# well wait here. If CMAN_QUORUM_TIMEOUT is less than 1, quorum will +# well wait here. If CMAN_QUORUM_TIMEOUT is zero, quorum will # be ignored. -[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=0 +[ -z "$CMAN_QUORUM_TIMEOUT" ] && CMAN_QUORUM_TIMEOUT=20 # CMAN_SHUTDOWN_TIMEOUT -- amount of time to wait for cman to become a # cluster member before calling cman_tool leave during shutdown. @@ -490,6 +490,14 @@ start_cman() fi } +wait_for_quorum() +{ + if [ $CMAN_QUORUM_TIMEOUT -gt 0 ]; then + errmsg=$( cman_tool -t $CMAN_QUORUM_TIMEOUT \ + -q wait 2>&1 ) || return 1 + fi +} + stop_cman() { if cman_running; then @@ -678,6 +686,10 @@ start() qdiskd_enabled \ "Starting qdiskd" + runwrap wait_for_quorum \ + none \ + "Waiting for quorum" + runwrap start_groupd \ groupd_enabled \ "Starting groupd" From teigland@fedoraproject.org Thu Aug 6 20:21:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Thu, 06 Aug 2009 20:21:00 -0000 Subject: cluster: STABLE3 - cluster.rng: add stuff Message-ID: <20090806202048.3EC1E12019B@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=bb95419abc7e444af61e2c821a62a8832d275145 Commit: bb95419abc7e444af61e2c821a62a8832d275145 Parent: 2a95cd1d40bab8ef5966febda4566f3b80fe0bd3 Author: David Teigland AuthorDate: Thu Aug 6 15:10:39 2009 -0500 Committer: David Teigland CommitterDate: Thu Aug 6 15:10:39 2009 -0500 cluster.rng: add stuff add missing cman attributes, add descriptions for logging Signed-off-by: David Teigland --- config/tools/xml/cluster.rng | 55 +++++++++++++++++++++++++++-------------- 1 files changed, 36 insertions(+), 19 deletions(-) diff --git a/config/tools/xml/cluster.rng b/config/tools/xml/cluster.rng index f7ad55f..318afd6 100644 --- a/config/tools/xml/cluster.rng +++ b/config/tools/xml/cluster.rng @@ -112,7 +112,10 @@ To validate your cluster.conf against this schema, run: - + + + + - + @@ -579,51 +583,64 @@ To validate your cluster.conf against this schema, run: - + - + - + - + - + - + - + - + - - + + + + + - + - + - + - + - + - + - + From teigland@fedoraproject.org Thu Aug 6 20:21:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Thu, 06 Aug 2009 20:21:00 -0000 Subject: cluster: STABLE3 - man page: cluster.conf Message-ID: <20090806202046.1F90712019B@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=2a95cd1d40bab8ef5966febda4566f3b80fe0bd3 Commit: 2a95cd1d40bab8ef5966febda4566f3b80fe0bd3 Parent: 1bfe888048a09b324e7dd65b5d6c125530409327 Author: David Teigland AuthorDate: Thu Aug 6 14:36:29 2009 -0500 Committer: David Teigland CommitterDate: Thu Aug 6 14:36:29 2009 -0500 man page: cluster.conf qdiskd.log instead of qdisk.log Signed-off-by: David Teigland --- config/man/cluster.conf.5 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/config/man/cluster.conf.5 b/config/man/cluster.conf.5 index d9e50d4..336a841 100644 --- a/config/man/cluster.conf.5 +++ b/config/man/cluster.conf.5 @@ -151,7 +151,7 @@ An explicit configuration for the default settings would be: syslog_priority="info" logfile_priority="info"> .br + logfile="/var/log/cluster/qdiskd.log"/> .br From teigland@fedoraproject.org Fri Aug 7 14:01:00 2009 From: teigland@fedoraproject.org (David Teigland) Date: Fri, 07 Aug 2009 14:01:00 -0000 Subject: cluster: STABLE3 - man page: cman Message-ID: <20090807140054.D44EE120203@lists.fedorahosted.org> Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=e91e2b145a40703e07f5322699a17c68f009e150 Commit: e91e2b145a40703e07f5322699a17c68f009e150 Parent: bb95419abc7e444af61e2c821a62a8832d275145 Author: David Teigland AuthorDate: Fri Aug 7 08:50:40 2009 -0500 Committer: David Teigland CommitterDate: Fri Aug 7 08:50:40 2009 -0500 man page: cman Remove old logging syntax, latest common syntax in cluster.conf(5) Signed-off-by: David Teigland --- cman/man/cman.5 | 11 ----------- 1 files changed, 0 insertions(+), 11 deletions(-) diff --git a/cman/man/cman.5 b/cman/man/cman.5 index 061ba05..a4dbcfd 100644 --- a/cman/man/cman.5 +++ b/cman/man/cman.5 @@ -167,7 +167,6 @@ them into corosync: - @@ -195,22 +194,12 @@ default values: rrp_mode="none"