[PATCH v2 3/3] mtd: cmdlinepart: check the partitions
Artem Bityutskiy
dedekind1 at gmail.com
Tue Sep 4 04:50:31 EDT 2012
On Tue, 2012-09-04 at 16:25 +0800, Huang Shijie wrote:
> 于 2012年09月04日 16:19, Artem Bityutskiy 写道:
> > Just do
> >
> > if (ret)
> > return ret;
> >
> >
> > and kill the huge 'switch' that you added.
> If the cmdline have two mtd-ids such as:
>
> gpmi-nand:100m(root),100m at 100m(kernel),1g at 200m(rootfs);edb7212-nand:-(home)
>
> The `return` will also bypass the `edb7212-nand`.
>
> Is it acceptable?
I thought the whole idea is to refuse command lines which are ambiguous
or make no sense, no?
You could actually do this in two step and split your 3rd patch:
1. Add 'check_partitions' which prints an error messages and returns
-EINVAL if the command line has overlaps or gaps or other bad things.
But ignore the return code in 'mtdpart_setup_real()'
2. Make 'mtdpart_setup_real()' check for the error code and propagate it
up, so we'll have a prink + real refusal.
--
Best Regards,
Artem Bityutskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20120904/4110a0cc/attachment.sig>
More information about the linux-mtd
mailing list