linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] FIX: Cannot remove failed disk from container
@ 2011-12-29 13:27 Adam Kwolek
  2012-01-02 23:31 ` NeilBrown
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Kwolek @ 2011-12-29 13:27 UTC (permalink / raw)
  To: neilb; +Cc: linux-raid, ed.ciechanowski, marcin.labun, dan.j.williams

When disk is failed by mdadm e.g.:
    mdadm -f /dev/md/raid_array /dev/sdX
and then it is tried to be removed from container e.g.:
    mdadm --remove /dev/md/container /dev/sdX

mdadm refuses it with information:
    mdadm: /dev/sdX is still in use, cannot remove.

Problem was introduced in commit:
    monitor: don't unblock a device that isn't blocked.
    /2011-12-06/
Disk without unblocking it cannot be really removed from array
and reference to if is still reported under 'holders' sysfs entry.

As this commit is necessary for managing degraded array during
reshape and rebuild code for unconditional unblocking disk on removal
is added.
Guard for setting DS_UNBLOCK during reshape/rebuild avoids process
performance degradation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
---

 monitor.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/monitor.c b/monitor.c
index 29bde18..ce66625 100644
--- a/monitor.c
+++ b/monitor.c
@@ -346,6 +346,12 @@ static int read_and_act(struct active_array *a)
 				a->next_state = active;
 			}
 			if (a->curr_state > readonly)
+				/* For disk removal when no md process
+				 * /e.g. reshape/ is in progress, trigger
+				 * unconditional device unblock first
+				 */
+				if (a->curr_action == idle)
+					mdi->next_state |= DS_UNBLOCK;
 				mdi->next_state |= DS_REMOVE;
 		}
 	}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-03  0:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-29 13:27 [PATCH] FIX: Cannot remove failed disk from container Adam Kwolek
2012-01-02 23:31 ` NeilBrown
2012-01-03  0:40   ` NeilBrown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).