md: do_md_run(): Fix misleading error message.
authorAndre Noll <maan@systemlinux.org>
Tue, 25 Mar 2008 23:07:03 +0000 (00:07 +0100)
committerNeil Brown <neilb@suse.de>
Tue, 8 Jul 2008 00:52:15 +0000 (10:52 +1000)
In case pers->run() succeeds but creating the bitmap fails, we
print an error message stating that pers->run() has failed.

Print this message only if pers->run() really failed.

Signed-off-by: Andre Noll <maan@systemlinux.org>
Signed-off-by: Neil Brown <neilb@suse.de>
drivers/md/md.c

index 80bcba9951c3bc3a900523c70aa2973830a4a3b8..b9d902652a519f2232961387de259cf6e480233f 100644 (file)
@@ -3675,7 +3675,9 @@ static int do_md_run(mddev_t * mddev)
                mddev->ro = 2; /* read-only, but switch on first write */
 
        err = mddev->pers->run(mddev);
-       if (!err && mddev->pers->sync_request) {
+       if (err)
+               printk(KERN_ERR "md: pers->run() failed ...\n");
+       else if (mddev->pers->sync_request) {
                err = bitmap_create(mddev);
                if (err) {
                        printk(KERN_ERR "%s: failed to create bitmap (%d)\n",
@@ -3684,7 +3686,6 @@ static int do_md_run(mddev_t * mddev)
                }
        }
        if (err) {
-               printk(KERN_ERR "md: pers->run() failed ...\n");
                module_put(mddev->pers->owner);
                mddev->pers = NULL;
                bitmap_destroy(mddev);