From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qc0-f169.google.com ([209.85.216.169]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Y1ZFV-0004mO-0K for linux-mtd@lists.infradead.org; Thu, 18 Dec 2014 11:28:05 +0000 Received: by mail-qc0-f169.google.com with SMTP id w7so673889qcr.0 for ; Thu, 18 Dec 2014 03:27:42 -0800 (PST) Message-ID: <5492B9C0.2060904@vanguardiasur.com.ar> Date: Thu, 18 Dec 2014 08:25:52 -0300 From: Ezequiel Garcia MIME-Version: 1.0 To: Daniel Ehrenberg , "linux-mtd@lists.infradead.org" Subject: Re: [PATCH] UBI: block: Continue creating ubiblocks after an initialization error References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: grundler@chromium.org, Richard Weinberger , Gwendal Grignou List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 12/17/2014 08:16 PM, Daniel Ehrenberg wrote: > If one ubi volume is corrupted but another is not, it should be > possible to initialize that ubiblock from a kernel commandline which > includes both of them. This patch changes the error handling behavior > in initializing ubiblock to ensure that all parameters are attempted > even if one fails. If there is a failure, it returns one of the > error status codes. It also makes error messages more descriptive > by including the name of the UBI volume that failed. > > Tested: Formatted ubi volume /dev/ubi5_0 in a corrupt way and > dev/ubi3_0 properly and included "ubi.block=5,0 ubi.block=3,0" on > the kernel command line. At boot, I see the following in the console: > [ 21.082420] UBI error: ubiblock_create_from_param: block: can't > open volume on ubi5_0, err=-19 > [ 21.084268] UBI: ubiblock3_0 created from ubi3:0(rootfs) > > Signed-off-by: Dan Ehrenberg > --- > drivers/mtd/ubi/block.c | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c > index 8876c7d..32eeeee 100644 > --- a/drivers/mtd/ubi/block.c > +++ b/drivers/mtd/ubi/block.c > @@ -596,10 +596,11 @@ static int __init ubiblock_create_from_param(void) > Do you think we can add a comment here to explain how errors are treated? > desc = open_volume_desc(p->name, p->ubi_num, p->vol_id); > if (IS_ERR(desc)) { > - ubi_err("block: can't open volume, err=%ld\n", > - PTR_ERR(desc)); > + ubi_err( > + "block: can't open volume on ubi%d_%d, err=%ld", > + p->ubi_num, p->vol_id, PTR_ERR(desc)); Is it me, or this line break is unneeded here? Also, it seems something is wrong with the patch format. Patchwork shows some oddities: http://patchwork.ozlabs.org/patch/422408/ -- Ezequiel Garcia, VanguardiaSur www.vanguardiasur.com.ar