[PATCH MTD-UTILS 5/5] ubiattach: introduce max_beb_per1024 in UBI_IOCATT

Shmulik Ladkani shmulik.ladkani at gmail.com
Wed Aug 22 08:31:56 EDT 2012


On Wed, 22 Aug 2012 15:15:15 +0300 Artem Bityutskiy <dedekind1 at gmail.com> wrote:
> On Wed, 2012-08-22 at 14:47 +0300, Shmulik Ladkani wrote:
> > But the ioctl might return -EINVAL due to any of the *other*
> > ubi_attach_req fields being invalid.
> > So you can't really determine whether max_beb_per1024 is supported.
> 
> We call the attach ioctl 2 times.
> 
> 1. Call it with bogus max_beb_per1024.
>    a) Success - print the warning and exit
>    b) Failure with non-EINVAL - overall failure.
>    c) Failure with -EINVAL, go to step 2.
> 
> 
> 2. Call with user-supplied max_beb_per1024.
>    a) Success - everything is fine, max_beb_per1024 is supported,
>       the first failure was because we passed max_beb_per1024=-1
>    b) Failure with non-EINVAL - overall failure.
>    b) Failure with -EINVAL, return error, the whole operation failed,
>       one of the parameters was incorrect.
> 
> Where is the flaw?

Sorry, this seems right. Should have given this more thought... will go
for some cofee.

Regards,
Shmulik



More information about the linux-mtd mailing list