]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
UBIFS: fix power cut emulation for mtdram
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 22 Aug 2012 14:35:11 +0000 (17:35 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Fri, 31 Aug 2012 14:32:38 +0000 (17:32 +0300)
commit8089ed792832e5d3dd219da435c5a08d969662b4
tree2d9b661683a9e687e308d90be791a61f13b8a18a
parent4b3e58a6d6c62b5457ff876fdfc79f66fff04cd2
UBIFS: fix power cut emulation for mtdram

The power cut emulation did not work correctly because we corrupted more than
one max. I/O unit in the buffer and then wrote the entire buffer. This lead to
recovery errors because UBIFS complained about corrupted free space. And this
was easily reproducible on mtdram because max. write size is very small there
(64 bytes), and we could easily have a 1KiB buffer, corrupt 128 bytes there,
and then write the entire buffer.

The fix is to corrupt max. write size bytes at most, and write only up to the
last corrupted max. write size chunk, not the entire buffer.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
fs/ubifs/debug.c