Commit 663c6269 authored by Neil Brown's avatar Neil Brown Committed by Trond Myklebust

[PATCH] MD - Remove dead consistancy checking code from multipath.

Remove dead consistancy checking code from multipath.

This "consistancy_check" is carried over from raid1 on which multipath
was based, and was not used in raid1 and has since been removed.  Now
it gets removed from multipath too.
parent 82b0fad1
......@@ -700,83 +700,6 @@ static void multipathd (void *data)
#undef IO_ERROR
#undef REDIRECT_SECTOR
/*
* This will catch the scenario in which one of the multipaths was
* mounted as a normal device rather than as a part of a raid set.
*
* check_consistency is very personality-dependent, eg. RAID5 cannot
* do this check, it uses another method.
*/
static int __check_consistency (mddev_t *mddev, int row)
{
multipath_conf_t *conf = mddev_to_conf(mddev);
int disks = MD_SB_DISKS;
struct block_device *bdev;
int i, rc = 0;
char *buffer;
struct page *page = NULL;
int first = 1;
int order = PAGE_CACHE_SHIFT-PAGE_SHIFT;
buffer = (char *) __get_free_pages(GFP_KERNEL, order);
if (!buffer)
return rc;
for (i = 0; i < disks; i++) {
struct address_space *mapping;
char *p;
if (!conf->multipaths[i].operational)
continue;
printk("(checking disk %d)\n",i);
bdev = conf->multipaths[i].bdev;
mapping = bdev->bd_inode->i_mapping;
page = read_cache_page(mapping, row/(PAGE_CACHE_SIZE/1024),
(filler_t *)mapping->a_ops->readpage, NULL);
if (IS_ERR(page)) {
page = NULL;
break;
}
wait_on_page_locked(page);
if (!PageUptodate(page))
break;
if (PageError(page))
break;
p = page_address(page);
if (first) {
memcpy(buffer, p, PAGE_CACHE_SIZE);
first = 0;
} else if (memcmp(buffer, p, PAGE_CACHE_SIZE)) {
rc = 1;
break;
}
page_cache_release(page);
fsync_bdev(bdev);
invalidate_bdev(bdev, 0);
page = NULL;
}
if (page) {
bdev = page->mapping->host->i_bdev;
page_cache_release(page);
fsync_bdev(bdev);
invalidate_bdev(bdev, 0);
}
free_pages((unsigned long) buffer, order);
return rc;
}
static int check_consistency (mddev_t *mddev)
{
if (__check_consistency(mddev, 0))
/*
* we do not do this currently, as it's perfectly possible to
* have an inconsistent array when it's freshly created. Only
* newly written data has to be consistent.
*/
return 0;
return 0;
}
#define INVALID_LEVEL KERN_WARNING \
"multipath: md%d: raid level not set to multipath IO (%d)\n"
......@@ -963,17 +886,6 @@ static int multipath_run (mddev_t *mddev)
goto out_free_conf;
}
if ((sb->state & (1 << MD_SB_CLEAN))) {
/*
* we do sanity checks even if the device says
* it's clean ...
*/
if (check_consistency(mddev)) {
printk(SB_DIFFERENCES);
sb->state &= ~(1 << MD_SB_CLEAN);
}
}
{
const char * name = "multipathd";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment