]> git.karo-electronics.de Git - karo-tx-linux.git/commit
md: refine interpretation of "hold_active == UNTIL_IOCTL".
authorNeilBrown <neilb@suse.de>
Wed, 9 Nov 2011 00:32:04 +0000 (11:32 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 9 Nov 2011 00:32:04 +0000 (11:32 +1100)
commit01e25c4bbe472652f4712dace37e42d6a8212c28
treecf077b38cbd7053c4915de20ebce66fc9b543615
parent257a4b42af7586fab4eaec7f04e6896b86551843
md: refine interpretation of "hold_active == UNTIL_IOCTL".

We like md devices to disappear when they really are not needed.
However it is not possible to tell from the current state whether it
is needed or not.  We can only tell from recent history of changes.

In particular immediately after we create an md device it looks very
similar to immediately after we have finished with it.

So we always preserve a newly created md device until something
significant happens.  This state is stored in 'hold_active'.

The normal case is to keep it until an ioctl happens, as that will
normally either activate it, or explicitly de-activate it.  If it
doesn't then it was probably created by mistake and it is now time to
get rid of it.

We can also modify an array via sysfs (instead of via ioctl) and we
currently treat any change via sysfs like an ioctl as a sign that if
it now isn't more active, it should be destroyed.
However this is not appropriate as changes made via sysfs are more
gradual so we should look for a more definitive change.

So this patch only clears 'hold_active' from UNTIL_IOCTL to clear when
the array_state is changed via sysfs.  Other changes via sysfs
are ignored.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c