[PATCH 004 of 4] md: Fix an occasional deadlock in raid5 - FIX

2008-01-18 Thread NeilBrown
(This should be merged with fix-occasional-deadlock-in-raid5.patch) As we don't call stripe_handle in make_request any more, we need to clear STRIPE_DELAYED to (previously done by stripe_handle) to ensure that we test if the stripe still needs to be delayed or not. Signed-off-by: Neil Brown

[PATCH 003 of 4] md: Change ITERATE_RDEV_GENERIC to rdev_for_each_list, and remove ITERATE_RDEV_PENDING.

2008-01-18 Thread NeilBrown
Finish ITERATE_ to for_each conversion. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c |8 ./include/linux/raid/md_k.h | 14 -- 2 files changed, 8 insertions(+), 14 deletions(-) diff .prev/drivers/md/md.c

[PATCH 002 of 4] md: Allow devices to be shared between md arrays.

2008-01-18 Thread NeilBrown
Currently, a given device is claimed by a particular array so that it cannot be used by other arrays. This is not ideal for DDF and other metadata schemes which have their own partitioning concept. So for externally managed metadata, just claim the device for md in general, require that offset

[PATCH 000 of 4] md: assorted md patched - please read carefully.

2008-01-18 Thread NeilBrown
happier about this patch. It introduced a performance regression and I now understand why. I'm now happy for that patch with this fix to go into 2.6.24 if that is convenient (If not, 2.6.24.1 will do). Thanks, NeilBrown [PATCH 001 of 4] md: Set and test the -persistent flag for md devices more

[PATCH 001 of 4] md: Set and test the -persistent flag for md devices more consistently.

2008-01-18 Thread NeilBrown
If you try to start an array for which the number of raid disks is listed as zero, md will currently try to read metadata off any devices that have been given. This was done because the value of raid_disks is used to signal whether array details have been provided by userspace (raid_disks 0) or

[PATCH 000 of 6] md: various fixes for md

2008-01-13 Thread NeilBrown
, NeilBrown [PATCH 001 of 6] md: Fix an occasional deadlock in raid5 [PATCH 002 of 6] md: Fix use-after-free bug when dropping an rdev from an md array. [PATCH 003 of 6] md: Change a few 'int' to 'size_t' in md [PATCH 004 of 6] md: Change INTERATE_MDDEV to for_each_mddev [PATCH 005 of 6] md: Change

[PATCH 004 of 6] md: Change INTERATE_MDDEV to for_each_mddev

2008-01-13 Thread NeilBrown
As this is more consistent with kernel style. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff .prev/drivers/md/md.c ./drivers/md/md.c --- .prev/drivers/md/md.c 2008-01-14

[PATCH 005 of 6] md: Change ITERATE_RDEV to rdev_for_each

2008-01-13 Thread NeilBrown
as this is morein line with common practice in the kernel. Also swap the args around to be more like list_for_each. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/bitmap.c |4 +- ./drivers/md/faulty.c |2 - ./drivers/md/linear.c |2 -

[PATCH 006 of 6] md: Change ITERATE_RDEV_GENERIC to rdev_for_each_list, and remove ITERATE_RDEV_PENDING.

2008-01-13 Thread NeilBrown
Finish ITERATE_ to for_each conversion. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c |8 ./include/linux/raid/md_k.h | 14 -- 2 files changed, 8 insertions(+), 14 deletions(-) diff .prev/drivers/md/md.c

[PATCH] md: Fix data corruption when a degraded raid5 array is reshaped.

2008-01-03 Thread NeilBrown
This patch fixes a fairly serious bug in md/raid5 in 2.6.23 and 24-rc. It would be great if it cold get into 23.13 and 24.final. Thanks. NeilBrown ### Comments for Changeset We currently do not wait for the block from the missing device to be computed from parity before copying data to the new

[PATCH 000 of 7] md: Introduction EXPLAIN PATCH SET HERE

2007-12-13 Thread NeilBrown
Following are 7 md related patches are suitable for the next -mm and maybe for 2.6.25. They move towards giving user-space programs more fine control of an array so that we can add support for more complex metadata formats (e.g. DDF) without bothering the kernel with such things. The last patch

[PATCH 001 of 7] md: Support 'external' metadata for md arrays.

2007-12-13 Thread NeilBrown
- Add a state flag 'external' to indicate that the metadata is managed externally (by user-space) so important changes need to be left of user-space to handle. Alternates are non-persistant ('none') where there is no stable metadata - after the array is stopped there is no record of

[PATCH 002 of 7] md: Give userspace control over removing failed devices when external metdata in use

2007-12-13 Thread NeilBrown
When a device fails, we must not allow an further writes to the array until the device failure has been recorded in array metadata. When metadata is managed externally, this requires some synchronisation... Allow/require userspace to explicitly remove failed devices from active service in the

[PATCH 003 of 7] md: Allow a maximum extent to be set for resyncing.

2007-12-13 Thread NeilBrown
This allows userspace to control resync/reshape progress and synchronise it with other activities, such as shared access in a SAN, or backing up critical sections during a tricky reshape. Writing a number of sectors (which must be a multiple of the chunk size if such is meaningful) causes a

[PATCH 004 of 7] md: Allow devices to be shared between md arrays.

2007-12-13 Thread NeilBrown
Currently, a given device is claimed by a particular array so that it cannot be used by other arrays. This is not ideal for DDF and other metadata schemes which have their own partitioning concept. So for externally managed metadata, just claim the device for md in general, require that offset

[PATCH 005 of 7] md: Lock address when changing attributes of component devices.

2007-12-13 Thread NeilBrown
Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff .prev/drivers/md/md.c ./drivers/md/md.c --- .prev/drivers/md/md.c 2007-12-14 16:09:01.0 +1100 +++ ./drivers/md/md.c 2007-12-14

[PATCH 006 of 7] md: Allow an md array to appear with 0 drives if it has external metadata.

2007-12-13 Thread NeilBrown
Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff .prev/drivers/md/md.c ./drivers/md/md.c --- .prev/drivers/md/md.c 2007-12-14 16:09:03.0 +1100 +++ ./drivers/md/md.c 2007-12-14

[PATCH 007 of 7] md: Get name for block device in sysfs

2007-12-13 Thread NeilBrown
Given an fd on a block device, returns a string like /block/sda/sda1 which can be used to find related information in /sys. Ideally we should have an ioctl that works on char devices as well, but that seems far from trivial, so it seems reasonable to have this until the later can be

[PATCH 001 of 3] md: raid6: Fix mktable.c

2007-12-06 Thread NeilBrown
From: H. Peter Anvin [EMAIL PROTECTED] Make both mktables.c and its output CodingStyle compliant. Update the copyright notice. Signed-off-by: H. Peter Anvin [EMAIL PROTECTED] Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/mktables.c | 43

[PATCH 000 of 3] md: a few little patches

2007-12-06 Thread NeilBrown
Following 3 patches for md provide some code tidyup and a small functionality improvement. They do not need to go into 2.6.24 but are definitely appropriate 25-rc1. (Patches made against 2.6.24-rc3-mm2) Thanks, NeilBrown [PATCH 001 of 3] md: raid6: Fix mktable.c [PATCH 002 of 3] md: raid6

[PATCH 002 of 3] md: raid6: clean up the style of raid6test/test.c

2007-12-06 Thread NeilBrown
From: H. Peter Anvin [EMAIL PROTECTED] Date: Fri, 26 Oct 2007 11:22:42 -0700 Clean up the coding style in raid6test/test.c. Break it apart into subfunctions to make the code more readable. Signed-off-by: H. Peter Anvin [EMAIL PROTECTED] Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat

[PATCH 003 of 3] md: Update md bitmap during resync.

2007-12-06 Thread NeilBrown
Currently and md array with a write-intent bitmap does not updated that bitmap to reflect successful partial resync. Rather the entire bitmap is updated when the resync completes. This is because there is no guarentee that resync requests will complete in order, and tracking each request

[PATCH] md: Fix misapplied patch in raid5.c

2007-11-01 Thread NeilBrown
commit 4ae3f847e49e3787eca91bced31f8fd328d50496 did not get applied correctly, presumably due to substantial similarities between handle_stripe5 and handle_stripe6. This patch (with lots of context) moves the chunk of new code from handle_stripe6 (where it isn't needed (yet)) to handle_stripe5.

[PATCH 000 of 2] md: Fixes for md in 2.6.23

2007-10-22 Thread NeilBrown
It appears that a couple of bugs slipped in to md for 2.6.23. These two patches fix them and are appropriate for 2.6.23.y as well as 2.6.24-rcX Thanks, NeilBrown [PATCH 001 of 2] md: Fix an unsigned compare to allow creation of bitmaps with v1.0 metadata. [PATCH 002 of 2] md: raid5: fix

[PATCH 001 of 2] md: Fix an unsigned compare to allow creation of bitmaps with v1.0 metadata.

2007-10-22 Thread NeilBrown
As page-index is unsigned, this all becomes an unsigned comparison, which almost always returns an error. Signed-off-by: Neil Brown [EMAIL PROTECTED] Cc: Stable [EMAIL PROTECTED] ### Diffstat output ./drivers/md/bitmap.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH 002 of 2] md: raid5: fix clearing of biofill operations

2007-10-22 Thread NeilBrown
From: Dan Williams [EMAIL PROTECTED] ops_complete_biofill() runs outside of spin_lock(sh-lock) and clears the 'pending' and 'ack' bits. Since the test_and_ack_op() macro only checks against 'complete' it can get an inconsistent snapshot of pending work. Move the clearing of these bits to

[PATCH 001 of 5] md: Fix a bug in some never-used code.

2007-10-14 Thread NeilBrown
http://bugzilla.kernel.org/show_bug.cgi?id=3277 There is a seq_printf here that isn't being passed a 'seq'. Howeve as the code is inside #ifdef MD_DEBUG, nobody noticed. Also remove some extra spaces. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid0.c | 10

[PATCH 002 of 5] md: 'sync_action' in sysfs returns wrong value for readonly arrays

2007-10-14 Thread NeilBrown
When an array is started read-only, MD_RECOVERY_NEEDED can be set but no recovery will be running. This causes 'sync_action' to report the wrong value. We could remove the test for MD_RECOVERY_NEEDED, but doing so would leave a small gap after requesting a sync action, where 'sync_action' would

[PATCH 003 of 5] md: Expose the degraded status of an assembled array through sysfs

2007-10-14 Thread NeilBrown
From: Iustin Pop [EMAIL PROTECTED] The 'degraded' attribute is useful to quickly determine if the array is degraded, instead of parsing 'mdadm -D' output or relying on the other techniques (number of working devices against number of defined devices, etc.). The md code already keeps track of

[PATCH 004 of 5] md: Make sure read errors are auto-corrected during a 'check' resync in raid1

2007-10-14 Thread NeilBrown
Whenever a read error is found, we should attempt to overwrite with correct data to 'fix' it. However when do a 'check' pass (which compares data blocks that are successfully read, but doesn't normally overwrite) we don't do that. We should. Signed-off-by: Neil Brown [EMAIL PROTECTED] ###

[PATCH 005 of 5] md: Fix type that is stopping raid5 grow from working.

2007-10-14 Thread NeilBrown
This kmem_cache_create is creating a cache that already exists. We could us the alternate name, just like we do a few lines up. Signed-off-by: Neil Brown [EMAIL PROTECTED] Cc: Dan Williams [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c |2 +- 1 file changed, 1 insertion(+), 1

[PATCH] md: Fix some bugs with growing raid5/raid6 arrays.

2007-08-30 Thread NeilBrown
. It applies to current -mm with quite a bit of fuzz... Thanks, NeilBrown ### Diffstat output ./drivers/md/raid5.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c --- .prev/drivers/md/raid5.c2007-08-30 15:58

[PATCH 002 of 2] md: Correctly update sysfs when a raid1 is reshaped.

2007-08-15 Thread NeilBrown
When a raid1 array is reshaped (number of drives changed), the list of devices is compacted, so that slots for missing devices are filled with working devices from later slots. This requires the rd%d symlinks in sysfs to be updated. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat

[PATCH 000 of 2] md: bug fixes for 2.6.23-rc

2007-08-15 Thread NeilBrown
Following 2 patches contain bugfixes for md. Both apply to earlier kernels, but probably aren't significant enough for -stable (no oops, no data corruption, no security hole). They should go in 2.6.23 though. Thanks, NeilBrown [PATCH 001 of 2] md: Make sure a re-add after a restart honours

[PATCH 001 of 2] md: Make sure a re-add after a restart honours bitmap when resyncing.

2007-08-15 Thread NeilBrown
Commit 1757128438d41670ded8bc3bc735325cc07dc8f9 was slightly bad. If an array has a write-intent bitmap, and you remove a drive, then readd it, only the changed parts should be resynced. However after the above commit, this only works if the array has not been shut down and restarted. This is

[PATCH 000 of 7] md: Introduction EXPLAIN PATCH SET HERE

2007-05-20 Thread NeilBrown
until now :-( The remainder are mainly cleaning up code and comments. They could wait for 2.6.23, but are probably safe to go into 2.6.22 (maybe sit a week in -mm??) Thanks, NeilBrown [PATCH 001 of 7] md: Avoid overflow in raid0 calculation with large components. [PATCH 002 of 7] md: Don't

[PATCH 001 of 7] md: Avoid overflow in raid0 calculation with large components.

2007-05-20 Thread NeilBrown
If a raid0 has a component device larger than 4TB, and is accessed on a 32bit machines, then as 'chunk' is unsigned lock, chunk chunksize_bits can overflow (this can be as high as the size of the device in KB). chunk itself will not overflow (without triggering a BUG). So change 'chunk' to

[PATCH 002 of 7] md: Don't write more than is required of the last page of a bitmap

2007-05-20 Thread NeilBrown
It is possible that real data or metadata follows the bitmap without full page alignment. So limit the last write to be only the required number of bytes, rounded up to the hard sector size of the device. Signed-off-by: Neil Brown [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] ### Diffstat output

[PATCH 003 of 7] md: Fix bug with linear hot-add and elsewhere.

2007-05-20 Thread NeilBrown
Adding a drive to a linear array seems to have stopped working, due to changes elsewhere in md, and insufficient ongoing testing... So the patch to make linear hot-add work in the first place introduced a subtle bug elsewhere that interracts poorly with older version of mdadm. This fixes it all

[PATCH 004 of 7] md: Improve message about invalid superblock during autodetect.

2007-05-20 Thread NeilBrown
People try to use raid auto-detect with version-1 superblocks (which is not supported) and get confused when they are told they have an invalid superblock. So be more explicit, and say it it is not a valid v0.90 superblock. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output

[PATCH 005 of 7] md: Improve the is_mddev_idle test fix

2007-05-20 Thread NeilBrown
Don't use 'unsigned' variable to track sync vs non-sync IO, as the only thing we want to do with them is a signed comparison, and fix up the comment which had become quite wrong. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c | 35

[PATCH 006 of 7] md: Check that internal bitmap does not overlap other data.

2007-05-20 Thread NeilBrown
We current completely trust user-space to set up metadata describing an consistant array. In particlar, that the metadata, data, and bitmap do not overlap. But userspace can be buggy, and it is better to report an error than corrupt data. So put in some appropriate checks. Signed-off-by: Neil

[PATCH 007 of 7] md: Change bitmap_unplug and others to void functions.

2007-05-20 Thread NeilBrown
bitmap_unplug only ever returns 0, so it may as well be void. Two callers try to print a message if it returns non-zero, but that message is already printed by bitmap_file_kick. write_page returns an error which is not consistently checked. It always causes BITMAP_WRITE_ERROR to be set on an

[PATCH 000 of 2] md: Two more bugfixes.

2007-05-10 Thread NeilBrown
Following are two bugfixes for md in current kernels. The first is suitable for -stable is it can allow drive errors through to the filesystem wrongly. Both are suitable for 2.6.22. Thanks, NeilBrown [PATCH 001 of 2] md: Avoid a possibility that a read error can wrongly propagate through md

[PATCH 001 of 2] md: Avoid a possibility that a read error can wrongly propagate through md/raid1 to a filesystem.

2007-05-10 Thread NeilBrown
When a raid1 has only one working drive, we want read error to propagate up to the filesystem as there is no point failing the last drive in an array. Currently the code perform this check is racy. If a write and a read a both submitted to a device on a 2-drive raid1, and the write fails

[PATCH 002 of 2] md: Improve the is_mddev_idle test

2007-05-10 Thread NeilBrown
During a 'resync' or similar activity, md checks if the devices in the array are otherwise active and winds back resync activity when they are. This test in done in is_mddev_idle, and it is somewhat fragile - it sometimes thinks there is non-sync io when there isn't. The test compares the total

[PATCH 000 of 5] md: assorted bug fixes and minor features

2007-05-07 Thread NeilBrown
Following are 5 patches for md suitable for 2.6.22. None are needed for -stable. Thanks NeilBrown [PATCH 001 of 5] md: Move test for whether level supports bitmap to correct place. [PATCH 002 of 5] md: Stop using csum_partial for checksum calculation in md. [PATCH 003 of 5] md: Remove

[PATCH 001 of 5] md: Move test for whether level supports bitmap to correct place.

2007-05-07 Thread NeilBrown
We need to check for internal-consistency of superblock in load_super. validate_super is for inter-device consistency. With the test in the wrong place, a badly created array will confuse md rather an produce sensible errors. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output

[PATCH 003 of 5] md: Remove the slash from the name of a kmem_cache used by raid5.

2007-05-07 Thread NeilBrown
SLUB doesn't like slashes as it wants to use the cache name as the name of a directory (or symlink) in sysfs. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff .prev/drivers/md/raid5.c

[PATCH 004 of 5] md: Allow reshape_position for md arrays to be set via sysfs.

2007-05-07 Thread NeilBrown
reshape_position records how much progress has been made on a reshape (adding drives, changing layout or chunksize). When it is set, the number of drives, layout and chunksize can have two possible values, an old an a new. So allow these different values to be visible, and allow both old and

[PATCH 005 of 5] md: Improve partition detection in md array.

2007-05-07 Thread NeilBrown
md currently uses -media_changed to make sure rescan_partitions is call on md array after they are assembled. However that doesn't happen until the array is opened, which is later than some people would like. So use blkdev_ioctl to do the rescan immediately that the array has been assembled.

[PATCH 002 of 5] md: Stop using csum_partial for checksum calculation in md.

2007-05-07 Thread NeilBrown
If CONFIG_NET is not selected, csum_partial is not exported, so md.ko cannot use it. We shouldn't really be using csum_partial anyway as it is an internal-to-networking interface. So replace it with C code to do the same thing. Speed is not crucial here, so something simple and correct is best.

[PATCH] md: Avoid a deadlock when removing a device from an md array via sysfs.

2007-04-02 Thread NeilBrown
(This patch should go in 2.6.21 as it fixes a recent regression - NB) A device can be removed from an md array via e.g. echo remove /sys/block/md3/md/dev-sde/state This will try to remove the 'dev-sde' subtree which will deadlock since commit e7b0d26a86943370c04d6833c6edba2a72a6e240 With

[PATCH 000 of 3] md: bug fixes for md for 2.6.21

2007-03-22 Thread NeilBrown
A minor new feature and 2 bug fixes for md suitable for 2.6.21 The minor feature is to make reshape (adding a drive to an array and restriping it) work for raid4. The code is all ready, it just wasn't used. Thanks, NeilBrown [PATCH 001 of 3] md: Allow raid4 arrays to be reshaped. [PATCH 002

[PATCH 001 of 3] md: Allow raid4 arrays to be reshaped.

2007-03-22 Thread NeilBrown
All that is missing the the function pointers in raid4_pers. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c |4 1 file changed, 4 insertions(+) diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c --- .prev/drivers/md/raid5.c2007-03-23

[PATCH 002 of 3] md: Clear the congested_fn when stopping a raid5

2007-03-22 Thread NeilBrown
If this mddev and queue got reused for another array that doesn't register a congested_fn, this function would get called incorretly. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c|1 + ./drivers/md/raid5.c |3 ++- 2 files changed, 3

[PATCH 003 of 3] md: Convert compile time warnings into runtime warnings.

2007-03-22 Thread NeilBrown
... still not sure why we need this Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c| 41 +++-- ./drivers/md/raid5.c | 12 ++-- 2 files changed, 41 insertions(+), 12 deletions(-) diff

[PATCH] md: Fix for raid6 reshape.

2007-03-01 Thread NeilBrown
### Comments for Changeset Recent patch for raid6 reshape had a change missing that showed up in subsequent review. Many places in the raid5 code used conf-raid_disks-1 to mean number of data disks. With raid6 that had to be changed to conf-raid_disk - conf-max_degraded or similar. One place

[PATCH 000 of 6] md: Assorted fixes and features for md for 2.6.21

2007-02-19 Thread NeilBrown
with the hardware-xor patches - one line of context is different. Patch 1 should probably go in -stable - the bug could cause data corruption in a fairly uncommon raid10 configuration, so that one and this intro are Cc:ed to [EMAIL PROTECTED] Thanks, NeilBrown [PATCH 001 of 6] md: Fix raid10 recovery problem

[PATCH 001 of 6] md: Fix raid10 recovery problem.

2007-02-19 Thread NeilBrown
There are two errors that can lead to recovery problems with raid10 when used in 'far' more (not the default). Due to a '' instead of '=' the wrong block is located which would result in garbage being written to some random location, quite possible outside the range of the device, causing the

[PATCH 003 of 6] md: Move warning about creating a raid array on partitions of the one device.

2007-02-19 Thread NeilBrown
md tries to warn the user if they e.g. create a raid1 using two partitions of the same device, as this does not provide true redundancy. However it also warns if a raid0 is created like this, and there is nothing wrong with that. At the place where the warning is currently printer, we don't

[PATCH 004 of 6] md: Clean out unplug and other queue function on md shutdown

2007-02-19 Thread NeilBrown
The mddev and queue might be used for another array which does not set these, so they need to be cleared. Signed-off-by: NeilBrown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c |3 +++ 1 file changed, 3 insertions(+) diff .prev/drivers/md/md.c ./drivers/md/md.c --- .prev/drivers

[PATCH 002 of 6] md: RAID6: clean up CPUID and FPU enter/exit code

2007-02-19 Thread NeilBrown
From: H. Peter Anvin [EMAIL PROTECTED] - Use kernel_fpu_begin() and kernel_fpu_end() - Use boot_cpu_has() for feature testing even in userspace Signed-off-by: H. Peter Anvin [EMAIL PROTECTED] Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid6mmx.c | 16 ---

[PATCH 005 of 6] md: Restart a (raid5) reshape that has been aborted due to a read/write error.

2007-02-19 Thread NeilBrown
An error always aborts any resync/recovery/reshape on the understanding that it will immediately be restarted if that still makes sense. However a reshape currently doesn't get restarted. With this patch it does. To avoid restarting when it is not possible to do work, we call into the

[PATCH 006 of 6] md: Add support for reshape of a raid6

2007-02-19 Thread NeilBrown
i.e. one or more drives can be added and the array will re-stripe while on-line. Most of the interesting work was already done for raid5. This just extends it to raid6. mdadm newer than 2.6 is needed for complete safety, however any version of mdadm which support raid5 reshape will do a good

[PATCH] md: Fix potential memalloc deadlock in md

2007-01-24 Thread NeilBrown
Another md patch suitable for 2.6.20. Thanks, NeilBrown ### Comments for Changeset If a GFP_KERNEL allocation is attempted in md while the mddev_lock is held, it is possible for a deadlock to eventuate. This happens if the array was marked 'clean', and the memalloc triggers a write-out

[PATCH] md: Remove unnecessary printk when raid5 gets an unaligned read.

2007-01-24 Thread NeilBrown
One more... (sorry about the dribs-and-drabs approach) NeilBrown ### Comments for Changeset raid5_mergeable_bvec tries to ensure that raid5 never sees a read request that does not fit within just one chunk. However as we must always accept a single-page read, that is not always possible. So

[PATCH 000 of 4] md: Introduction - Assorted bugfixes

2007-01-22 Thread NeilBrown
Following are 4 patches suitable for inclusion in 2.6.20. Thanks, NeilBrown [PATCH 001 of 4] md: Update email address and status for MD in MAINTAINERS. [PATCH 002 of 4] md: Make 'repair' actually work for raid1. [PATCH 003 of 4] md: Make sure the events count in an md array never returns

[PATCH 001 of 4] md: Update email address and status for MD in MAINTAINERS.

2007-01-22 Thread NeilBrown
Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./MAINTAINERS |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff .prev/MAINTAINERS ./MAINTAINERS --- .prev/MAINTAINERS 2007-01-23 11:14:14.0 +1100 +++ ./MAINTAINERS 2007-01-23 11:23:03.0

[PATCH 004 of 4] md: Avoid reading past the end of a bitmap file.

2007-01-22 Thread NeilBrown
In most cases we check the size of the bitmap file before reading data from it. However when reading the superblock, we always read the first PAGE_SIZE bytes, which might not always be appropriate. So limit that read to the size of the file if appropriate. Also, we get the count of available

[PATCH 002 of 4] md: Make 'repair' actually work for raid1.

2007-01-22 Thread NeilBrown
When 'repair' finds a block that is different one the various parts of the mirror. it is meant to write a chosen good version to the others. However it currently writes out the original data to each. The memcpy to make all the data the same is missing. Signed-off-by: Neil Brown [EMAIL

[PATCH 003 of 4] md: Make sure the events count in an md array never returns to zero.

2007-01-22 Thread NeilBrown
Now that we sometimes step the array events count backwards (when transitioning dirty-clean where nothing else interesting has happened - so that we don't need to write to spares all the time), it is possible for the event count to return to zero, which is potentially confusing and triggers and

[PATCH] md: Fix a few problems with the interface (sysfs and ioctl) to md.

2006-12-20 Thread NeilBrown
Following patch is suitable for 2.6.20. It fixes some minor bugs that need to be fix in order to use new functionality in mdadm-2.6. Thanks, NeilBrown ### Comments for Changeset While developing more functionality in mdadm I found some bugs in md... - When we remove a device from an inactive

[PATCH] md: Don't assume that READ==0 and WRITE==1 - use the names explicitly.

2006-12-11 Thread NeilBrown
### Comments for Changeset Thanks Jens for alerting me to this. Cc: Jens Axboe [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/faulty.c |2 +- ./drivers/md/raid1.c |2 +- ./drivers/md/raid10.c |6 +++---

[PATCH 000 of 5] md: Assorted minor fixes for mainline

2006-12-07 Thread NeilBrown
Following are 5 patches for md in 2.6.19-rc6-mm2 that are suitable for 2.6.20. Patch 4 might fix an outstanding bug against md which manifests as an oops early in boot, but I don't have test results yet. NeilBrown [PATCH 001 of 5] md: Remove some old ifdefed-out code from raid5.c [PATCH 002

[PATCH 004 of 5] md: Close a race between destroying and recreating an md device.

2006-12-07 Thread NeilBrown
For each md device, we need a gendisk. As that gendisk has a name that gets registered in sysfs, we need to make sure that when an md device is shut down, we don't create it again until the shutdown is complete and the gendisk has been deleted. This patches utilises the disks_mutex to ensure

[PATCH 003 of 5] md: Assorted md and raid1 one-liners

2006-12-07 Thread NeilBrown
Fix few bugs that meant that: - superblocks weren't alway written at exactly the right time (this could show up if the array was not written to - writting to the array causes lots of superblock updates and so hides these errors). - restarting device recovery after a clean shutdown

[PATCH 002 of 5] md: Return a non-zero error to bi_end_io as appropriate in raid5.

2006-12-07 Thread NeilBrown
Currently raid5 depends on clearing the BIO_UPTODATE flag to signal an error to higher levels. While this should be sufficient, it is safer to explicitly set the error code as well - less room for confusion. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c

[PATCH 001 of 4] md: Fix innocuous bug in raid6 stripe_to_pdidx

2006-11-13 Thread NeilBrown
stripe_to_pdidx finds the index of the parity disk for a given stripe. It assumes raid5 in that it uses disks-1 to determine the number of data disks. This is incorrect for raid6 but fortunately the two usages cancel each other out. The only way that 'data_disks' affects the calculation of

[PATCH 000 of 4] md: Various fixes for new cache-bypassing-reads in raid5/6

2006-11-13 Thread NeilBrown
and a few other bugs I found while re-reviewing and re-testing this code. There are actually about 9 separate bugs here, but I grouped some of them to avoid having lots of tiny patches. NeilBrown [PATCH 001 of 4] md: Fix innocuous bug in raid6 stripe_to_pdidx [PATCH 002 of 4] md: Fix newly

[PATCH 003 of 4] md: Misc fixes for aligned-read handling.

2006-11-13 Thread NeilBrown
1/ When aligned requests fail (read error) they need to be retried via the normal method (stripe cache). As we cannot be sure that we can process a single read in one go (we may not be able to allocate all the stripes needed) we store a bio-being-retried and a list of

[PATCH 002 of 4] md: Fix newly introduced read-corruption with raid6.

2006-11-13 Thread NeilBrown
chunk_aligned_read and retry_aligned_read assume that data_disks == raid_disks - 1 which is not true for raid6. So when an aligned read request bypasses the cache, we can get the wrong data. Also change the calculate of raid_disks in compute_blocknr to make it more obviously correct.

[PATCH 004 of 4] md: Fix a couple more bugs in raid5/6 aligned reads

2006-11-13 Thread NeilBrown
1/ We don't de-reference the rdev when the read completes. This means we need to record the rdev to so it is still available in the end_io routine. Fortunately bi_next in the original bio is unused at this point so we can stuff it in there. 2/ We leak a cloned by if the target rdev

[PATCH 002 of 9] md: Fix sizing problem with raid5-reshape and CONFIG_LBD=n

2006-11-07 Thread NeilBrown
I forgot to has the size-in-blocks to (loff_t) before shifting up to a size-in-bytes. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c ---

[PATCH 008 of 9] md: Allow reads that have bypassed the cache to be retried on failure.

2006-11-07 Thread NeilBrown
From: Raz Ben-Jehuda(caro) [EMAIL PROTECTED] If a bypass-the-cache read fails, we simply try again through the cache. If it fails again it will trigger normal recovery precedures. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c | 150

[PATCH 005 of 9] md: Change lifetime rules for 'md' devices.

2006-11-07 Thread NeilBrown
Currently md devices are created when first opened and remain in existence until the module is unloaded. This isn't a major problem, but it somewhat ugly. This patch changes the lifetime rules so that an md device will disappear on the last close if it has no state. Locking rules depend on

[PATCH 007 of 9] md: Handle bypassing the read cache (assuming nothing fails).

2006-11-07 Thread NeilBrown
From: Raz Ben-Jehuda(caro) [EMAIL PROTECTED] Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c | 78 +++ 1 file changed, 78 insertions(+) diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c ---

[PATCH 006 of 9] md: Define raid5_mergeable_bvec

2006-11-07 Thread NeilBrown
From: Raz Ben-Jehuda(caro) [EMAIL PROTECTED] This will encourage read request to be on only one device, so we will often be able to bypass the cache for read requests. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c | 24 1 file

[PATCH 004 of 9] md: Tidy up device-change notification when an md array is stopped

2006-11-07 Thread NeilBrown
An md array can be stopped leaving all the setting still in place, or it can torn down and destroyed. set_capacity and other change notifications only happen in the latter case, but should happen in both. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c | 10

[PATCH 001 of 9] md: Change ONLINE/OFFLINE events to a single CHANGE event

2006-11-07 Thread NeilBrown
It turns out that CHANGE is preferred to ONLINE/OFFLINE for various reasons (not least of which being that udev understands it already). So remove the recently added KOBJ_OFFLINE (no-one is likely to care anyway) and change the ONLINE to a CHANGE event Cc: Kay Sievers [EMAIL PROTECTED]

[PATCH 009 of 9] md: Enable bypassing cache for reads.

2006-11-07 Thread NeilBrown
From: Raz Ben-Jehuda(caro) [EMAIL PROTECTED] Call the chunk_aligned_read where appropriate. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c |5 + 1 file changed, 5 insertions(+) diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c ---

[PATCH 003 of 9] md: Do not freeze md threads for suspend.

2006-11-07 Thread NeilBrown
From: Rafael J. Wysocki [EMAIL PROTECTED] If there's a swap file on a software RAID, it should be possible to use this file for saving the swsusp's suspend image. Also, this file should be available to the memory management subsystem when memory is being freed before the suspend image is

[PATCH 002 of 6] md: Change lifetime rules for 'md' devices.

2006-10-30 Thread NeilBrown
Currently md devices are created when first opened and remain in existence until the module is unloaded. This isn't a major problem, but it somewhat ugly. This patch changes the lifetime rules so that an md device will disappear on the last close if it has no state. Locking rules depend on

[PATCH 005 of 6] md: Allow reads that have bypassed the cache to be retried on failure.

2006-10-30 Thread NeilBrown
If a bypass-the-cache read fails, we simply try again through the cache. If it fails again it will trigger normal recovery precedures. cc: Raz Ben-Jehuda(caro) [EMAIL PROTECTED] Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c | 150

[PATCH 003 of 6] md: Define raid5_mergeable_bvec

2006-10-30 Thread NeilBrown
This will encourage read request to be on only one device, so we will often be able to bypass the cache for read requests. cc: Raz Ben-Jehuda(caro) [EMAIL PROTECTED] Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c | 24 1 file

[PATCH 006 of 6] md: Enable bypassing cache for reads.

2006-10-30 Thread NeilBrown
Call the chunk_aligned_read where appropriate. cc: Raz Ben-Jehuda(caro) [EMAIL PROTECTED] Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c |5 + 1 file changed, 5 insertions(+) diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c ---

[PATCH 004 of 6] md: Handle bypassing the read cache (assuming nothing fails).

2006-10-30 Thread NeilBrown
cc: Raz Ben-Jehuda(caro) [EMAIL PROTECTED] Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/raid5.c | 78 +++ 1 file changed, 78 insertions(+) diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c ---

[PATCH 000 of 4] md: assorted bugfixes - one serious.

2006-10-23 Thread NeilBrown
I rang my regression test suite on md for the first time in a while (obviously too long :-(). Found two bugs resulting in patches 1 and 3. Others are fixes for more subtle issues. All patches are suitable for 2.6.19, patch 1 is quite serious and should go in 2.6.18.2. Thanks, NeilBrown

[PATCH 001 of 4] md: Fix bug where spares don't always get rebuilt properly when they become live.

2006-10-23 Thread NeilBrown
If save_raid_disk is = 0, then the device could be a device that is already in sync that is being re-added. So we need to default this value to -1. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/md.c |1 + 1 file changed, 1 insertion(+) diff

[PATCH 003 of 4] md: Fix up maintenance of -degraded in multipath.

2006-10-23 Thread NeilBrown
A recent fix which made sure -degraded was initialised properly exposed a second bug - -degraded wasn't been updated when drives failed or were hot-added. Signed-off-by: Neil Brown [EMAIL PROTECTED] ### Diffstat output ./drivers/md/multipath.c |2 ++ 1 file changed, 2 insertions(+) diff

  1   2   3   4   >