Commit Graph

40 Commits

Author SHA1 Message Date
Neil Brown 68c7d6d790 Add 'supertype' arg to almost all metadata methods.
The 'superblock' will be moved into this structure soon.
2007-12-14 20:14:16 +11:00
Neil Brown df37ffc039 Allow metadata handlers to free their own superblock.
As the metadata handler allocates the superblock, it should free it
too.  DDF will have a more complex 'superblock' which needs more complex
freeing.
2007-12-14 20:14:00 +11:00
Neil Brown aba69144fd Remove spaces/tabs from ends of lines. 2007-12-14 20:13:43 +11:00
Neil Brown 6e9eac4f08 Fix restarting of a reshaping array.
The last release broke the ability to assemble an array that
was in the middle of a reshape.
This patch adds code to test if the critical section needs
to be restored or not so that - if we have failed to restore it,
we know whether to fail or not.
2007-10-16 13:52:35 +10:00
Neil Brown 2295250a73 Report error when grow cannot be restarted.
Make sure that if --assemble find an array in the critical region
of a reshape, and cannot find the critical data to restart the
reshape, it gives an error message.
2007-08-20 14:14:42 +10: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 f752781f81 Fix --grow --add for linear arrays.
The new superblock needs to have a new disk.number.  This is a bit of a hack...
Fix handling of negative bitmap offsets on 64bit hosts.

The bitmap offset is a signed 32bit number, so casting to (long)
isn't sufficient.  We must cast to (int32_t).
Fix various problems with --grow --add for linear.

The code to add a drive to a live linear array had never
been tested properly and so was buggy.  This tidies it up
and means that the new regression-test passes.
2007-05-21 14:25:37 +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 758d3a8e7d Increase raid456 stripe cache size if needed to --grow the array.
The setting used unfortunately requires intimate knowledge of the
kernel, and it not reset when the reshape finishes.
2006-12-14 17:31:16 +11:00
Neil Brown 199171a297 Improve allocation and use of space for bitmaps in version1 metadata
Depending on the size of the array we reserve space for up to 128K
of bitmap, and we use it where possible.
When hot-adding to a version 1.0 we can still only use the 3K at the
end though - need a sysfs interface to improve that.

If a small chunksize is requested on Create, we don't auto-enlarge
the reserved space - this still needs to be fixed.
2006-12-14 17:31:00 +11:00
Neil Brown e81cdd9f37 Stop map_dev from returning [0:0]
We sometimes need the NULL when major==minor==0.
So make sure all callers of map_dev can cope with NULL.
2006-06-20 10:01:43 +10:00
Neil Brown 9fca7d6236 check return status of all write/fwrite functions as required by glibc 2.4
From: Luca Berra <bluca@vodka.it>

glibc 2.4 is pedantic on ignoring return values from fprintf, fwrite and
write, so now we check the rval and actually do something with it.
in the Grow.c case i only print a warning, since i don't think we can do
anything in case we fail invalidating those superblocks (is should never
happen, but then...)

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-29 02:06:32 +00:00
Neil Brown e5eac01f3d Make sure homehost is set correctly when --update=uuid
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-23 04:51:39 +00: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 8686f3ed06 Fix problem with sector/KB size confuision for bitmap sizing.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-15 03:57:53 +00:00
Neil Brown 9860f2711d Bug fixes to pass test suite
Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-29 06:28:07 +00:00
Neil Brown 16c6fa807c Create missing /dev files where needed.
Whenever we need a device file to open, if one cannot be found in /dev,
create a temporary one.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-28 06:26:53 +00:00
Neil Brown 06b0d78675 Allow resize to backup to a file.
To support resizing an array without a spare, mdadm now understands
  --backup-file=
which should point to a file for storing a backup of critical data.
This can be given to --grow which will create the file, or
--assemble which will restore from the file if needed.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-27 06:38:46 +00:00
Neil Brown 313176636e Remove ident arg from getinfo_super;
Add a 'name' field to 'info' to compensate.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-27 04:34:38 +00:00
Neil Brown 2efedc7bd2 Put a 'canary' block in front of the backup
.. so corruptio can be detected.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-27 04:14:43 +00:00
Neil Brown 206c5eaedf Fix a few issues with the reshape patches.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-20 03:26:42 +00:00
Neil Brown 353632d927 Support restarting of a reshape on --assemble
Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-20 03:17:31 +00:00
Neil Brown e86c9dd6d8 Initial reshape support
Needs work for other levels etc.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-13 05:51:32 +00:00
Neil Brown 8fac0577f0 Stuff like..
- report Intent Bitmap in --detail
- report internal bitmap in --examine
- pass' --force through to --grow --bitmap
- support v.large arrays in --grow --bitmap

Signed-off-by: Neil Brown <neilb@suse.de>
2006-01-30 23:23:45 +00:00
Neil Brown 21e92547e7 Work towards allowing larger internal bitmaps in version1 superblocks.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-01-30 02:57:49 +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 1bf4e2d962 Passes all tests, nearly ready for release.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-08-26 06:08:28 +00:00
Neil Brown 34163fc7cf Support internal bitmaps with format-1 superblocks.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-08-25 04:31: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 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 96395475fc Make --zero-superblock work for version 1 superblocks.
This requires passing the supertype to store_super

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-06-07 23:03:45 +00:00
Neil Brown ea32955930 Increase max-devs on type-1 superblocks
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-06-07 23:03:46 +00:00
Neil Brown f5e166fee3 Support --grow --bitmap=internal
Adding a filebased bitmap is not yet supported, and
this code is still under development.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-06-07 23:03:46 +00:00
Neil Brown 82d9eba687 super1
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Fix raid5 creation with new code.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-05-03 23:44:40 +00:00
Neil Brown f9ce90ba50 Add a 'super-switch' so that different format superblocks can be used.
This includes:
  adding --metadata= option to choose metadata format
  adding metadata= word to config file.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-05-03 23:44:32 +00:00
Neil Brown 4b1ac34b51 Separate sueprblock handling into separate file
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-05-03 23:44:18 +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 e5329c3747 mdadm-1.7.0 2004-08-11 02:16:01 +00:00