All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Brian Norris" <computersforpeace@gmail.com>
To: "Artem Bityutskiy" <dedekind1@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	linux-mtd@lists.infradead.org,
	Mike Frysinger <vapier.adi@gmail.com>
Subject: [PATCH v3 7/7] nanddump: document, warn about future default --omitoob
Date: Wed, 22 Jun 2011 09:49:23 -0700	[thread overview]
Message-ID: <1308761363-16512-8-git-send-email-computersforpeace@gmail.com> (raw)
In-Reply-To: <BANLkTi=-25MExYfuB-ANK4ceh3gWy+BqCg@mail.gmail.com>

To work as a proper inverse to nandwrite, nanddump must not dump OOB data by
default. This patch prints a warning regarding the future change. We also
suggest using the new flag, `--oob', for transitioning to the next release
with new default behavior.

Note that we are changing `-o' to mean `--oob' in the next release,
similar to `nandwrite -o'.  This is a break from previous behavior.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 feature-removal-schedule.txt |   11 +++++++++++
 nanddump.c                   |   34 ++++++++++++++++++++++++++++------
 2 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/feature-removal-schedule.txt b/feature-removal-schedule.txt
index f9910f1..338bc08 100644
--- a/feature-removal-schedule.txt
+++ b/feature-removal-schedule.txt
@@ -66,3 +66,14 @@ Transition summary table:
  --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).
+
+---------------------------
diff --git a/nanddump.c b/nanddump.c
index e19a45f..54cb1af 100644
--- a/nanddump.c
+++ b/nanddump.c
@@ -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\n"
-"           --oob                Dump OOB data\n"
+"-o         --omitoob            Omit OOB data (default in next release)\n"
+"           --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"
@@ -77,7 +77,14 @@ static void display_help(void)
 "  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",
+"  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"
+"  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",
 	PROGRAM_NAME);
 	exit(EXIT_SUCCESS);
 }
@@ -119,7 +126,7 @@ static enum {
 static void process_options(int argc, char * const argv[])
 {
 	int error = 0;
-	bool bb_default = true;
+	bool bb_default = true, oob_default = true;
 
 	for (;;) {
 		int option_index = 0;
@@ -171,7 +178,12 @@ static void process_options(int argc, char * const argv[])
 						bb_default = false;
 						break;
 					case 3: /* --oob */
-						omitoob = false;
+						if (oob_default) {
+							oob_default = false;
+							omitoob = false;
+						} else {
+							errmsg_die("--oob and --oomitoob are mutually exclusive");
+						}
 						break;
 				}
 				break;
@@ -200,7 +212,12 @@ static void process_options(int argc, char * const argv[])
 				length = simple_strtoll(optarg, &error);
 				break;
 			case 'o':
-				omitoob = true;
+				if (oob_default) {
+					oob_default = false;
+					omitoob = true;
+				} else {
+					errmsg_die("--oob and --oomitoob are mutually exclusive");
+				}
 				break;
 			case 'a':
 				forcebinary = true;
@@ -259,6 +276,11 @@ static void process_options(int argc, char * const argv[])
 			"  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"
+			"  it is dumped.");
+
 	if ((argc - optind) != 1 || error)
 		display_help();
 
-- 
1.7.0.4

      parent reply	other threads:[~2011-06-22 16:51 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-21 15:46 [PATCH v2 0/7] new nanddump defaults Brian Norris
2011-06-21 15:46 ` [PATCH v2 1/7] nanddump: add --bb=METHOD option Brian Norris
2011-06-21 15:46 ` [PATCH v2 2/7] nanddump: remove --skipbad, leaving --bb=skipbad Brian Norris
2011-06-21 15:46 ` [PATCH v2 3/7] nanddump: deprecation messages for old BB options Brian Norris
2011-06-21 19:38   ` Mike Frysinger
2011-06-21 15:46 ` [PATCH v2 4/7] nanddump: warn about new default BB handling Brian Norris
2011-06-21 19:37   ` Mike Frysinger
2011-06-21 15:46 ` [PATCH v2 5/7] feature-removal-schedule: describe nanddump changes Brian Norris
2011-06-21 15:46 ` [PATCH v2 6/7] nanddump: add --oob option Brian Norris
2011-06-21 15:46 ` [PATCH v2 7/7] nanddump: document, warn about future default --omitoob Brian Norris
2011-06-21 19:39   ` Mike Frysinger
2011-06-21 19:40 ` [PATCH v2 0/7] new nanddump defaults Mike Frysinger
2011-06-21 22:36   ` Brian Norris
2011-06-22 16:49     ` [PATCH v3 0/7] prepare new nanddump options, defaults Brian Norris
2011-06-23 15:02       ` Artem Bityutskiy
2011-06-23 15:04         ` Artem Bityutskiy
2011-06-23 15:52           ` Mike Frysinger
2011-06-23 23:00             ` Brian Norris
2011-06-23 23:14               ` Mike Frysinger
2011-06-23 23:27                 ` Brian Norris
2011-06-23 23:36                   ` Mike Frysinger
2011-06-23 23:40                     ` Brian Norris
2011-06-23 23:45                       ` Mike Frysinger
2011-06-23 23:48                         ` Brian Norris
2011-06-24 20:20                 ` Artem Bityutskiy
2011-06-26  7:15                   ` Peter Korsgaard
2011-06-24 17:37               ` Brian Norris
2011-06-24 18:28                 ` Mike Frysinger
2011-06-24 19:21                   ` Artem Bityutskiy
2011-06-24 20:11                 ` Artem Bityutskiy
2011-06-24 20:15               ` Artem Bityutskiy
2011-06-24 19:38             ` Artem Bityutskiy
2011-06-22 16:49     ` [PATCH v3 1/7] nanddump: add --bb=METHOD option Brian Norris
2011-06-22 16:49     ` [PATCH v3 2/7] nanddump: remove --skipbad, leaving --bb=skipbad Brian Norris
2011-06-22 16:49     ` [PATCH v3 3/7] nanddump: update help message for BB method changes Brian Norris
2011-06-22 16:49     ` [PATCH v3 4/7] nanddump: warn about new default BB handling Brian Norris
2011-06-22 16:49     ` [PATCH v3 5/7] feature-removal-schedule: describe nanddump changes Brian Norris
2011-06-22 16:49     ` [PATCH v3 6/7] nanddump: add --oob option Brian Norris
2011-06-22 16:49     ` Brian Norris [this message]

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=1308761363-16512-8-git-send-email-computersforpeace@gmail.com \
    --to=computersforpeace@gmail.com \
    --cc=dedekind1@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=vapier.adi@gmail.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 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.