linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* UBIFS seeing corrupt blank pages when image flashed via u-boot
@ 2014-01-03 11:45 Gupta, Pekon
  2014-01-03 12:59 ` Artem Bityutskiy
  0 siblings, 1 reply; 13+ messages in thread
From: Gupta, Pekon @ 2014-01-03 11:45 UTC (permalink / raw)
  To: linux-mtd@lists.infradead.org, artem.bityutskiy@linux.intel.com
  Cc: u-boot@lists.denx.de

Hi All,

I have been facing a weird problem, may be someone has a solution.

*_Case-1_ Flashing UBIFS image from u-boot using 'nand write' utility*

For a partially written erased-block..
(a) 1st page is written with 'erase-header'
(b) 2nd page is written with 'volume-header'
(c) '3rd page' is written with 'some data'
(d) '4th to last-page of block' should be left blank, but they are written with 0xFF.
As a effect of (d), the ECC calculated for (all 0xff data) is written to
OOB area of all pages from 4th-page till last-page of the PEB.

As per my understanding, after mounting UBIFS as root, kernel tries to
append some data to some files in rootfs, due to which leftover pages (d)
get written by appended data, _without_ PEB getting erased.
This causes ECC bytes to get corrupted, because OOB of 'unused-pages'
was already written with ECC of (all 0xff data) by u-boot in step(d).
And on next reboot, kernel sees 'un-corrected ECC' errors while booting.


*_Case-2_ Flashing UBIFS image from kernel using 'ubiformat' utility*

Whereas when same image is flashed using 'ubiformat' utility, after booting
Kernel from other root source. 'ubiformat' automatically skips empty pages
(4th to last-page) in erased-block. Thus OOB area of pages from 4th-page
till last-page are un-touched.
Hence, when kernel 'appends' the rootfs files there is no ECC corruption
as the OOB area of 4th to last-page of PEB were blank. So everything works fine.


Now my queries:
(1) while _appending_ a file
  (a) does UBIFS writes appended data to same existing PEB, if there is
  enough space in PEB to accommodate new data ?
 OR
  (b) does UBIFS copies the existing data to newer PEB  along with the
   appended data ?

(2) In-case (b), then can someone point me to what can possibly be the issue ?
 (Any references to UBIFS docs on infradead.org may also help).


with regards, pekon

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-01-16  8:23 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-03 11:45 UBIFS seeing corrupt blank pages when image flashed via u-boot Gupta, Pekon
2014-01-03 12:59 ` Artem Bityutskiy
2014-01-03 13:05   ` Bityutskiy, Artem
2014-01-03 14:04   ` Stefano Babic
2014-01-07 17:30   ` Gupta, Pekon
2014-01-13 12:19   ` Calvin Johnson
2014-01-13 12:58     ` Artem Bityutskiy
2014-01-13 13:16       ` Gupta, Pekon
2014-01-13 15:06         ` Artem Bityutskiy
2014-01-15 21:29           ` Gupta, Pekon
2014-01-16  7:19             ` Artem Bityutskiy
2014-01-16  7:44               ` Gupta, Pekon
2014-01-16  8:22                 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).