Commit Graph

43 Commits

Author SHA1 Message Date
NeilBrown 1011e8344a Remove lots of unnecessary white space.
Now that I am using white-space mode in Emacs I can see all of this,
and I don't like it :-)

Signed-off-by: NeilBrown <neilb@suse.de>
2013-06-19 12:31:45 +10:00
NeilBrown 748952f73e Create: default to bitmap=internal for large arrays.
Here, "large" means components are 100G or more.  It is
usually beneficial to have write-intent bitmaps on such arrays.
They can be suppressed with --bitmap=none

Signed-off-by: NeilBrown <neilb@suse.de>
2013-03-05 10:36:21 +11:00
NeilBrown 4dd2df0966 Discard devnum in favour of devnm
We widely use a "devnum" which is 0 or +ve for md%d devices
and -ve for md_d%d devices.
But I want to be able to use md_%s device names.

So get rid of devnum (a number) and use devnm (a 32char string).
eg.
  md0
  md_d2
  md_home

Signed-off-by: NeilBrown <neilb@suse.de>
2013-02-21 17:05:23 +11:00
Michael Tokarev dae45415a9 Trivial bugfix and spelling fixes.
And here's another trivial bugfix, now for spelling mistakes in various
places, authred by Sergey Kirpichev (Cc'ed) and carried in debian mdadm
package.


Signed-off-by: NeilBrown <neilb@suse.de>
2012-10-22 08:55:27 +11:00
NeilBrown 0a8b92a6f6 Fix default size calculations that were recently broken.
commit d04f65f48c
    Change the values for "max size" from -1 to 1.

Messed up 's->size' - leaving it as '1' (MAX_SIZE) in some cases and
causing the array reshape to fail.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-08-13 08:00:18 +10:00
NeilBrown a4e8316a75 Use new 'struct shape' to pass args to Build
Signed-off-by: NeilBrown <neilb@suse.de>
2012-07-09 17:21:57 +10:00
NeilBrown 45c8bd9961 Fix --build on 2.2 kernels :-)
This code has clearly never been used because it isn't right.
But let's fix it anyway.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-07-09 17:21:50 +10:00
NeilBrown d04f65f48c Change the values for "max size" from -1 to 1.
Both are impossible, and '1' allows size to be unsigned,
which is neater.
Also #define MAX_SIZE to be '1' to make it all more explicit.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-07-09 17:20:32 +10:00
NeilBrown 0c9e4afb1f Change Build to take a struct context
Signed-off-by: NeilBrown <neilb@suse.de>
2012-07-09 17:19:21 +10:00
NeilBrown e7b84f9d50 Introduce pr_err for printing error messages.
'pr_err("' is a lot shorter than 'fprintf(stderr, Name ": '
cont_err() is also available.

Signed-off-by: NeilBrown <neilb@suse.de>
2012-07-09 17:14:16 +10:00
NeilBrown a252c07814 Create: allow chunksize to be non-power-of-2.
RAID0 has accepted chunksizes that are not a power of 2 since 2.6.30.
So it time mdadm allowed that to be used.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-05-10 17:35:41 +10:00
NeilBrown a655e55064 Improve type names for mddev_dev
Remove the _t pointer typedef and remove the _s suffix for the
structure,

These things do not help readability.

Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-22 20:58:05 +11:00
NeilBrown e736b62389 Update copyright dates and remove references to @cse.unsw.edu.au
Also removed 'paper' addresses.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-06-02 14:35:45 +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
Paul Clements 25affb56b9 mdadm: allow build to use --size
This patch enables the --size parameter for build operations.

Without this, if you have a raid1, for instance, where the 2 disks are
not the exact same size, and you need to build the array but one of the
disks is not available right at the moment (maybe it's USB and it's
unplugged, or maybe it's a network disk and it's unavailable), then you
have to play some weird games to get the array to size correctly (that
is, to the size of the smaller of the two components or less).

There may be other uses for this too...

--
Paul

Signed-off-by: NeilBrown <neilb@suse.de>
2009-04-21 15:36:13 +10:00
NeilBrown a7c6e3fb24 wait_for improvement.
wait not only for the name to appear, but for it to refer to the
correct device.
Sometimes old symlinks left lying around can be confusing.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-04-07 17:34:38 +10:00
NeilBrown a714580e02 Wait for name to appear after create/assemble etc.
We don't really want mdadm to exit until udev has
created the names in /dev.  So wait.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-04 21:56:42 +11:00
NeilBrown ad5bc697ad Incremental: lock against multiple concurrent additions to an array.
In two devices are added via -I to one array at the same time, mdadm
can get badly confused.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-04 20:50:39 +11:00
NeilBrown a04d576343 Always update mdadm/map when starting an array.
We previously only updated /var/run/mdadm/map when starting an
array with --incremental.  However we now make more use of
that file (to pass the dev name to udev) so always update it.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-04 20:50:38 +11:00
NeilBrown 69207ff6ac mdopen: Introduce new rules for creating device name.
MORE CONTENT HERE
2008-11-04 20:50:21 +11:00
NeilBrown 7f91af49ad Delay creation of array devices for assemble/build/create
We will shortly be feeding more information into the process of
creating array devices, so delay the creation.  Still open them
early if the device already exists.

This involves making sure the autof flag is in the right place
so that it can be found at creation time.

Also, Assemble, Build, and Create now always close 'mdfd'.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-11-04 10:35:37 +11:00
NeilBrown b3d3195538 Allow WRITEMOSTLY to be cleared on --readd using --readwrite.
Previously it was possible to set the WRITEMOSTLY flag when
adding a device to an array, but not to clear the flag when re-adding.
This is now possible with --readwrite.

Signed-off-by: NeilBrown <neilb@suse.de>
2008-10-25 18:20:49 +11:00
Neil Brown aba69144fd Remove spaces/tabs from ends of lines. 2007-12-14 20:13:43 +11:00
Neil Brown 5b28bd5672 Improve error message for adding bitmap to a level that cannot support it.
Also give error on --build if no devices given.
2007-05-21 14:25:47 +10:00
Neil Brown beae1dfe2e Central calls to ioctl BLKGETSIZE
Instead of opencoding the same thing everywhere.
2006-12-14 17:32:57 +11:00
Neil Brown 4f589ad0c5 Just updaqte copyright dates and email address
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-19 05:25:11 +00:00
Neil Brown 1bfdbe01ff Limit size of bitmap to 2million chunks.
When creating a file bitmap, choose a default size that
results in fewer than 2^21 chunks.  Without this kmalloc
failure in the kernel becomes likely.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-15 04:21:33 +00:00
Neil Brown f9c25f1d2a Support bitmaps with raid10
And a couple of other little things

Signed-off-by: Neil Brown <neilb@suse.de>
2005-11-22 03:37:14 +00:00
Neil Brown dcec9ee547 Create version-4 bitmaps if kernel supports it.
Version-3 bitmaps are host-endian.  Version-4 are little-endian
and so more portable.

Signed-off-by: Neil Brown <neilb@suse.de>
2005-10-11 04:44:44 +00:00
Neil Brown fe80f49b6e Assorted fixes
Support "--build"ing arrays with bitmaps.
hot-removal of bitmaps
--re-add of drives recently removed.
assorted extra tests

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-08-16 06:45:23 +00:00
Neil Brown dab6685f3d Add 'quite' option and tidy up some tests.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-08-15 06:14:27 +00:00
Neil Brown dfd4d8ee42 Add write-behind support
Currently this includes
  --write-behind  to set level of write-behind supported
  --write-mostly  to flag devices as write-mostly.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-08-09 04:25:47 +00:00
Neil Brown 699f989949 Don't for a chunk-size when "build"ing a raid1
as raid1 doesn't need chunksize

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-07-29 00:20:11 +00:00
Neil Brown 98ce384920 From paul.clements@steeleye.com Thu May 19 11:09:55 2005
X-VM-v5-Data: ([nil nil nil nil t nil nil nil nil]
	["2589" "Wednesday" "18" "May" "2005" "21:09:47" "-0400" "Paul Clements" "paul.clements@steeleye.com" nil "93" "[PATCH 1/1] mdadm 2.0 devel: fix bitmap size calculation and allow \"missing\" device in Build command" "^From:" "neilb@cse.unsw.edu.au" "neilb@cse.unsw.edu.au" "5" nil nil nil nil nil nil nil nil nil]
	nil)
Return-Path: <paul.clements@steeleye.com>
Received: From
	smtp-dist.unsw.edu.au ([149.171.97.16] == smtp-dist-01.services.comms.unsw.EDU.AU)
	(for <neilb@cse.unsw.edu.au>) By note With Smtp ;
	Thu, 19 May 2005 11:09:55 +1000
Received: from localhost (avspam-03.services.comms.unsw.edu.au [149.171.100.18])
	by smtp-dist.unsw.edu.au (8.13.1/8.13.1) with ESMTP id j4J19t05017496
	for <VRT+EFNJ=JQ=cse.unsw.edu.au=neilb@cse.unsw.edu.au>; Thu, 19 May 2005 11:09:55 +1000 (EST)
Received: from note.orchestra.cse.unsw.EDU.AU (note.orchestra.cse.unsw.EDU.AU [129.94.242.24])
	by smtp.unsw.edu.au (8.13.1/8.13.1) with ESMTP id j4J19qEL010258
	for <VRT+EFNJ=JQ=cse.unsw.edu.au=neilb@cse.unsw.edu.au>; Thu, 19 May 2005 11:09:53 +1000 (EST)
Received: From hancock.sc.steeleye.com ([209.192.50.48] == stat16.steeleye.com)
	(for <neilb@cse.unsw.edu.au>) By note With Smtp ;
	Thu, 19 May 2005 11:09:52 +1000
Received: from steeleye.com (clements.sc.steeleye.com [172.17.6.4])
	by hancock.sc.steeleye.com (8.11.6/8.11.6) with ESMTP id j4J19lA29968
	for <neilb@cse.unsw.edu.au>; Wed, 18 May 2005 21:09:48 -0400
Message-ID: <428BE75B.20803@steeleye.com>
User-Agent: Mozilla Thunderbird 0.5 (X11/20040208)
X-Accept-Language: en-us, en
MIME-Version: 1.0
References: <428A496D.6000303@steeleye.com>
In-Reply-To: <428A496D.6000303@steeleye.com>
From: Paul Clements <paul.clements@steeleye.com>
To: neilb@cse.unsw.edu.au
Subject: [PATCH 1/1] mdadm 2.0 devel: fix bitmap size calculation and allow
 "missing" device in Build command
Date: Wed, 18 May 2005 21:09:47 -0400
Content-Type: multipart/mixed;
 boundary="------------090601020206040308050709"

This is a multi-part message in MIME format.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-06-14 06:29:20 +00:00
Neil Brown c82f047cfc Initial bitmap support
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-06-07 23:16:35 +00:00
Neil Brown 0df46c2ad8 Change MAJOR() etc to major() etc
This allows for larger device number if glibc supports
it (requires 2.3.3).
Also fail before creating larger device number if glibc
support isn't present.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-04-04 05:16:13 +00:00
Neil Brown b5e6464503 mdadm-1.8.0 2004-11-01 04:49:34 +00:00
Neil Brown dd0781e505 mdadm-1.6.0 2004-06-04 12:03:19 +00:00
Neil Brown e0d1903663 mdadm-0.8 2002-04-04 01:58:32 +00:00
Neil Brown 9a9dab3670 mdadm-0.7 2002-03-08 00:03:52 +00:00
Neil Brown cd29a5c835 mdctl-0.6 2002-03-06 23:17:40 +00:00
Neil Brown 82b27616de mdctl-v0.4 2001-07-26 07:00:09 +00:00
Neil Brown 64c4757e27 mdctl-v0.2 2001-06-08 02:36:23 +00:00