Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7279694d authored by NeilBrown's avatar NeilBrown Committed by Shaohua Li
Browse files

md/multipath: replace printk() with pr_*()



Also remove all messages about memory allocation failure.
page_alloc() reports those.

Signed-off-by: default avatarNeilBrown <neilb@suse.com>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent a2e202af
Loading
Loading
Loading
Loading
+33 −57
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ static int multipath_map (struct mpconf *conf)
	}
	rcu_read_unlock();

	printk(KERN_ERR "multipath_map(): no more operational IO paths?\n");
	pr_crit_ratelimited("multipath_map(): no more operational IO paths?\n");
	return (-1);
}

@@ -97,7 +97,7 @@ static void multipath_end_request(struct bio *bio)
		 */
		char b[BDEVNAME_SIZE];
		md_error (mp_bh->mddev, rdev);
		printk(KERN_ERR "multipath: %s: rescheduling sector %llu\n",
		pr_info("multipath: %s: rescheduling sector %llu\n",
			bdevname(rdev->bdev,b),
			(unsigned long long)bio->bi_iter.bi_sector);
		multipath_reschedule_retry(mp_bh);
@@ -194,8 +194,7 @@ static void multipath_error (struct mddev *mddev, struct md_rdev *rdev)
		 * first check if this is a queued request for a device
		 * which has just failed.
		 */
		printk(KERN_ALERT
		       "multipath: only one IO path left and IO error.\n");
		pr_warn("multipath: only one IO path left and IO error.\n");
		/* leave it active... it's all we have */
		return;
	}
@@ -210,10 +209,8 @@ static void multipath_error (struct mddev *mddev, struct md_rdev *rdev)
	}
	set_bit(Faulty, &rdev->flags);
	set_bit(MD_CHANGE_DEVS, &mddev->flags);
	printk(KERN_ALERT "multipath: IO failure on %s,"
	       " disabling IO path.\n"
	       "multipath: Operation continuing"
	       " on %d IO paths.\n",
	pr_err("multipath: IO failure on %s, disabling IO path.\n"
	       "multipath: Operation continuing on %d IO paths.\n",
	       bdevname(rdev->bdev, b),
	       conf->raid_disks - mddev->degraded);
}
@@ -223,19 +220,19 @@ static void print_multipath_conf (struct mpconf *conf)
	int i;
	struct multipath_info *tmp;

	printk("MULTIPATH conf printout:\n");
	pr_debug("MULTIPATH conf printout:\n");
	if (!conf) {
		printk("(conf==NULL)\n");
		pr_debug("(conf==NULL)\n");
		return;
	}
	printk(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded,
	pr_debug(" --- wd:%d rd:%d\n", conf->raid_disks - conf->mddev->degraded,
		 conf->raid_disks);

	for (i = 0; i < conf->raid_disks; i++) {
		char b[BDEVNAME_SIZE];
		tmp = conf->multipaths + i;
		if (tmp->rdev)
			printk(" disk%d, o:%d, dev:%s\n",
			pr_debug(" disk%d, o:%d, dev:%s\n",
				 i,!test_bit(Faulty, &tmp->rdev->flags),
				 bdevname(tmp->rdev->bdev,b));
	}
@@ -292,8 +289,7 @@ static int multipath_remove_disk(struct mddev *mddev, struct md_rdev *rdev)
	if (rdev == p->rdev) {
		if (test_bit(In_sync, &rdev->flags) ||
		    atomic_read(&rdev->nr_pending)) {
			printk(KERN_ERR "hot-remove-disk, slot %d is identified"
			       " but is still operational!\n", number);
			pr_warn("hot-remove-disk, slot %d is identified but is still operational!\n", number);
			err = -EBUSY;
			goto abort;
		}
@@ -346,14 +342,12 @@ static void multipathd(struct md_thread *thread)
		bio->bi_iter.bi_sector = mp_bh->master_bio->bi_iter.bi_sector;

		if ((mp_bh->path = multipath_map (conf))<0) {
			printk(KERN_ALERT "multipath: %s: unrecoverable IO read"
				" error for block %llu\n",
			pr_err("multipath: %s: unrecoverable IO read error for block %llu\n",
			       bdevname(bio->bi_bdev,b),
			       (unsigned long long)bio->bi_iter.bi_sector);
			multipath_end_bh_io(mp_bh, -EIO);
		} else {
			printk(KERN_ERR "multipath: %s: redirecting sector %llu"
				" to another IO path\n",
			pr_err("multipath: %s: redirecting sector %llu to another IO path\n",
			       bdevname(bio->bi_bdev,b),
			       (unsigned long long)bio->bi_iter.bi_sector);
			*bio = *(mp_bh->master_bio);
@@ -389,7 +383,7 @@ static int multipath_run (struct mddev *mddev)
		return -EINVAL;

	if (mddev->level != LEVEL_MULTIPATH) {
		printk("multipath: %s: raid level not set to multipath IO (%d)\n",
		pr_warn("multipath: %s: raid level not set to multipath IO (%d)\n",
			mdname(mddev), mddev->level);
		goto out;
	}
@@ -401,21 +395,13 @@ static int multipath_run (struct mddev *mddev)

	conf = kzalloc(sizeof(struct mpconf), GFP_KERNEL);
	mddev->private = conf;
	if (!conf) {
		printk(KERN_ERR
			"multipath: couldn't allocate memory for %s\n",
			mdname(mddev));
	if (!conf)
		goto out;
	}

	conf->multipaths = kzalloc(sizeof(struct multipath_info)*mddev->raid_disks,
				   GFP_KERNEL);
	if (!conf->multipaths) {
		printk(KERN_ERR
			"multipath: couldn't allocate memory for %s\n",
			mdname(mddev));
	if (!conf->multipaths)
		goto out_free_conf;
	}

	working_disks = 0;
	rdev_for_each(rdev, mddev) {
@@ -439,7 +425,7 @@ static int multipath_run (struct mddev *mddev)
	INIT_LIST_HEAD(&conf->retry_list);

	if (!working_disks) {
		printk(KERN_ERR "multipath: no operational IO paths for %s\n",
		pr_warn("multipath: no operational IO paths for %s\n",
			mdname(mddev));
		goto out_free_conf;
	}
@@ -447,25 +433,15 @@ static int multipath_run (struct mddev *mddev)

	conf->pool = mempool_create_kmalloc_pool(NR_RESERVED_BUFS,
						 sizeof(struct multipath_bh));
	if (conf->pool == NULL) {
		printk(KERN_ERR
			"multipath: couldn't allocate memory for %s\n",
			mdname(mddev));
	if (conf->pool == NULL)
		goto out_free_conf;
	}

	{
	mddev->thread = md_register_thread(multipathd, mddev,
					   "multipath");
		if (!mddev->thread) {
			printk(KERN_ERR "multipath: couldn't allocate thread"
				" for %s\n", mdname(mddev));
	if (!mddev->thread)
		goto out_free_conf;
		}
	}

	printk(KERN_INFO
		"multipath: array %s active with %d out of %d IO paths\n",
	pr_info("multipath: array %s active with %d out of %d IO paths\n",
		mdname(mddev), conf->raid_disks - mddev->degraded,
		mddev->raid_disks);
	/*