]> git.baikalelectronics.ru Git - kernel.git/commit
md: manage redundancy group in sysfs when changing level.
authorNeilBrown <neilb@suse.de>
Wed, 14 Apr 2010 07:15:37 +0000 (17:15 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 17 May 2010 04:45:40 +0000 (14:45 +1000)
commit229a4a52a554ec97e51186e86ca0443f1ed79e68
tree077fcdab730d40227585025bf15bf8e027949a29
parent7ea4389d1cc1ce5b2121f0cdd49945a94dad3ff2
md: manage redundancy group in sysfs when changing level.

Some levels expect the 'redundancy group' to be present,
others don't.
So when we change level of an array we might need to
add or remove this group.

This requires fixing up the current practice of overloading ->private
to indicate (when ->pers == NULL) that something needs to be removed.
So create a new ->to_remove to fill that role.

When changing levels, we may need to add or remove attributes.  When
changing RAID5 -> RAID6, we both add and remove the same thing.  It is
important to catch this and optimise it out as the removal is delayed
until a lock is released, so trying to add immediately would cause
problems.

Cc: stable@kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c
drivers/md/md.h
drivers/md/raid5.c