Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Poselenov <sposelenov@emcraft.com>
To: Richard Weinberger <richard@nod.at>
Cc: linux-mtd <linux-mtd@lists.infradead.org>
Subject: Re: UBIFS: file data corruption during the power cut-off test
Date: Sun, 09 Jun 2019 12:59:09 +0300	[thread overview]
Message-ID: <ac7d203471da8db3a148c207b586cae919304307.camel@emcraft.com> (raw)
In-Reply-To: <1957000286.85744.1560070414116.JavaMail.zimbra@nod.at>

On Sun, 2019-06-09 at 10:53 +0200, Richard Weinberger wrote:
> ----- Ursprüngliche Mail -----
> > Now, the question: why are these 512 bytes of zeros in test4?
> > 
> > Extrapolating to a real use case, consider a system writing a log
> > file
> > to the UBI partition. Power cutoff, recovery, and we have a garbage
> > at
> > the end of the log file. Is this expected?
> 
> Well, zero bytes are not garbage. ;)

I've seen some data in the last 512 bytes as well.

> But yes, this is is expected. In your case, I guess, the inode size
> does not match exactly what is present on flash.
> So the file size is 512 bytes too large, if you read too far, 0x0
> bytes are returned.
> During journal replay UBIFS tries to fixup file lengths but is
> approach
> does not work in all cases perfectly.
> 
> This case is actually documented, please see:
> http://www.linux-mtd.infradead.org/doc/ubifs.html#L_sync_semantics
> 
Thank you for the pointer. I'll look.

Regards,
Sergei
> Thanks,
> //richard
> 
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2019-06-09  9:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-06  9:10 UBIFS: file data corruption during the power cut-off test Sergei Poselenov
2019-06-06 14:55 ` Richard Weinberger
2019-06-06 18:08   ` Sergei Poselenov
2019-06-06 18:13     ` Richard Weinberger
2019-06-07 14:23       ` Sergei Poselenov
2019-06-07 16:01         ` Steve deRosier
2019-06-09  8:32           ` Sergei Poselenov
2019-06-09 15:25             ` Steve deRosier
2019-06-07 16:02         ` Richard Weinberger
2019-06-08  6:42           ` Sergei Poselenov
2019-06-08  8:46             ` Richard Weinberger
2019-06-09  8:18               ` Sergei Poselenov
2019-06-09  8:53                 ` Richard Weinberger
2019-06-09  9:59                   ` Sergei Poselenov [this message]
2019-06-09 10:00                     ` Richard Weinberger
2019-06-15  7:26                       ` Sergei Poselenov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ac7d203471da8db3a148c207b586cae919304307.camel@emcraft.com \
    --to=sposelenov@emcraft.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox