[PATCH 009 of 12] md: Require CAP_SYS_ADMIN for (re-)configuring md devices via sysfs.

2006-06-27 Thread NeilBrown
The ioctl requires CAP_SYS_ADMIN, so sysfs should too. Note that we don't require CAP_SYS_ADMIN for reading attributes even though the ioctl does. There is no reason to limit the read access, and much of the information is already available via /proc/mdstat cc: Chris Wright <[EMAIL PROTECTED]>

[PATCH 000 of 12] md: Introduction

2006-06-27 Thread NeilBrown
Following are 12 assorted small patches for md. They are against 2.6.17-mm2 and are suitable for inclusion in 2.6.18. They are primarily small bug fixes, many fixing possible races, some of which have been seen in the wild, some not. Thanks, NeilBrown [PATCH 001 of 12] md: Possible fix for

[PATCH 006 of 12] md: Fix some small races in bitmap plugging in raid5.

2006-06-27 Thread NeilBrown
The comment gives more details, but I didn't quite have the sequencing write, so there was room for races to leave bits unset in the on-disk bitmap for short periods of time. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid5.c | 30 ++

[PATCH 008 of 12] md: Unify usage of symbolic names for perms.

2006-06-27 Thread NeilBrown
Some places we use number (0660) someplaces names (S_IRUGO). Change all numbers to be names, and change 0655 to be what it should be. Also make some formatting more consistent. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/md.c | 56 +

[PATCH 001 of 12] md: Possible fix for unplug problem

2006-06-27 Thread NeilBrown
I have reports of a problem with raid5 which turns out to be because the raid5 device gets stuck in a 'plugged' state. This shouldn't be able to happen as 3msec after it gets plugged it should get unplugged. However it happens none-the-less. This patch fixes the problem and is a reasonable thing

[PATCH 003 of 12] md: Delay starting md threads until array is completely setup.

2006-06-27 Thread NeilBrown
When an array is started we start one or two threads (two if there is a reshape or recovery that needs to be completed). We currently start these *before* the array is completely set up and in particular before queue->queuedata is set. If the thread actually starts very quickly on another CPU, w

[PATCH 005 of 12] md: Fix a plug/unplug race in raid5

2006-06-27 Thread NeilBrown
When a device is unplugged, requests are moved from one or two (depending on whether a bitmap is in use) queues to the main request queue. So whenever requests are put on either of those queues, we should make sure the raid5 array is 'plugged'. However we don't. We currently plug the raid5 queue

[PATCH 012 of 12] md: Include sector number in messages about corrected read errors.

2006-06-27 Thread NeilBrown
This is generally useful, but particularly helps see if it is the same sector that always needs correcting, or different ones. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid1.c |3 +++ ./drivers/md/raid10.c |4 ./drivers/md/raid5.c | 30

[PATCH 007 of 12] md: Fix usage of wrong variable in raid1

2006-06-27 Thread NeilBrown
Though it rarely matters, we should be using 's' rather than r1_bio->sector here. ### Diffstat output ./drivers/md/raid1.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff .prev/drivers/md/raid1.c ./drivers/md/raid1.c --- .prev/drivers/md/raid1.c2006-06-27 12:15:16.0 +1

[PATCH 004 of 12] md: Fix resync speed calculation for restarted resyncs.

2006-06-27 Thread NeilBrown
We introduced 'io_sectors' recently so we could count the sectors that causes io during resync separate from sectors which didn't cause IO - there can be a difference if a bitmap is being used to accelerate resync. However when a speed is reported, we find the number of sectors processed recently

[PATCH 010 of 12] md: Remove a variable that is now unused.

2006-06-27 Thread NeilBrown
Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid5.c |1 - 1 file changed, 1 deletion(-) diff .prev/drivers/md/raid5.c ./drivers/md/raid5.c --- .prev/drivers/md/raid5.c2006-06-27 12:17:33.0 +1000 +++ ./drivers/md/raid5.c2006-06-27 12:17

[PATCH 002 of 12] md: Set desc_nr correctly for version-1 superblocks.

2006-06-27 Thread NeilBrown
This has to be done in ->load_super, not ->validate_super Without this, hot-adding devices to an array doesn't always work right - though there is a work around in mdadm-2.5.2 to make this less of an issue. ### Diffstat output ./drivers/md/md.c |6 +- 1 file changed, 5 insertions(+), 1

[PATCH 011 of 12] md: Fix "Will Configure" message when interpreting md= kernel parameter.

2006-06-27 Thread NeilBrown
If a partitionable array is used, we should say e.g. Will configure md_d0 (super-block) from rather than Will configure md0 (super-block) from which implies non-partitionable. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./usr/kinit/do_mounts_md.c |4 ++--

[PATCH 000 of 9] md: Introduction - assorted cleanup and minor fixes

2006-07-31 Thread NeilBrown
Following are 9 patches for md in 2.6-mm-latest that should be targeted for 2.6.19 (not 2.6.18 material). Nothing really remarkable, so I'll leave to speak for themselves. NeilBrown [PATCH 001 of 9] md: The scheduled removal of the START_ARRAY ioctl for md [PATCH 002 of 9] md: Fix a co

[PATCH 001 of 9] md: The scheduled removal of the START_ARRAY ioctl for md

2006-07-31 Thread NeilBrown
-- -What: START_ARRAY ioctl for md -When: July 2006 -Files: drivers/md/md.c -Why: Not reliable by design - can fail when most needed. - Alternatives exist -Who: NeilBrown <[EMAIL PROTECTED]> - - What: eepro100 network driver When: January 2

[PATCH 002 of 9] md: Fix a comment that is wrong in raid5.h

2006-07-31 Thread NeilBrown
Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./include/linux/raid/raid5.h |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff .prev/include/linux/raid/raid5.h ./include/linux/raid/raid5.h --- .prev/include/linux/raid/raid5.h2006-07-31 16:33:02.0

[PATCH 005 of 9] md: Replace magic numbers in sb_dirty with well defined bit flags

2006-07-31 Thread NeilBrown
Instead of magic numbers (0,1,2,3) in sb_dirty, we have some flags instead: MD_CHANGE_DEVS Some device state has changed requiring superblock update on all devices. MD_CHANGE_CLEAN The array has transitions from 'clean' to 'dirty' or back, requiring a superblock update on active device

[PATCH 008 of 9] md: Remove working_disks from raid1 state data

2006-07-31 Thread NeilBrown
It is equivalent to conf->raid_disks - conf->mddev->degraded. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid1.c | 28 ./include/linux/raid/raid1.h |1 - 2 files changed, 12 insertions(+), 17 deletions(-) diff .prev

[PATCH 009 of 9] md: Improve locking around error handling.

2006-07-31 Thread NeilBrown
The error handling routines don't use proper locking, and so two concurrent errors could trigger a problem. So: - use test-and-set and test-and-clear to synchonise the In_sync bits with the ->degraded count - use the spinlock to protect updates to the degraded count (could use an atomi

[PATCH 006 of 9] md: Remove the working_disks and failed_disks from raid5 state data.

2006-07-31 Thread NeilBrown
They are not needed. conf->failed_disks is the same as mddev->degraded and conf->working_disks is conf->raid_disks - mddev->degraded. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid5.c | 20 ./include/linux/raid/raid5.h |2 +

[PATCH 003 of 9] md: Factor out part of raid1d into a separate function.

2006-07-31 Thread NeilBrown
raid1d has t many nested block, so take the fix_read_error functionality out into a separate function. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid1.c | 161 --- 1 file changed, 89 insertions(+), 72 dele

[PATCH 007 of 9] md: Remove 'working_disks' from raid10 state

2006-07-31 Thread NeilBrown
It isn't needed as mddev->degraded contains equivalent info. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid10.c | 12 ./include/linux/raid/raid10.h |1 - 2 files changed, 4 insertions(+), 9 deletions(-) diff .prev/drivers/md/raid10

[PATCH 004 of 9] md: Factor out part of raid10d into a separate function.

2006-07-31 Thread NeilBrown
raid10d has t many nested block, so take the fix_read_error functionality out into a separate function. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid10.c | 213 ++ 1 file changed, 115 insertions(+), 98 d

[PATCH] md: Fix a bug that recently crept into md/linear

2006-07-31 Thread NeilBrown
This patch fixed a bug in 2.6.18-rc3 It would be good if it can get into -final. Thanks, NeilBrown ### Comments for Changeset A recent patch that allowed linear arrays to be reconfigured on-line allowed in a bug which results in divide by zero - not all mddev->array_size were converted to c

[PATCH-stable16] Fix a potential NULL dereference in md/raid1

2006-08-20 Thread NeilBrown
patch for 2.6.16 stable series My applogies to people reading this with a window narrower than 111 characters :-( NeilBrown ### Comments for Changeset At the point where this 'atomic_add' is, rdev could be NULL, as seen by the fact that we test for this in the very next statement.

[PATCH] Fix a potential NULL dereference in md/raid1

2006-08-20 Thread NeilBrown
patch for 2.6.17 stable series. Thanks, NeilBrown ### Comments for Changeset At the point where this 'atomic_add' is, rdev could be NULL, as seen by the fact that we test for this in the very next statement. Further is it is really the wrong place of the add. We could add to th

[PATCH 000 of 2] md: Fix a bug with backward event updates.

2006-08-24 Thread NeilBrown
). Thanks, NeilBrown [PATCH 001 of 2] md: Avoid backward event updates in md superblock when degraded. [PATCH 002 of 2] md: replace magic numbers in sb_dirty with well defined bit flags - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message

[PATCH 001 of 2] md: Avoid backward event updates in md superblock when degraded.

2006-08-24 Thread NeilBrown
If we - shut down a clean array, - restart with one (or more) drive(s) missing - make some changes - pause, so that they array gets marked 'clean', the event count on the superblock of included drives will be the same as that of the removed drives. So adding the removed drive back in will

[PATCH 002 of 2] md: replace magic numbers in sb_dirty with well defined bit flags

2006-08-24 Thread NeilBrown
From: NeilBrown <[EMAIL PROTECTED]> Instead of magic numbers (0,1,2,3) in sb_dirty, we have some flags instead: MD_CHANGE_DEVS Some device state has changed requiring superblock update on all devices. MD_CHANGE_CLEAN The array has transitions from 'clean' to

[PATCH 000 of 4] md: Introduction

2006-08-24 Thread NeilBrown
can stripe out all the rcu-extra-carefulness as a separate patch and just leave the important bit which involves moving the atomic_add down twenty-something lines. Thanks, NeilBrown [PATCH 001 of 4] md: Fix recent breakage of md/raid1 array checking [PATCH 002 of 4] md: Fix issues with referencing

[PATCH 002 of 4] md: Fix issues with referencing rdev in md/raid1.

2006-08-24 Thread NeilBrown
We need to be careful when referencing mirrors[i].rdev. so it can disappear under us at various times. So: fix a couple of problem places. comment a couple of non-problem places move an 'atomic_add' which deferences rdev down a little way to some where where it is sure to not be NULL.

[PATCH 001 of 4] md: Fix recent breakage of md/raid1 array checking

2006-08-24 Thread NeilBrown
A recent patch broke the ability to do a user-request check of a raid1. This patch fixes the breakage and also moves a comment that was dislocated by the same patch. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid1.c |7 --- 1 file changed, 4 inserti

[PATCH 003 of 4] md: new sysfs interface for setting bits in the write-intent-bitmap

2006-08-24 Thread NeilBrown
From: Paul Clements <[EMAIL PROTECTED]> This patch (tested against 2.6.18-rc1-mm1) adds a new sysfs interface that allows the bitmap of an array to be dirtied. The interface is write-only, and is used as follows: echo "1000" > /sys/block/md2/md/bitmap (dirty the bit for chunk 1000 [offset 0]

[PATCH 004 of 4] md: Remove unnecessary variable x in stripe_to_pdidx().

2006-08-24 Thread NeilBrown
>From : Coywolf Qi Hunt <[EMAIL PROTECTED]> Signed-off-by: Coywolf Qi Hunt <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid5.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff .prev/drivers/md/raid5.c ./drivers/md/raid5

[PATCH 001 of 4] md: Fix issues with referencing rdev in md/raid1

2006-08-27 Thread NeilBrown
We need to be careful when referencing mirrors[i].rdev. so it can disappear under us at various times. So: fix a couple of problem places. comment a couple of non-problem places move an 'atomic_add' which deferences rdev down a little way to some where where it is sure to not be NULL.

[PATCH 000 of 4] md: Introduction - some revised/reordered patches.

2006-08-27 Thread NeilBrown
patch md-remove-working_disks-from-raid1-state-data.patch md-improve-locking-around-error-handling.patch The first one listed above was at the end of the list, and should go into 2.6.18. Thanks, NeilBrown - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body

[PATCH 003 of 4] md: Remove working_disks from raid1 state data

2006-08-27 Thread NeilBrown
From: NeilBrown <[EMAIL PROTECTED]> It is equivalent to conf->raid_disks - conf->mddev->degraded. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> --- drivers/md/raid1.c | 28 include/linux/raid/raid1.h |1 - 2 files changed,

[PATCH 002 of 4] md: Factor out part of raid1d into a separate function

2006-08-27 Thread NeilBrown
From: NeilBrown <[EMAIL PROTECTED]> raid1d has t many nested block, so take the fix_read_error functionality out into a separate function. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> --- drivers/md/raid1.c | 161 +++ 1 file changed, 8

[PATCH 004 of 4] md: Improve locking around error handling

2006-08-27 Thread NeilBrown
From: NeilBrown <[EMAIL PROTECTED]> The error handling routines don't use proper locking, and so two concurrent errors could trigger a problem. So: - use test-and-set and test-and-clear to synchonise the In_sync bits with the ->degraded count - use the spinlock to protect

[PATCH 001 of 4] md: Define backing_dev_info.congested_fn for raid0 and linear

2006-08-28 Thread NeilBrown
Each backing_dev needs to be able to report whether it is congested, either by modulating BDI_*_congested in ->state, or by defining a ->congested_fn. md/raid did neither of these. This patch add a congested_fn which simply checks all component devices to see if they are congested. Signed-off-by

[PATCH 000 of 4] md: Introduction

2006-08-28 Thread NeilBrown
ning. The last improves some messages when resync happens so e.g. it doesn't like your array is being resynced when you only asked for it to be checked. Thanks, NeilBrown [PATCH 001 of 4] md: Define backing_dev_info.congested_fn for raid0 and linear [PATCH 002 of 4] md: Define ->cong

[PATCH 004 of 4] md: Make messages about resync/recovery etc more specific.

2006-08-28 Thread NeilBrown
It is possible to request a 'check' of an md/raid array where the whole array is read and consistancies are reported. This uses the same mechanisms as 'resync' and so reports in the kernel logs that a resync is being started. This understandably confuses/worries people. Also the text in /proc/md

[PATCH 002 of 4] md: Define ->congested_fn for raid1, raid10, and multipath

2006-08-28 Thread NeilBrown
raid1, raid10 and multipath don't report their 'congested' status through bdi_*_congested, but should. This patch adds the appropriate functions which just check the 'congested' status of all active members (with appropriate locking). raid1 read_balance should be modified to prefer devices where

[PATCH 003 of 4] md: Add a ->congested_fn function for raid5/6

2006-08-28 Thread NeilBrown
This is very different from other raid levels and all requests go through a 'stripe cache', and it has congestion management already. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/raid5.c | 21 + 1 file changed, 21 insertions(+) diff .prev

[PATCH 001 of 6] md: Fix duplicity of levels in md.txt

2006-09-28 Thread NeilBrown
md.txt has two sections describing the 'level' sysfs attribute, and some of the text is out-of-date. So make just one section, and make it right. Cc: Christian Kujau <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./Documentation/md.txt | 17 +

[PATCH 003 of 6] md: Remove 'experimental' classification from raid5 reshape.

2006-09-28 Thread NeilBrown
I have had enough success reports not to believe that this is safe for 2.6.19. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/Kconfig | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff .prev/drivers/md/Kconfig ./drivers/md/Kconfig --- .pre

[PATCH 005 of 6] md: Allow SET_BITMAP_FILE to work on 64bit kernel with 32bit userspace.

2006-09-28 Thread NeilBrown
From: Paul Clements <[EMAIL PROTECTED]> Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./include/linux/compat_ioctl.h |1 + 1 file changed, 1 insertion(+) diff .prev/include/linux/compat_ioctl.h ./include/linux/compat_ioctl.h --- .prev/include/linux/compat_ioctl.h 2006-0

[PATCH 004 of 6] md: Use ffz instead of find_first_set to convert multiplier to shift.

2006-09-28 Thread NeilBrown
From: Paul Clements <[EMAIL PROTECTED]> find_first_set doesn't find the least-significant bit on bigendian machines, so it is really wrong to use it. ffs is closer, but takes an 'int' and we have a 'unsigned long'. So use ffz(~X) to convert a chunksize into a chunkshift. Signed-off-by: Neil Br

[PATCH 006 of 6] md: Add error reporting to superblock write failure

2006-09-28 Thread NeilBrown
Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/md.c |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff .prev/drivers/md/md.c ./drivers/md/md.c --- .prev/drivers/md/md.c 2006-09-29 11:49:00.0 +1000 +++ ./drivers/md/md.c 2006-09-29

[PATCH 002 of 6] md: Remove MAX_MD_DEVS which is an arbitrary limit.

2006-09-28 Thread NeilBrown
Once upon a time we needed to fixed limit to the number of md devices, probably because we preallocated some array. This need no longer exists, but we still have an arbitrary limit. So remove MAX_MD_DEVS and allow as many devices as we can fit into the 'minor' part of a device number. Also remov

[PATCH] md: Fix bug where new drives added to an md array sometimes don't sync properly.

2006-10-05 Thread NeilBrown
There is a nasty bug in md in 2.6.18 affecting at least raid1. This fixes it (and has already been sent to [EMAIL PROTECTED]). ### Comments for Changeset This fixes a bug introduced in 2.6.18. If a drive is added to a raid1 using older tools (mdadm-1.x or raidtools) then it will be included in

[PATCH 000 of 4] md: Introduction - bugfix patches for md.

2006-10-19 Thread NeilBrown
Following are 4 bugfix patches for md. The first is suitable for 2.6.18.2. All are suitable for 2.6.19. Thanks, NeilBrown [PATCH 001 of 4] md: Fix calculation of ->degraded for multipath and raid10 [PATCH 002 of 4] md: Add another COMPAT_IOCTL for md. [PATCH 003 of 4] md: Endian annotat

[PATCH 001 of 4] md: Fix calculation of ->degraded for multipath and raid10

2006-10-19 Thread NeilBrown
Two less-used md personalities have bugs in the calculation of ->degraded (the extent to which the array is degraded). Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/multipath.c |2 +- ./drivers/md/raid10.c|2 +- 2 files changed, 2 insertions(+), 2

[PATCH 003 of 4] md: Endian annotation for v1 superblock access.

2006-10-19 Thread NeilBrown
Includes a couple of bugfixed found by sparse. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/md.c | 13 + ./include/linux/raid/md_p.h | 58 ++-- 2 files changed, 36 insertions(+), 35 deletions(-) dif

[PATCH 004 of 4] md: Endian annotations for the bitmap superblock

2006-10-19 Thread NeilBrown
And a couple of bug fixes found by sparse. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/bitmap.c | 10 +- ./include/linux/raid/bitmap.h | 20 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff .prev/drivers/md/bitm

[PATCH 002 of 4] md: Add another COMPAT_IOCTL for md.

2006-10-19 Thread NeilBrown
.. so that you can use bitmaps with 32bit userspace on a 64 bit kernel. Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./include/linux/compat_ioctl.h |1 + 1 file changed, 1 insertion(+) diff .prev/include/linux/compat_ioctl.h ./include/linux/compat_ioctl.h --- .prev/in

[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 .prev/driver

[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(+) dif

[PATCH 002 of 4] md: Simplify checking of available size when resizing an array

2006-10-23 Thread NeilBrown
When "mdadm --grow --size=xxx" is used to resize an array (use more or less of each device), we check the new siza against the available space in each device. The already have that number recorded in rdev->size, so calculating it is pointless (and wrong in one obscure case). Signed-off-by: Neil

[PATCH 004 of 4] md: Fix printk format warnings, seen on powerpc64:

2006-10-23 Thread NeilBrown
From: Randy Dunlap <[EMAIL PROTECTED]> drivers/md/raid1.c:1479: warning: long long unsigned int format, long unsigned int arg (arg 4) drivers/md/raid10.c:1475: warning: long long unsigned int format, long unsigned int arg (arg 4) Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]> Signed-off-by: Ne

[PATCH] Check bio address after mapping through partitions.

2006-10-30 Thread NeilBrown
This would be good for 2.6.19 and even 18.2, if it is seens acceptable. raid0 at least (possibly other) can be made to Oops with a bad partition table and best fix seem to be to not let out-of-range request get down to the device. ### Comments for Changeset Partitions are not limited to live wit

[PATCH 000 of 6] md: udev events and cache bypass for reads

2006-10-30 Thread NeilBrown
sts. These patches are largely due to "Raz Ben-Jehuda(caro)" <[EMAIL PROTECTED]>. NeilBrown [PATCH 001 of 6] md: Send online/offline uevents when an md array starts/stops. [PATCH 002 of 6] md: Change lifetime rules for 'md' devices. [PATCH 003 of 6] md: Define raid5_

[PATCH 001 of 6] md: Send online/offline uevents when an md array starts/stops.

2006-10-30 Thread NeilBrown
This allows udev to do something intelligent when an array becomes available. cc: [EMAIL PROTECTED] Signed-off-by: Neil Brown <[EMAIL PROTECTED]> ### Diffstat output ./drivers/md/md.c |2 ++ 1 file changed, 2 insertions(+) diff .prev/drivers/md/md.c ./drivers/md/md.c --- .prev/drivers/md/m

[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 bd_mu

[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 fi

[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 --- .prev/drive

[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 --- .prev/drivers

[PATCH 000 of 9] md: udev notification, raid5 read improvements etc

2006-11-07 Thread NeilBrown
resends with attribution improved. Thanks, NeilBrown [PATCH 001 of 9] md: Change ONLINE/OFFLINE events to a single CHANGE event [PATCH 002 of 9] md: Fix sizing problem with raid5-reshape and CONFIG_LBD=n [PATCH 003 of 9] md: Do not freeze md threads for suspend. [PATCH 004 of 9] md: Tidy up

[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 --- .prev/d

[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 bd_mu

[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 --- .prev/driv

[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

[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 | 1

[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]> Signed-

[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 --- .prev/dri

[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 cr

[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 pd_

[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 bioes-that-stil

[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. Signed-

[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 i

[PATCH 001 of 5] md: Remove some old ifdefed-out code from raid5.c

2006-12-07 Thread NeilBrown
There are some vestiges of old code that was used for bypassing the stripe cache on reads in raid5.c. This was never updated after the change from buffer_heads to bios, but was left as a reminder. That functionality has nowe been implemented in a completely different way, so the old code can go.

[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 [PATC

[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 the

[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 (ve

[PATCH 005 of 5] md: Allow mddevs to live a bit longer to avoid a loop with udev.

2006-12-07 Thread NeilBrown
As md devices a automatically created on first open, and automatically destroyed on last close if they have no significant state, a loop can be caused with udev. If you open/close an md device that will generate add and remove events to udev. udev will open the device, notice nothing is there an

[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] 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 +++--- ./dri

[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 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 r

[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 +1

[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 b

[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 PROTECTE

[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 M

[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-

[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 6] md: Assorted fixes and features for md for 2.6.21

2007-02-19 Thread NeilBrown
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

  1   2   3   4   5   >