public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* Help needed with corruption detection/ubifs_wbuf_sync_nolock
@ 2012-06-25 13:58 Reginald Perrin
  2012-06-25 14:48 ` Reginald Perrin
  2012-06-27 14:22 ` Artem Bityutskiy
  0 siblings, 2 replies; 5+ messages in thread
From: Reginald Perrin @ 2012-06-25 13:58 UTC (permalink / raw)
  To: MTD Mailing List

Hi folks,

I'm tracking down a corruption issue, and trying to trace back where LEB's are getting randomly corrupted in our system (a very rare event, but it can happen).  I'm focusing on ubifs/io.c, and trying to validate data before we send to ubi_leb_write().

Can somebody please clarify something for me on ubifs_wbuf_sync_nolock()?  I'm trying to validate that the data we're writing hasn't been corrupted.  I thought I could just check that the node-type was valid, such as:

    if ( ((struct ubifs_ch *)wbuf->buf)->node_type > UBIFS_ORPH_NODE ) {

        // ABORT WRITE
    }

    err = ubi_leb_write(c->ubi, wbuf->lnum, wbuf->buf, wbuf->offs,


This *seems* to work, but during our application start, it's actually triggering before we are reaching the troubled code, in code that really shouldn't have any issues.  I think this means I don't understand how wbuf relates to actual LEB nodes.

Can anybody help me understand how to check to see if the LEB is corrupted before we write?  I'm trying to get close enough to the corruption to get a backtrace.

TIA
RP

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

end of thread, other threads:[~2012-06-29 13:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-25 13:58 Help needed with corruption detection/ubifs_wbuf_sync_nolock Reginald Perrin
2012-06-25 14:48 ` Reginald Perrin
2012-06-27 14:23   ` Artem Bityutskiy
2012-06-27 14:22 ` Artem Bityutskiy
2012-06-29 13:40   ` Reginald Perrin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox