linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: "Bean Huo (beanhuo)" <beanhuo@micron.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	"Zoltan Szubbocsev (zszubbocsev)" <zszubbocsev@micron.com>,
	"tglx@linutronix.de" <tglx@linutronix.de>
Subject: Re: [PATCH V1] mtd: core: Micron SLC NAND filling block
Date: Wed, 19 Dec 2018 15:27:32 +0100	[thread overview]
Message-ID: <2816846.emhzHigZ4F@blindfold> (raw)
In-Reply-To: <BYAPR08MB4533AC4A07E48EC37576C060DBBE0@BYAPR08MB4533.namprd08.prod.outlook.com>

Am Mittwoch, 19. Dezember 2018, 12:03:06 CET schrieb Bean Huo (beanhuo):
> +#define PARTIAL_FILLING_CHECKUP 1 /* Used to turn on/off partial filling
> +		 block checkup before erasing this block.*/
> +#define LAST_CHECKPU_PAGE 13
> +struct ubifs_filling_head {
> +	__le32 magic;
> +	__le32 crc;
> +	__le64 sqnum;
> +	__le32 len;
> +	__u8 node_type;
> +	__u8 group_type;
> +	__u8 padding[2];
> +	__le32 pad_len;
> +} __packed;

I don't think this is needed anymore.

If you overwrite (sub)pages 0 and 1, UBI EC and VID headers are gone.
In case of a power-cut before the erase operation, UBI will detect the
corrupted EC and VID headers and re-erase the block.
For a fastmap attach the story is different, it does not track unmap/erase
operations. Therefore it will not notice that the block was scheduled for
erase and got corrupted by overwriting the first pages.
Users on top of UBIFS will face either ECC errors or UBIFS complains
about corrupted empty space.
This fastmap issue got fixed with:
781932375ffc ("ubi: fastmap: Correctly handle interrupted erasures in EBA")

So your ubifs_filling_head struct seems to work around an already fixed UBI
bug. :-)

Thanks,
//richard

  parent reply	other threads:[~2018-12-19 14:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19 11:03 [PATCH V1] mtd: core: Micron SLC NAND filling block Bean Huo (beanhuo)
2018-12-19 13:17 ` Boris Brezillon
2018-12-19 13:59   ` [EXT] " Zoltan Szubbocsev (zszubbocsev)
2018-12-19 14:17     ` Miquel Raynal
2018-12-19 17:19       ` Bean Huo (beanhuo)
2018-12-19 18:31         ` Richard Weinberger
2018-12-19 18:46         ` Boris Brezillon
2018-12-19 14:27 ` Richard Weinberger [this message]
2018-12-19 18:11   ` Bean Huo (beanhuo)
2018-12-19 18:28     ` Richard Weinberger
2018-12-19 18:44     ` Boris Brezillon
2018-12-19 22:29     ` Thomas Gleixner
2019-01-02 13:34       ` Bean Huo (beanhuo)

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=2816846.emhzHigZ4F@blindfold \
    --to=richard@nod.at \
    --cc=beanhuo@micron.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=tglx@linutronix.de \
    --cc=zszubbocsev@micron.com \
    /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;
as well as URLs for NNTP newsgroup(s).