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

2008-01-13 Thread NeilBrown
Following are 6 patches for md which are suitable for 2.6.25-rc1. The first fixes a bug which could make it a candidate for 24-final. However it is a deadlock that seems to occur very rarely, and has been in mainline since 2.6.22. So letting it into one more release shouldn't be a big problem.

[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

Re: [PATCH 002 of 6] md: Fix use-after-free bug when dropping an rdev from an md array.

2008-01-13 Thread Neil Brown
On Monday January 14, [EMAIL PROTECTED] wrote: On Mon, Jan 14, 2008 at 12:45:31PM +1100, NeilBrown wrote: Due to possible deadlock issues we need to use a schedule work to kobject_del an 'rdev' object from a different thread. A recent change means that kobject_add no longer gets a

Re: [PATCH 002 of 6] md: Fix use-after-free bug when dropping an rdev from an md array.

2008-01-13 Thread Neil Brown
On Monday January 14, [EMAIL PROTECTED] wrote: On Mon, Jan 14, 2008 at 02:21:45PM +1100, Neil Brown wrote: Maybe it isn't there any more Once upon a time, when I echo remove /sys/block/mdX/md/dev-YYY/state Egads. And just what will protect you from parallel callers of

Re: [PATCH 002 of 6] md: Fix use-after-free bug when dropping an rdev from an md array.

2008-01-13 Thread Neil Brown
On Monday January 14, [EMAIL PROTECTED] wrote: Thanks. I'll see what I can some up with. How about this, against current -mm On both the read and write path for an rdev attribute, we call mddev_lock, first checking that mddev is not NULL. Once we get the lock, we check again. If rdev-mddev