diff options
author | Richard Weinberger <richard@nod.at> | 2014-10-06 15:18:41 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2015-03-26 22:46:04 +0100 |
commit | 24b7a347c37f99c9d08d2d3ae9c6a56a8333429b (patch) | |
tree | 03ba942986ea116f433dcdd429b2f3b20b236193 | |
parent | 5fa7fa5dad0cf8f2b47bb8dca91c605c48d282f6 (diff) | |
download | op-kernel-dev-24b7a347c37f99c9d08d2d3ae9c6a56a8333429b.zip op-kernel-dev-24b7a347c37f99c9d08d2d3ae9c6a56a8333429b.tar.gz |
UBI: Fastmap: Enhance fastmap checking
Don't update the fastmap upon detach if fastmap checking is enabled.
This is poor men's power cut testing feature. :-)
Signed-off-by: Richard Weinberger <richard@nod.at>
-rw-r--r-- | drivers/mtd/ubi/build.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index a757150..e26fe12 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -1114,8 +1114,11 @@ int ubi_detach_mtd_dev(int ubi_num, int anyway) ubi_msg(ubi, "detaching mtd%d", ubi->mtd->index); #ifdef CONFIG_MTD_UBI_FASTMAP /* If we don't write a new fastmap at detach time we lose all - * EC updates that have been made since the last written fastmap. */ - ubi_update_fastmap(ubi); + * EC updates that have been made since the last written fastmap. + * In case of fastmap debugging we omit the update to simulate an + * unclean shutdown. */ + if (!ubi_dbg_chk_fastmap(ubi)) + ubi_update_fastmap(ubi); #endif /* * Before freeing anything, we have to stop the background thread to |