Commit Graph

90 Commits

Author SHA1 Message Date
NeilBrown 850a31783a Release mdadm-3.1.3
Signed-off-by: NeilBrown <neilb@suse.de>
2010-08-06 16:55:23 +10:00
NeilBrown f21e18ca89 Compile with -Wextra by default
This produced lots of warning, some of which pointed to actual bugs.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-08-05 13:13:02 +10:00
NeilBrown 7f5de63d51 Switch from /lib/init/rw to /dev for early-boot files.
It turns out that /lib/init/rw doesn't exist in early boot
like I thought.  So give up on that idea and just use
/dev/.mdadm/ for files that must persist from early-boot
to regular boot.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-07-28 17:41:35 +10:00
Doug Ledford 753cf90512 Fix all the confusion over directories once and for all.
We now have 3 directory definitions: mdmon directory for its pid and
sock files (compile time define, not changable at run time), mdmonitor
directory which is for the mdadm monitor mode pid file (can only be
passed in via command line at the time mdadm is invoked in monitor mode),
and the directory for the mdadm incremental assembly map file (compile
time define, not changable at run time).  Only the mdadm map file still
hunts multiple locations, and the number of locations has been reduced
to /var/run and the compile time specified location.  Re-use of similar
sounding defines that actually didn't denote their actual usage at
compile time made it more difficult for a person to know what affect
changing the compile time defines would have on the resulting programs.

This patch renames the various defines to clearly identify which item
the define affects.  It also reduces the number of various directories
which will be searched for these files as this has lead to confusion
in mdadm and mdmon in terms of which files should take precedence when
files exist in multiple locations, etc.  It's best if the person
compiling the program intentionally and with planning selects the
right directories to be used for the various purposes.  Which directory
is right depends on which items you are talking about and what boot
loader your system uses and what initramfs generation program your
system uses.  Because of the inter-dependency of all these items it
would typically be up to the distribution that mdadm is being integrated
into to select the correct values for these defines.

Signed-off-by: Doug Ledford <dledford@redhat.com>
2010-07-22 10:16:30 -04:00
Dan Williams f4190c2f12 mdmon: satisfy glibc tls abi requirements with pthreads
Setting up a proper tls descriptor is required to conform to the abi
[1].  Until it can be implemented in mdmon use pthreads instead of
clone(2) to let glibc handle the details.  The old behaviour can be had
by un-defining USE_PTHREADS.

Note, the "O2" builds need LDFLAGS now to pick up the '-pthread' option.

[1]: http://people.redhat.com/drepper/tls.pdf

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2010-07-06 12:48:56 -07:00
Dan Williams 23eb475a96 mdmon: prevent allocations due to late binding
Current versions of glibc do not provide a useable interface to clone(2) as it
inflicts hidden dependencies on setting up a glibc specific tls
descriptor.  The dynamic linker trips this dependency and causes mdmon
to intermittently fail to load.  Resolving all dynamic linking prior to
starting the monitor thread appears to mitigate the issue but there is no
guarantee that another tls dependency will bite us later.

However, while the debate continues with the glibc maintainers it seems
prudent to keep this change.  It ensures that we do not get into a
situation where the monitor thread needs to make a late allocation to
resolve a symbol.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2010-07-01 17:28:14 -07:00
martin f. krafft 26f467a954 Compile-time switch to enable 0.9 metadata as default
This commit introduces DEFAULT_OLD_METADATA as a preprocessor
definition. If defined, it causes mdadm to assume metadata version 0.9
as default. If not defined, version 1.x (currently 1.2) is used as
default.

The man page mdadm.8 is also modified to reflect the chosen default.

The selftests will not work if the old default is chosen.

This patch was requested by Debian so they could distribute a current
mdadm together with boot loaders that only understand 0.90 metadata
for md-raid.

Preferred usage is simply
   make DEFAULT_OLD_METADATA=yes


Signed-off-by: martin f. krafft <madduck@debian.org>
Signed-off-by: NeilBrown <neilb@suse.de>
2010-05-31 12:52:37 +10:00
Dan Williams c824e91898 Fixup default definitions of VAR_RUN and ALT_RUN
I suspect commit c132678b wanted VAR_RUN and ALT_RUN to be suffixed by
'/mdadm' to match the defaults in mdadm.h.

Cc: Luca Berra <bluca@comedia.it>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2010-04-15 15:29:49 +10:00
Doug Ledford e259df4e63 mapfile: if we putting the mapfile in a custom location via ALT_RUN, allow
a custom filename too.

Signed-off-by: Doug Ledford <dledford@redhat.com>
2010-03-24 09:37:34 +11:00
NeilBrown a31c140f13 Release mdadm-3.1.2 2010-03-10 15:58:46 +11:00
Luca Berra c132678b18 allow redefinition of VAR_RUN
having mdmon socket under var is painful at shutdown time

Signed-off-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
2010-03-03 12:23:30 +11:00
NeilBrown fcf5762500 Add _FORTIFY_SOURCE to mdadm.O2 build.
When building mdadm.O2, set _FORTIFY_SOURCE to get more
warnings, and also build mdmon.O2 to find warnings in that
code too.
Then fix the warnings.

Suggested-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
2010-03-03 10:54:17 +11:00
NeilBrown 5d4d1b26d3 mdmon: allow pid to be stored in different directory.
/var/run probably doesn't persist from early boot.
So if necessary, store in in /lib/init/rw or somewhere else
that does persist.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-02-04 16:47:28 +11:00
NeilBrown 38a07ed61e Move WaitClean from Monitor.c to sysfs.c
That way mdmon doesn't need to include Monitor.o

Signed-off-by: NeilBrown <neilb@suse.de>
2009-06-02 15:27:16 +10:00
NeilBrown e0fe762a63 mdadm.8: Man page updates
General review and update of mdadm.8
2009-06-02 14:06:05 +10:00
NeilBrown 8320878543 Merge branch 'master' into devel-3.0
Conflicts:
	Build.c
	mdadm.c
	mdadm.h
	super1.c
2009-05-11 16:05:41 +10:00
NeilBrown 667e66d329 Makefile: use $(CC) more consistently.
Explicitly calling 'gcc' in some rules makes it hard to test with
other compilers.
2009-04-29 11:21:08 +10:00
NeilBrown 55e5475945 Makefile: build 'mdmon' for 'test'
Else
  make test
might not prepare everything for running tests.
2009-04-01 13:49:34 +11:00
NeilBrown 8844e29149 Merge branch 'master' in devel-3.0 2009-03-10 16:47:02 +11:00
NeilBrown 388953d27c Release mdadm-2.6.9 2009-03-10 16:38:37 +11:00
NeilBrown 6c40598f59 Merge branch 'master' into devel-3.0 2009-02-02 11:09:09 +11:00
Bernhard Reutner-Fischer 2df1f26911 mdadm fix compilation for uClibc
2008-12-08  Bernhard Reutner-Fischer  <rep.dot.nop@gmail.com>

	* Makefile (dadm.uclibc): Remove misspelled and unneeded rule.
	* md5.h: Include stdint.h for uClibc.
	* mdadm.h: uClibc defines __UCLIBC__. If uClibc has LFS off
	then use lseek instead of lseek64.

Signed-off-by:  Bernhard Reutner-Fischer  <rep.dot.nop@gmail.com>
2009-02-02 09:53:51 +11:00
Dan Williams 88c32bb1ec imsm: validate arrays being created against firmware capabilities
These checks are only enabled when platform support for imsm is found,
i.e. ahci driver is loaded and talking to an Intel(R) controller, and
the option rom header is located.

They can be turned off by setting the environment variable
IMSM_NO_PLATFORM to 1.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-12-08 16:59:18 -07:00
NeilBrown 25956fef10 Makefile: install udev file into $DESTDIR
Forgot the $DESTDIR in the install target :-(

Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-07 14:46:50 +11:00
Dan Williams f64165f757 config: add 'containers' as a DEVICE keyword
Add anything that looks like a container in /proc/mdstat to the devlist

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-04 20:50:39 +11:00
NeilBrown 757a5d74ff Add udev rules file for mdadm.
This is based on the rules from openSUSE 11.1-rc3.
2008-11-04 20:50:39 +11:00
NeilBrown 0febf9a94d Makefile: Include bitmap.o in mdmon
A recent change causes mdmon to appear to need 'bitmap_sectors', which
is in bitmap.o.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-10-27 09:57:30 +11:00
Dan Williams 883a6142e6 mdmon: wait after trying to kill
Now that mdmon handles sigterm if another monitor wants to take over it
should wait until all managed arrays are clean.  So make WaitClean()
available to mdmon and teach try_kill_monitor() to wait on each subarray
in the container.

...since we may be communicating with a dieing process, we need to
block SIGPIPE earlier.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-10-15 14:43:57 -07:00
Dan Williams 3d2c4fc7b6 trivial warn_unused_result squashing
Made the mistake of recompiling the F9 mdadm rpm which has a patch to
remove -Werror and add "-Wp,-D_FORTIFY_SOURCE -O2" which turns on lots
of errors:

config.c:568: warning: ignoring return value of asprintf
Assemble.c:411: warning: ignoring return value of asprintf
Assemble.c:413: warning: ignoring return value of asprintf
super0.c:549: warning: ignoring return value of posix_memalign
super0.c:742: warning: ignoring return value of posix_memalign
super0.c:812: warning: ignoring return value of posix_memalign
super1.c:692: warning: ignoring return value of posix_memalign
super1.c:1039: warning: ignoring return value of posix_memalign
super1.c:1155: warning: ignoring return value of posix_memalign
super-ddf.c:508: warning: ignoring return value of posix_memalign
super-ddf.c:645: warning: ignoring return value of posix_memalign
super-ddf.c:696: warning: ignoring return value of posix_memalign
super-ddf.c:715: warning: ignoring return value of posix_memalign
super-ddf.c:1476: warning: ignoring return value of posix_memalign
super-ddf.c:1603: warning: ignoring return value of posix_memalign
super-ddf.c:1614: warning: ignoring return value of posix_memalign
super-ddf.c:1842: warning: ignoring return value of posix_memalign
super-ddf.c:2013: warning: ignoring return value of posix_memalign
super-ddf.c:2140: warning: ignoring return value of write
super-ddf.c:2143: warning: ignoring return value of write
super-ddf.c:2147: warning: ignoring return value of write
super-ddf.c:2150: warning: ignoring return value of write
super-ddf.c:2162: warning: ignoring return value of write
super-ddf.c:2169: warning: ignoring return value of write
super-ddf.c:2172: warning: ignoring return value of write
super-ddf.c:2176: warning: ignoring return value of write
super-ddf.c:2181: warning: ignoring return value of write
super-ddf.c:2686: warning: ignoring return value of posix_memalign
super-ddf.c:2690: warning: ignoring return value of write
super-ddf.c:3070: warning: ignoring return value of posix_memalign
super-ddf.c:3254: warning: ignoring return value of posix_memalign
bitmap.c:128: warning: ignoring return value of posix_memalign
mdmon.c:94: warning: ignoring return value of write
mdmon.c:221: warning: ignoring return value of pipe
mdmon.c:327: warning: ignoring return value of write
mdmon.c:330: warning: ignoring return value of chdir
mdmon.c:335: warning: ignoring return value of dup
monitor.c:415: warning: rv may be used uninitialized in this function

...some of these like the write() ones are not so trivial so save those
fixes for the next patch.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-10-15 14:15:52 -07:00
NeilBrown 1cccd683f3 Disable compilation with diet-libc
We need posix_memalign (or something similar) which diet-libc does not
provide.
2008-09-18 14:33:37 +10:00
Dan Williams d253482527 Makefile: Add mdmon header dependencies
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-09-15 20:58:41 -07:00
NeilBrown 37ea3936a6 Merge branch 'master' into from-stable
Conflicts:

	Create.c
	Manage.c
2008-08-07 14:12:25 +10:00
Doug Ledford 0bc38b5020 Add support for distribution specific build extensions
Signed-off-by: Doug Ledford <dledford@redhat.com>
2008-07-24 12:34:34 -04:00
Jacek Danecki 4ad866b132 install mdmon to the same location as mdadm
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-07-21 17:42:12 -07:00
Neil Brown 370ac380fd Merge branch 'master' into devel-3.0
Conflicts:

	Makefile
2008-06-19 16:38:37 +10:00
Neil Brown 7702a58b90 Include sysfs.c in mdassemble.auto
and tidy up Makefile a bit.
2008-05-19 12:07:47 +10:00
Neil Brown 7815fbfef2 "make everything" now also makes mdassemble.auto
This is
  make MDASSEMBLE_AUTO=1 mdassemble.static

so we now find compile bugs more easily.
2008-05-19 12:07:43 +10:00
Dan Williams b109d92863 start fleshing out socket code, ping monitor to see if it is alive
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:52 +10:00
Neil Brown 549e9569c6 Merge mdmon 2008-05-15 16:48:37 +10:00
Dan Williams f7dd881f90 handle Manage_subdevs() for 'external' arrays
From: Dan Williams <dan.j.williams@intel.com>

1/ Block attempts to add/remove devices from container members
2/ Forward add/remove requests to containers

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:35 +10:00
Dan Williams cdddbdbca0 imsm: initial Intel(R) Matrix Storage Manager support
From: Dan Williams <dan.j.williams@intel.com>

The following now work:
--examine
--examine --brief

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:22 +10:00
Dan Williams a322f70c41 Initial DDF support code.
Create a ddf array by naming the device /dev/ddf* or
specifying metadata 'ddf'.

If ddf is specified with no level, assume a container (indeed,
anything else would be wrong).

**Need to use text_Version to set external metadata...

More ddf support

Load a ddf container.  Now
   --examine /dev/ddf
works.
super-ddf: fix compile warning

From: Dan Williams <dan.j.williams@intel.com>

super-ddf.c:723: format %lu expects type long unsigned int, but argument 3 has type unsigned int

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:14 +10:00
Neil Brown 11fcec12ef Add crc32 files.
For ddf.
2008-05-15 16:48:10 +10:00
Neil Brown 5624768a4c Compile with various -O flags for testing.
"make everything" now compiles with -O2 and -Os to increase coverage
for compiler generated warnings.
2007-05-22 09:46:36 +10:00
Neil Brown f783ca4fa1 Don't include uclibc as part of 'everything'
As I cannot compile in on x86-64.
Also, small dietlibc fix
2007-02-22 14:59:31 +11:00
Neil Brown 8382f19bdc Add new mode: --incremental
--incremental allows arrays to be assembled one device at a time.
This is expected to be used with udev.
2006-12-21 17:10:52 +11:00
Luca Berra 435d4ebb2e Mdassemble improvements
From: Luca Berra <bluca@comedia.it>

- Fix a bug where mdassemble didn't close a filedescriptor and so couldn't assembele
  stacked arrays.
- Allow mdassemble, when run a second time, to mark all arrays as writable.
  This is useful if they are started read-only as is best at boot-time.
2006-10-16 15:26:53 +10:00
martin f. krafft 4e9b583928 Allow CONFFILE2 to be overridden during make invocation. 2006-06-02 20:53:02 +10:00
martin f krafft 77e521ce74 CPPFLAGS gets used automatically on implicit rules.
Take it out for cosmetic reasons to prevent duplicate -DDEBIAN.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-06-02 20:47:29 +10:00
Neil Brown 8268ed7403 Remove libssl dependancy and always use sha1.c code
Apparently there are license issues with openssl, so
just use sha1.c always.   This means we can get rid of
SHA1.c

Signed-off-by: Neil Brown <neilb@suse.de>
2006-06-02 06:12:19 +00:00