[PATCH v2] mtd-utils: integck: add support for volume specific power-cut test

Artem Bityutskiy dedekind1 at gmail.com
Tue May 27 07:55:45 PDT 2014

On Tue, 2014-05-27 at 14:15 +0000, Mats Kärrman wrote:
> Artem, 
> On Tuesday, May 27, 2014 2:37 PM, Artem Bityutskiy wrote:
> > But I think I see the problem with this solution now.
> >
> > The problem is that with this we won't get power cut emulated while you
> > mount the file system.
> >
> > Before this change, we could have something like:
> >
> > 1. Working with the FS, power-cut
> > 2. Unmount the FS, start mounting -> power-cut in the middle of mount.
> > 
> > So we could test power cuts while we are in the middle of recovery from
> > the previous power cuts, in a way "nested" power-cuts.
> > 
> > With your change, we never have them.
> With the old version we didn't get a power-cut at all, unless power-cuts
> were first globally enable by writing "1" to 
> /sys/kernel/debug/ubifs/tst_recovery.
> This is still possible!

Ah, yes, it is enabled _outside_ of the test. And with this patch, the
per-FS one is enabled _inside_ the test.

With this patch we have the following issues:

1. -p enables per-FS power cut emulation automatically, however, you
have bad coverage (the most problematic code in the UBIFS driver is
related to the "nested" cuts, IIRC)

2. For better coverage, you have to to manually enable global power

So, those who test UBIFS with nandsim, may mistakenly think -p is all
they need, and they miss a fair amount of coverage. Not good.

And we have an inconsistency: the test is able to touch the per-FS power
cuts debugfs files, which is nice and user-friendly, but the global
power cuts debugfs file has to be touched manually. Not nice.

How about this compromise solution which should be simple enough to
implement, but I am not sure it is good enough to you.

Change -p so that it takes an _argument_. The argument should be a path
to the debugfs file which controls the power cuts emulation. This can be
either global or the per-FS switch.

All the test will do is writing '1' to this file as soon as it starts,
and as soon as it mounts or re-mounts the FS.

Now, it is your choice which file path to give - the global or the

What do you think?

Best Regards,
Artem Bityutskiy

More information about the linux-mtd mailing list