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

Richard Genoud richard.genoud at gmail.com
Wed Aug 22 07:38:16 EDT 2012


2012/8/22 Artem Bityutskiy <dedekind1 at gmail.com>:
> On Wed, 2012-08-22 at 14:30 +0300, Artem Bityutskiy wrote:
>> 1. Add a 'get device property' ioctl, similar to the 'set volume
>> property' ioctl we have. And use this ioctl to query the current bad
>> PEBs limit.
>>
>> 2. Just call the 'attach' ioctl with an insane max_beb_per1024 value
>> (say, -1) first. If it succeeded, than the driver does not support
>> max_beb_per1024 at all, and you may exit with a warning that you have
>> attached it, but the max_beb_per1024 was ignored because the kernel is
>> old.
>>
>> If it fails with -EINVAL, this means the kernel checked the value and
>> the feature is supported, so you can call it for the second time with
>> the right max_beb_per1024.
>>
>> The first approach is more complex but probably cleaner. The second is
>> easier to implement.
>
> I guess I prefer the second option, though. What do you think?
Well, for this one, we can go with the 2nd option, and if one day
there's another parameter, then we could implement the 'get device
property ioctl' for max_beb_per1024 and the new parameter.
How's that sound ?



More information about the linux-mtd mailing list