From: "Matthew L. Creech" <mlcreech@gmail.com>
To: linux-mtd@lists.infradead.org
Cc: dedekind1@gmail.com
Subject: [PATCH] UBIFS: document the "free space fixup" flag
Date: Thu, 19 May 2011 01:32:17 -0400 [thread overview]
Message-ID: <1305783137-13374-1-git-send-email-mlcreech@gmail.com> (raw)
In-Reply-To: <1305197870.2713.95.camel@localhost>
Several parts of the UBI and UBIFS documentation already mention the need to
use ubiformat when flashing UBIFS images. Add a new FAQ entry for the "free
space fixup" flag as an alternative in recent kernels, and put links to it in
these existing locations.
---
doc/ubi.xml | 6 ++++++
faq/ubi.xml | 8 +++++---
faq/ubifs.xml | 34 +++++++++++++++++++++++++++++++++-
3 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/doc/ubi.xml b/doc/ubi.xml
index d22884f..b3ca4ee 100644
--- a/doc/ubi.xml
+++ b/doc/ubi.xml
@@ -699,6 +699,12 @@ and the writes did not fail. But later we observed weird ECC errors. It took a
while to find out the problem. In other words, this is also relevant to JFFS2
images.</p>
+<p>An alternative to this approach is to enable the "free space fixup" option
+when generating the UBIFS file system using <code>mkfs.ubifs</code>. This will
+allow your flasher to not have to worry about <code>0xFF</code> bytes at the end
+of PEBs, which is particularly useful if you need to use an industrial flash
+programmer to write a UBI image. More information is available
+<a href="../faq/ubifs.html#L_free_space_fixup">here</a>.</p>
<h2><a name="L_torturing">Marking eraseblocks as bad</a></h2>
diff --git a/faq/ubi.xml b/faq/ubi.xml
index 8a48a48..f616cfe 100644
--- a/faq/ubi.xml
+++ b/faq/ubi.xml
@@ -567,9 +567,11 @@ any image, and check if you still have these errors.</p>
related to how you flash the UBI/UBIFS images. One typical problem is related
to ECC calculation algorithm - read
<a name="ubifs.html#L_why_ubiformat">here</a> for more information. Make sure
-that you use <a name="../doc/ubifs.html#L_usptools">ubiformat</a>), or make sure
-your flashing program skips 0xFF properly (see
-<a href="../doc/ubi.html#L_flasher_algo">here</a>).</p>
+that you use <a href="../doc/ubifs.html#L_usptools">ubiformat</a>, or make sure
+either that your flashing program skips <code>0xFF</code> properly (see
+<a href="../doc/ubi.html#L_flasher_algo">here</a>) or that your UBIFS image
+was generated with the "free space fixup" flag set (see
+<a href="ubifs.html#L_free_space_fixup">here</a>).</p>
<p>Another possibility is that your flash reports that it supports
<a href="../doc/ubi.html#L_subpage">sub-pages</a>, but does not actually support
diff --git a/faq/ubifs.xml b/faq/ubifs.xml
index f1e063c..6e010b5 100644
--- a/faq/ubifs.xml
+++ b/faq/ubifs.xml
@@ -20,6 +20,7 @@
<li><a href="ubifs.html#L_emptyflash">May an empty UBI volume be mounted?</a></li>
<li><a href="ubifs.html#L_max_leb_cnt">What is the purpose of -c (--max-leb-cnt) mkfs.ubifs option?</a></li>
<li><a href="ubifs.html#L_why_ubiformat">Why do I have to use ubiformat?</a></li>
+ <li><a href="ubifs.html#L_free_space_fixup">What is the the purpose of the -F (--space-fixup) mkfs.ubifs option?</a></li>
<li><a href="ubifs.html#L_mkfs_ubifs_comp">How do I compile mkfs.ubifs?</a></li>
<li><a href="ubifs.html#L_favor_lzo">What is "favor LZO" compression?</a></li>
<li><a href="ubifs.html#L_loop_mount">Can UBIFS mount loop-back devices?</a></li>
@@ -397,7 +398,9 @@ vol_flags=autoresize
(<a href="../doc/ubi.html#L_flasher_algo">here</a> you may find some
hints). Please, read
<a href="ubifs.html#L_why_ubiformat">this</a> section for more information
-why you should use <code>ubiformat</code>.</p>
+why you should use <code>ubiformat</code>, or generate your UBIFS images with
+the <a href="ubifs.html#L_free_space_fixup">free space fixup</a> flag if that
+is not possible.</p>
@@ -594,6 +597,35 @@ written once and only once after the erasure. If you use
<code>nandwrite</code>, some pages are written twice - once by
<code>nandwrite</code>, and once by UBIFS.</p>
+<p>If you can not use <code>ubiformat</code>, an alternative is to set the
+"free space fixup" flag when generating the UBIFS image (see
+<a href="ubifs.html#L_free_space_fixup">here</a>).</p>
+
+
+<h2><a name="L_free_space_fixup">What is the the purpose of the -F
+(--space-fixup) mkfs.ubifs option?</a></h2>
+
+<p>Because of subtle ECC errors that can arise when programming NAND flash
+(see <a href="ubifs.html#L_why_ubiformat">here</a>), <code>ubiformat</code>
+is the recommended way of flashing a UBI image which contains a UBIFS file
+system. However, this is not always possible - for example, some embedded
+devices are manufactured using an industrial NAND flash programmer which has
+no knowledge of UBI or UBIFS.</p>
+
+<p>The <code>-F</code> option causes <code>mkfs.ubifs</code> to set a special
+flag in the superblock, which triggers a "free space fixup" procedure in the
+kernel the very first time the filesystem is mounted. This fixup procedure
+involves finding all empty pages in the UBIFS file system and re-erasing them.
+This ensures that NAND pages which contain all <code>0xFF</code> data get
+fully erased, which removes any problematic non-<code>0xFF</code> data from
+their OOB areas.</p>
+
+<p>This option is supported if you are running a kernel version
+<code>2.6.40</code> or higher. Note that <code>ubiformat</code> is still the
+preferred flashing method if the image is not being flashed for the first time,
+since it preserves existing erase counters (while using <code>nandwrite</code>
+or its equivalent does not).</p>
+
<h2><a name="L_mkfs_ubifs_comp">How do I compile mkfs.ubifs?</a></h2>
--
1.7.4.1
next prev parent reply other threads:[~2011-05-19 5:32 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-06 22:58 [PATCH 0/2] UBIFS: Free space fixup on first mount Matthew L. Creech
2011-05-06 22:58 ` [PATCH 1/2] UBIFS: add the fixup function Matthew L. Creech
2011-05-12 10:33 ` Artem Bityutskiy
2011-05-18 20:47 ` [PATCH] UBIFS: don't fail on -EBADMSG when fixing free space Ben Gardiner
2011-05-18 20:47 ` Ben Gardiner
2011-05-18 21:41 ` Matthew L. Creech
2011-05-18 21:41 ` Matthew L. Creech
2011-05-19 13:28 ` Ben Gardiner
2011-05-19 13:28 ` Ben Gardiner
2011-05-19 15:59 ` Matthew L. Creech
2011-05-19 15:59 ` Matthew L. Creech
2011-05-20 6:21 ` Artem Bityutskiy
2011-05-20 6:21 ` Artem Bityutskiy
2011-05-20 6:29 ` Artem Bityutskiy
2011-05-20 6:29 ` Artem Bityutskiy
2011-05-24 14:33 ` Ben Gardiner
2011-05-24 14:33 ` Ben Gardiner
2011-05-06 22:58 ` [PATCH 2/2] UBIFS: fix-up free space on mount if flag is set Matthew L. Creech
2011-05-12 10:57 ` Artem Bityutskiy
2011-05-19 5:32 ` Matthew L. Creech [this message]
2011-05-20 9:24 ` [PATCH] UBIFS: document the "free space fixup" flag Artem Bityutskiy
2011-05-12 11:09 ` [PATCH 2/2] UBIFS: fix-up free space on mount if flag is set Artem Bityutskiy
2011-05-13 7:58 ` Artem Bityutskiy
2011-05-13 10:59 ` Atlant Schmidt
2011-05-13 12:02 ` Michael Cashwell
2011-05-13 12:29 ` Artem Bityutskiy
2011-05-13 12:34 ` Artem Bityutskiy
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=1305783137-13374-1-git-send-email-mlcreech@gmail.com \
--to=mlcreech@gmail.com \
--cc=dedekind1@gmail.com \
--cc=linux-mtd@lists.infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.