On Tue, May 2, 2017 at 11:43 AM, Vishal Verma <vishal.l.verma(a)intel.com> wrote:
On 05/02, Kani, Toshimitsu wrote:
> On Tue, 2017-05-02 at 09:18 -0700, Dave Jiang wrote:
> > > +-l::
> > > > +--len::
> > > > +The number of badblocks to clear in size of 512 bytes
> > > > increments. The
> > > > +length must fit within the badblocks range. If the length
> > > > exceeds the
> > > > +badblock range or is 0, the command will fail.
> > >
> > > Actually, I am seeing '-l 0' works just like '-l 1'.
> >
> > Oh now I remembered that Vishal requested that no length does 1 block
> > clear. Do you want me to correct documentation or behavior?
>
> What is the reason behind of his request?
Ah, so my intention/reasoning was if someone does a simple:
ndctl clear-error -s 'X'
without providing a -l argument, it should dimply clear that one block.
However I wouldn't think -l0 should clear one block, we should either
error out, or treat it as a dry-run (perhaps this could be an indirect
way to check if a certain block is in the badblocks list?)
Anyway, I'm not too attached to the "should work without providing a -l"
thing, and we can make -l mandatory again if that makes most sense.
I like that no "-l" option is equivalent to "-l 1". "-l 0"
should be
an error. I don't think we need a test or dry-run option if we just
have an interface to list all the error offsets relative to the given
device.