md: Cleanup after raid45->raid0 takeover
authorKrzysztof Wojcik <krzysztof.wojcik@intel.com>
Wed, 20 Apr 2011 05:39:53 +0000 (15:39 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 20 Apr 2011 05:39:53 +0000 (15:39 +1000)
Problem:
After raid4->raid0 takeover operation, another takeover operation
(e.g raid0->raid10) results "kernel oops".
Root cause:
Variables 'degraded' in mddev structure is not cleared
on raid45->raid0 takeover.

This patch reset this variable.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/md.c

index 6e853c61d87eee47d66ddb7a510270f1c4cb2cbc..7d6f7f18a92052e3258ffeae719c377b2df4fb78 100644 (file)
@@ -3170,6 +3170,7 @@ level_store(mddev_t *mddev, const char *buf, size_t len)
        mddev->layout = mddev->new_layout;
        mddev->chunk_sectors = mddev->new_chunk_sectors;
        mddev->delta_disks = 0;
+       mddev->degraded = 0;
        if (mddev->pers->sync_request == NULL) {
                /* this is now an array without redundancy, so
                 * it must always be in_sync