From: Artem Bityutskiy <dedekind1@gmail.com>
To: Richard Genoud <richard.genoud@gmail.com>
Cc: linux-mtd@lists.infradead.org,
Shmulik Ladkani <shmulik.ladkani@gmail.com>
Subject: Re: [PATCH MTD-UTILS v2 4/4] ubiattach: fail if kernel ignores max_beb_per1024
Date: Thu, 23 Aug 2012 12:55:32 +0300 [thread overview]
Message-ID: <1345715732.2848.224.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <1345651477-5301-5-git-send-email-richard.genoud@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1055 bytes --]
On Wed, 2012-08-22 at 18:04 +0200, Richard Genoud wrote:
> If the kernel doesn't know the max_beb_per1024 parameter in the attach
> ioctl, but the call still succeeded ubi_attach and ubi_attach_mtd will
> return 1 instead of 0.
>
> In this case, the ubiattach command will detach the device and fail with
> an error message.
>
> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Pushed with some amendments, thanks!
> + } else if (err == 1) {
> + /*
> + * The kernel did not support the max_beb_per1024 parameter.
> + */
> + (void) ubi_detach_mtd(libubi, args.node, req.mtd_num);
> + errmsg("Your UBI driver does not allow changing the reserved PEBs count, probably you run an old kernel ? The support was added in kernel version 3.7.");
> + goto out_libubi;
Here I've removed the ubi_detach_mtd() call and the goto. Since we have
already spent energy for attaching, I think it is nicer to just print a
warning and not detach, and let the user decide if he wants to detach.
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2012-08-23 9:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 16:04 [PATCH MTD-UTILS v2 0/4] introduce max_beb_per1024 in UBI_IOCATT Richard Genoud
2012-08-22 16:04 ` [PATCH MTD-UTILS v2 1/4] libubi: factorize ubi_attach and ubi_attach_mtd code Richard Genoud
2012-08-23 9:27 ` Artem Bityutskiy
2012-08-22 16:04 ` [PATCH MTD-UTILS v2 2/4] sync include/mtd/ubi-user.h: add max_beb_per1024 parameter Richard Genoud
2012-08-23 9:27 ` Artem Bityutskiy
2012-08-22 16:04 ` [PATCH MTD-UTILS v2 3/4] ubiattach: introduce max_beb_per1024 in UBI_IOCATT Richard Genoud
2012-08-23 9:29 ` Artem Bityutskiy
2012-08-27 7:23 ` Richard Genoud
2012-08-27 9:39 ` Artem Bityutskiy
2012-08-27 10:19 ` Richard Genoud
2012-08-27 10:44 ` Artem Bityutskiy
2012-08-22 16:04 ` [PATCH MTD-UTILS v2 4/4] ubiattach: fail if kernel ignores max_beb_per1024 Richard Genoud
2012-08-23 9:55 ` Artem Bityutskiy [this message]
2012-08-23 10:01 ` Richard Genoud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1345715732.2848.224.camel@sauron.fi.intel.com \
--to=dedekind1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=richard.genoud@gmail.com \
--cc=shmulik.ladkani@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox