From: Xiaolei Li <xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
To: david.oberhollenzer-S6VGOU4v5edDinCvNWH78Q@public.gmane.org,
boris.brezillon-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org
Cc: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org
Subject: [PATCH 0/2] Fix Jffs2 type flash erase problem
Date: Mon, 9 Apr 2018 11:10:08 +0800 [thread overview]
Message-ID: <1523243410-65424-1-git-send-email-xiaolei.li@mediatek.com> (raw)
Jffs2 clean marker is not written actually, because OOB write length is
set to 0 when do mtd_write(). So, "-j" option of flash_erase is usless now.
This patch adds support to access OOB available size by
/sys/class/mtd/mtdX/oobavail. Then, user can write clean marker to OOB
free area with the minimum size between OOB available size and 8. This
is the same with Jffs2 itself. Please refer the function
jffs2_write_nand_cleanmarker() in the kernel file fs/jffs2/wbuf.c.
And this patch depends on the reviewing patch "mtd: Add sysfs attribute for
mtd OOB available size"[1].
Changes relative to:
--------------------
tree : https://github.com/sigma-star/mtd-utils
branch : master
commit :
'commit 80de29a464c7 ("mkfs.ubifs: Allow root entry in device
table")'
Tests:
------
* do "flash_erase -j" operation on SLC NAND MT29F16G08ADBCA, which page
size is 4096, oob size is 224.
* mount jffs2 file system, do "dd" test, and there is no problem.
[1] https://patchwork.kernel.org/patch/10319475/
Xiaolei Li (2):
libmtd: Add support to access OOB available size
misc-utils: flash_erase: Fix Jffs2 type flash erase problem
include/libmtd.h | 2 ++
lib/libmtd.c | 7 +++++++
lib/libmtd_int.h | 3 +++
misc-utils/flash_erase.c | 9 +++++----
4 files changed, 17 insertions(+), 4 deletions(-)
--
1.9.1
next reply other threads:[~2018-04-09 3:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-09 3:10 Xiaolei Li [this message]
[not found] ` <1523243410-65424-1-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-09 3:10 ` [PATCH 1/2] libmtd: Add support to access OOB available size Xiaolei Li
[not found] ` <1523243410-65424-2-git-send-email-xiaolei.li-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
2018-04-09 6:58 ` David Oberhollenzer
[not found] ` <99d17022-0b07-a999-b6ac-05b51df7d18d-S6VGOU4v5edDinCvNWH78Q@public.gmane.org>
2018-04-09 7:25 ` xiaolei li
2018-04-09 7:35 ` Boris Brezillon
2018-04-09 8:33 ` xiaolei li
2018-04-09 8:37 ` Boris Brezillon
2018-04-09 8:45 ` xiaolei li
2018-04-09 8:53 ` David Oberhollenzer
[not found] ` <bec14308-33e1-d158-37d2-4f59047f0016-S6VGOU4v5edDinCvNWH78Q@public.gmane.org>
2018-04-09 9:01 ` xiaolei li
2018-04-09 3:10 ` [PATCH 2/2] misc-utils: flash_erase: Fix Jffs2 type flash erase problem Xiaolei Li
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=1523243410-65424-1-git-send-email-xiaolei.li@mediatek.com \
--to=xiaolei.li-nus5lvnupcjwk0htik3j/w@public.gmane.org \
--cc=boris.brezillon-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org \
--cc=david.oberhollenzer-S6VGOU4v5edDinCvNWH78Q@public.gmane.org \
--cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=srv_heupstream-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox