[PATCH MTD-UTILS 5/5] ubiattach: introduce max_beb_per1024 in UBI_IOCATT
Artem Bityutskiy
dedekind1 at gmail.com
Wed Aug 22 08:15:15 EDT 2012
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?
--
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/20120822/5f6e8e72/attachment.sig>
More information about the linux-mtd
mailing list