Skip to contentSkip to conversation

complete nanddump feature-removals

PATCH In review Brian Norris 2 participants 9 messages Jun 24, 2011 – Jun 25, 2011 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

cover complete nanddump feature-removals

Here's my patchset to complete the feature removals and change of defaults for nanddump (+ 1 bug fix for integck...). These should be pushed after the 1.4.5 release.

Thanks,
Brian

Brian Norris (6):
nanddump: kill --omitbad, --noskipbad
nanddump: change default to --bb=skipbad
nanddump: change -o to mean --oob, not --omitoob
nanddump: default to NOT dumping OOB data
feature-removal: remove completed tasks
integck: fix build error (MS_DIRSYNC, MS_RELATIME)

 feature-removal-schedule.txt       |   37 ----------------
 nanddump.c                         |   85 +++++-------------------------------
 tests/fs-tests/integrity/integck.c |    1 +
 3 files changed, 13 insertions(+), 110 deletions(-)
#1 lore raw

PATCH 1/6 nanddump: kill --omitbad, --noskipbad

As mentioned previously, we are killing --omitbad in favor of the new --bb=skipbad option, which functions fairly similarly. Also, --noskipbad has become --bb=noskipbad, so remove the old -N' and --noskipbad' flags.

---
 nanddump.c |   46 +---------------------------------------------
 1 files changed, 1 insertions(+), 45 deletions(-)
nanddump.c +1 -45
index 0367d83..55c5586 100644
@@ -64,21 +64,6 @@ static void display_help(void)
 "    dumpbad: dump flash data, including any bad blocks\n"
 "    skipbad: dump good data, completely skipping any bad blocks\n"
 "\n"
-"Deprecated options:\n"
-"The following options are being replaced by --bb=METHOD flags or being\n"
-"removed entirely. Do not continue to use these options.\n"
-"-b         --omitbad            Omit bad blocks from the dump (DEPRECATED)\n"
-"-N         --noskipbad          Read without bad block skipping\n"
-"\n"
-"Notes on --omitbad and --bb=skipbad:\n"
-"* `omitbad' and `skipbad' are very similar; we are deprecating `--omitbad'\n"
-"  in favor of `--bb=skipbad'.\n"
-"* With either option, we stop dumping data when we encounter a bad block\n"
-"  and resume dumping at the next good block. However, with `omitbad', we\n"
-"  count the bad block as part of the total dump length, whereas with\n"
-"  `skipbad', the bad block is skipped, that is, not counted toward the\n"
-"  total dump length.\n"
-"\n"
 "Note on --oob, --omitoob:\n"
 "  To make nanddump act more like an inverse to nandwrite, we are changing\n"
 "  the default OOB behavior. In the next release, nanddump will not dump\n"
@@ -120,7 +105,6 @@ static enum {
 	padbad,   // dump flash data, substituting 0xFF for any bad blocks
 	dumpbad,  // dump flash data, including any bad blocks
 	skipbad,  // dump good data, completely skipping any bad blocks
-	omitbad   // dump flash data, substituting nothing for any bad blocks (DEPRECATED)
 } bb_method = padbad;
 
 static void process_options(int argc, char * const argv[])
@@ -130,7 +114,7 @@ static void process_options(int argc, char * const argv[])
 
 	for (;;) {
 		int option_index = 0;
-		static const char *short_options = "bs:f:l:opqnNca";
+		static const char *short_options = "s:f:l:opqnca";
 		static const struct option long_options[] = {
 			{"help", no_argument, 0, 0},
 			{"version", no_argument, 0, 0},
@@ -141,11 +125,9 @@ static void process_options(int argc, char * const argv[])
 			{"file", required_argument, 0, 'f'},
 			{"prettyprint", no_argument, 0, 'p'},
 			{"omitoob", no_argument, 0, 'o'},
-			{"omitbad", no_argument, 0, 'b'}, //DEPRECATED
 			{"startaddress", required_argument, 0, 's'},
 			{"length", required_argument, 0, 'l'},
 			{"noecc", no_argument, 0, 'n'},
-			{"noskipbad", no_argument, 0, 'N'},
 			{"quiet", no_argument, 0, 'q'},
 			{0, 0, 0, 0},
 		};
@@ -187,18 +169,6 @@ static void process_options(int argc, char * const argv[])
 						break;
 				}
 				break;
-			case 'b':
-				/* Check if bb_method was already set explicitly */
-				if (bb_default) {
-					bb_default = false;
-					bb_method = omitbad;
-					warnmsg("--omitbad is being deprecated in favor of --bb=skipbad.\n"
-						"  --omitbad will not be available in future releases.\n"
-						"  Please update your usage accordingly.");
-				} else {
-					error++;
-				}
-				break;
 			case 's':
 				start_addr = simple_strtoll(optarg, &error);
 				break;
@@ -233,18 +203,6 @@ static void process_options(int argc, char * const argv[])
 			case 'n':
 				noecc = true;
 				break;
-			case 'N':
-				/* Check if bb_method was already set explicitly */
-				if (bb_default) {
-					bb_default = false;
-					bb_method = dumpbad;
-					warnmsg("--noskipbad is being deprecated in favor of --bb=dumpbad.\n"
-						"  --noskipbad will not be available in future releases.\n"
-						"  Please update your usage accordingly.");
-				} else {
-					error++;
-				}
-				break;
 			case '?':
 				error++;
 				break;
@@ -499,8 +457,6 @@ int main(int argc, char * const argv[])
 					end_addr = mtd.size;
 				continue;
 			}
-			if (bb_method == omitbad)
-				continue;
 			memset(readbuf, 0xff, bs);
 		} else {
 			/* Read page data and exit on failure */
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 2/6 nanddump: change default to --bb=skipbad

In reply to Brian Norris

As promised, we change the default bad block handling method to --bb=skipbad. This works as a better inverse to nandwrite, since nandwrite skips bad blocks when writing data.

And of course, we remove the warning messages.

---
 nanddump.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)
nanddump.c +3 -8
index 55c5586..9edfbfd 100644
@@ -60,9 +60,9 @@ static void display_help(void)
 "-s addr    --startaddress=addr  Start address\n"
 "\n"
 "--bb=METHOD, where METHOD can be `padbad', `dumpbad', or `skipbad':\n"
-"    padbad:  dump flash data, substituting 0xFF for any bad blocks (default)\n"
+"    padbad:  dump flash data, substituting 0xFF for any bad blocks\n"
 "    dumpbad: dump flash data, including any bad blocks\n"
-"    skipbad: dump good data, completely skipping any bad blocks\n"
+"    skipbad: dump good data, completely skipping any bad blocks (default)\n"
 "\n"
 "Note on --oob, --omitoob:\n"
 "  To make nanddump act more like an inverse to nandwrite, we are changing\n"
@@ -105,7 +105,7 @@ static enum {
 	padbad,   // dump flash data, substituting 0xFF for any bad blocks
 	dumpbad,  // dump flash data, including any bad blocks
 	skipbad,  // dump good data, completely skipping any bad blocks
-} bb_method = padbad;
+} bb_method = skipbad;
 
 static void process_options(int argc, char * const argv[])
 {
@@ -229,11 +229,6 @@ static void process_options(int argc, char * const argv[])
 		exit(EXIT_FAILURE);
 	}
 
-	if (bb_default)
-		warnmsg("you did not specify a default bad-block handling\n"
-			"  method. In future versions, the default will change to\n"
-			"  --bb=skipbad. Use \"nanddump --help\" for more information.");
-
 	if (oob_default)
 		warnmsg("in next release, nanddump will not dump OOB\n"
 			"  by default. Use `nanddump --oob' explicitly to ensure\n"
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH 3/6 nanddump: change -o to mean --oob, not --omitoob

In reply to Brian Norris

As warned earlier, we are changing the meaning of nanddump -o' to mirror the usage in nandwrite, where -o means to include OOB (i.e., nandwrite -o' writes data to both in-band and out-of-band areas, so `nanddump -o' should dump data from both in-band and out-of-band areas).

---
 nanddump.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
nanddump.c +7 -7
index 9edfbfd..adf268b 100644
@@ -53,8 +53,8 @@ static void display_help(void)
 "-f file    --file=file          Dump to file\n"
 "-l length  --length=length      Length\n"
 "-n         --noecc              Read without error correction\n"
-"-o         --omitoob            Omit OOB data (default in next release)\n"
-"           --oob                Dump OOB data (current default)\n"
+"           --omitoob            Omit OOB data (default in next release)\n"
+"-o         --oob                Dump OOB data (current default)\n"
 "-p         --prettyprint        Print nice (hexdump)\n"
 "-q         --quiet              Don't display progress and status messages\n"
 "-s addr    --startaddress=addr  Start address\n"
@@ -119,12 +119,12 @@ static void process_options(int argc, char * const argv[])
 			{"help", no_argument, 0, 0},
 			{"version", no_argument, 0, 0},
 			{"bb", required_argument, 0, 0},
-			{"oob", no_argument, 0, 0},
+			{"omitoob", no_argument, 0, 0},
 			{"forcebinary", no_argument, 0, 'a'},
 			{"canonicalprint", no_argument, 0, 'c'},
 			{"file", required_argument, 0, 'f'},
+			{"oob", no_argument, 0, 'o'},
 			{"prettyprint", no_argument, 0, 'p'},
-			{"omitoob", no_argument, 0, 'o'},
 			{"startaddress", required_argument, 0, 's'},
 			{"length", required_argument, 0, 'l'},
 			{"noecc", no_argument, 0, 'n'},
@@ -159,10 +159,10 @@ static void process_options(int argc, char * const argv[])
 							error++;
 						bb_default = false;
 						break;
-					case 3: /* --oob */
+					case 3: /* --omitoob */
 						if (oob_default) {
 							oob_default = false;
-							omitoob = false;
+							omitoob = true;
 						} else {
 							errmsg_die("--oob and --oomitoob are mutually exclusive");
 						}
@@ -184,7 +184,7 @@ static void process_options(int argc, char * const argv[])
 			case 'o':
 				if (oob_default) {
 					oob_default = false;
-					omitoob = true;
+					omitoob = false;
 				} else {
 					errmsg_die("--oob and --oomitoob are mutually exclusive");
 				}
Signature · 1 line
1.7.0.4
#5 lore raw

PATCH 4/6 nanddump: default to NOT dumping OOB data

In reply to Brian Norris

Since nandwrite doesn't write OOB data by default, we don't dump OOB data by default, in order to be a more proper inverse function.

Remove the warnings and change the default.

---
 nanddump.c |   20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)
nanddump.c +4 -16
index adf268b..54198ae 100644
@@ -53,8 +53,8 @@ static void display_help(void)
 "-f file    --file=file          Dump to file\n"
 "-l length  --length=length      Length\n"
 "-n         --noecc              Read without error correction\n"
-"           --omitoob            Omit OOB data (default in next release)\n"
-"-o         --oob                Dump OOB data (current default)\n"
+"           --omitoob            Omit OOB data (default)\n"
+"-o         --oob                Dump OOB data\n"
 "-p         --prettyprint        Print nice (hexdump)\n"
 "-q         --quiet              Don't display progress and status messages\n"
 "-s addr    --startaddress=addr  Start address\n"
@@ -62,14 +62,7 @@ static void display_help(void)
 "--bb=METHOD, where METHOD can be `padbad', `dumpbad', or `skipbad':\n"
 "    padbad:  dump flash data, substituting 0xFF for any bad blocks\n"
 "    dumpbad: dump flash data, including any bad blocks\n"
-"    skipbad: dump good data, completely skipping any bad blocks (default)\n"
-"\n"
-"Note on --oob, --omitoob:\n"
-"  To make nanddump act more like an inverse to nandwrite, we are changing\n"
-"  the default OOB behavior. In the next release, nanddump will not dump\n"
-"  OOB data by default. We will leave both the `--omitoob' and `--oob'\n"
-"  options, but to mirror nandwrite, the short option `-o' will then stand\n"
-"  for `--oob', not `--omitoob'. Please adjust your usage accordingly.\n",
+"    skipbad: dump good data, completely skipping any bad blocks (default)\n",
 	PROGRAM_NAME);
 	exit(EXIT_SUCCESS);
 }
@@ -92,7 +85,7 @@ static void display_version(void)
 
 static bool			pretty_print = false;	// print nice
 static bool			noecc = false;		// don't error correct
-static bool			omitoob = false;	// omit oob data
+static bool			omitoob = true;		// omit oob data
 static long long		start_addr;		// start address
 static long long		length;			// dump length
 static const char		*mtddev;		// mtd device name
@@ -229,11 +222,6 @@ static void process_options(int argc, char * const argv[])
 		exit(EXIT_FAILURE);
 	}
 
-	if (oob_default)
-		warnmsg("in next release, nanddump will not dump OOB\n"
-			"  by default. Use `nanddump --oob' explicitly to ensure\n"
-			"  it is dumped.");
-
 	if ((argc - optind) != 1 || error)
 		display_help();
 
Signature · 1 line
1.7.0.4
#6 lore raw

PATCH 5/6 feature-removal: remove completed tasks

In reply to Brian Norris
---
 feature-removal-schedule.txt |   37 -------------------------------------
 1 files changed, 0 insertions(+), 37 deletions(-)
feature-removal-schedule.txt +0 -37
index 338bc08..a5980f7 100644
@@ -40,40 +40,3 @@ This is duplicating behavior with the mtdinfo utility.  Now the util
 warns when people use it, but it'll be removed in release 1.4.6.
 
 ---------------------------
-
-4. Rename --noskipbad option, kill --omitbad, change default BB method for nanddump
-
-Our bad block handling methods are getting disorganized. They will be replaced
-by a series of --bb=METHOD options (see `nanddump --help').
-
-In addition, the previous default bad block behavior was to dump 0xFF in place
-of bad blocks. This was not a good "inverse operation" of nandwrite. Thus, the
-current default behavior has become the (new) option --bb=padbad, and in 1.4.6,
-the default will be --bb=skipbad.
-
-The new `--bb=METHOD' options are included in this release, but all feature
-removals and changed defaults will occur in 1.4.6. For now, there are
-appropriate deprecation warning messages and an alert telling about the
-soon-to-be-default settings.
-
-Transition summary table:
------------------------------------------------------------------------------------------------------------
- Old option     New option                 Comment
------------------------------------------------------------------------------------------------------------
- <default>      --bb=padbad                dump flash data, substituting 0xFF for any bad blocks
- --noskipbad    --bb=dumpbad               dump flash data, including any bad blocks
- --skipbad      --bb=skipbad, <default>    dump good data, completely skipping any bad blocks (new default)
- --omitbad      N/A                        very similar to `skipbad', will be removed soon
-
----------------------------
-
-5. nanddump will not dump OOB by default
-
-In 1.4.6, nanddump will not dump OOB by default. To dump OOB, you will have to
-explicitly use the option `--oob'. For now, there is simply a warning every
-time you use nanddump without explicitly choosing `--oob' or `--omitoob'.
-
-Note that `-o' will no longer stand for `--omitoob'. To unify with nandwrite,
-it will stand for `--oob' (Dump OOB data).
-
----------------------------
Signature · 1 line
1.7.0.4
#7 lore raw

PATCH 6/6 integck: fix build error (MS_DIRSYNC, MS_RELATIME)

In reply to Brian Norris

Need to include <linux/fs.h>, at least for my build system. Otherwise, you can't build the 'tests'.

integck.c: In function ‘parse_mount_options’:
integck.c:2862: error: ‘MS_DIRSYNC’ undeclared (first use in this function)
integck.c:2862: error: (Each undeclared identifier is reported only once integck.c:2862: error: for each function it appears in.) integck.c:2872: error: ‘MS_RELATIME’ undeclared (first use in this function)

---
 tests/fs-tests/integrity/integck.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
tests/fs-tests/integrity/integck.c +1 -0
index 54e5ddc..30322cd 100644
@@ -36,6 +36,7 @@
 #include <sys/vfs.h>
 #include <sys/mount.h>
 #include <sys/statvfs.h>
+#include <linux/fs.h>
 
 #define PROGRAM_VERSION "1.1"
 #define PROGRAM_NAME "integck"
Signature · 1 line
1.7.0.4
#2 lore raw

Re: [PATCH 1/6] nanddump: kill --omitbad, --noskipbad

In reply to Brian Norris
Quoted 3 lines · Brian Norris

As mentioned previously, we are killing --omitbad in favor of the new --bb=skipbad option, which functions fairly similarly. Also, --noskipbad has become --bb=noskipbad, so remove the old -N' and --noskipbad' flags.

Oops, I meant --bb=dumpbad', not --bb=noskipbad'. I'll resend if you need me to change the commit msg...

#8 lore raw
In reply to Brian Norris
Quoted 3 lines · Brian Norris

Here's my patchset to complete the feature removals and change of defaults for nanddump (+ 1 bug fix for integck...). These should be pushed after the 1.4.5 release.

Pushed this series, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Битюцкий Артём)