[PATCH v6 1/3] ubi: Introduce block devices for UBI volumes
Ezequiel Garcia
ezequiel.garcia at free-electrons.com
Mon Feb 17 10:49:19 EST 2014
On Mon, Feb 17, 2014 at 05:10:14PM +0200, Artem Bityutskiy wrote:
> On Sun, 2014-02-16 at 17:03 -0300, Ezequiel Garcia wrote:
> > +static void __init ubiblock_add_from_param(void)
> > +{
> > + int i, ret;
> > + struct ubiblock_param *p;
> > + struct ubi_volume_desc *desc;
> > + struct ubi_volume_info vi;
> > +
> > + for (i = 0; i < ubiblock_devs; i++) {
> > + p = &ubiblock_param[i];
> > +
> > + desc = open_volume_desc(p->name, p->ubi_num, p->vol_id);
> > + if (IS_ERR(desc)) {
> > + ubi_warn("block: can't open volume, err=%ld\n",
> > + PTR_ERR(desc));
> > + continue;
> > + }
>
> Should we be consistent here with how UBI behaves when attaches MTD
> devices? UBI will error out if it cannot attach any. And for me it makes
> sense. Indeed, if, the user, say asked to attach 2 UBI volumes via the
> module parameter, surely the user expects to see 2 block device when
> module loading finishes without errors?
>
> What I read from this code means that even if loading finishes without
> errors, I may see zero or 1 block devices, depending on how many of them
> failed.
>
Good catch! This is wrong.
Thanks,
--
Ezequiel García, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
More information about the linux-mtd
mailing list