linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@sun.com>
To: "Theodore Ts'o" <tytso@mit.edu>, linux-ext4@vger.kernel.org
Subject: Re: [PATCH][8/28] e2fsprogs-config-before-cmdline.patch
Date: Sat, 02 Feb 2008 01:29:25 -0700	[thread overview]
Message-ID: <20080202082925.GI31694@webber.adilger.int> (raw)
In-Reply-To: <20080202075943.GB23836@webber.adilger.int>


The patch changes the order that the config file and command line are
parsed so that command line has precedence.  It also allows multiple
-E options to be specified on the command line.

Signed-off-by: Jim Garlick <garlick@llnl.gov>
Signed-off-by: Andreas Dilger <adilger@clusterfs.com>

Index: e2fsprogs-1.40.4/e2fsck/unix.c
===================================================================
--- e2fsprogs-1.40.4.orig/e2fsck/unix.c
+++ e2fsprogs-1.40.4/e2fsck/unix.c
@@ -588,7 +588,6 @@ static errcode_t PRS(int argc, char *arg
 #ifdef HAVE_SIGNAL_H
 	struct sigaction	sa;
 #endif
-	char		*extended_opts = 0;
 	char		*cp;
 	int 		res;		/* result of sscanf */
 #ifdef CONFIG_JBD_DEBUG
@@ -619,6 +618,12 @@ static errcode_t PRS(int argc, char *arg
 		ctx->program_name = *argv;
 	else
 		ctx->program_name = "e2fsck";
+
+	if ((cp = getenv("E2FSCK_CONFIG")) != NULL)
+		config_fn[0] = cp;
+	profile_set_syntax_err_cb(syntax_err_report);
+	profile_init(config_fn, &ctx->profile);
+
 	while ((c = getopt (argc, argv, "panyrcC:B:dE:fvtFVM:b:I:j:P:l:L:N:SsDk")) != EOF)
 		switch (c) {
 		case 'C':
@@ -645,7 +650,7 @@ static errcode_t PRS(int argc, char *arg
 			ctx->options |= E2F_OPT_COMPRESS_DIRS;
 			break;
 		case 'E':
-			extended_opts = optarg;
+			parse_extended_opts(ctx, optarg);
 			break;
 		case 'p':
 		case 'a':
@@ -771,13 +776,6 @@ static errcode_t PRS(int argc, char *arg
 			argv[optind]);
 		fatal_error(ctx, 0);
 	}
-	if (extended_opts)
-		parse_extended_opts(ctx, extended_opts);
-
-	if ((cp = getenv("E2FSCK_CONFIG")) != NULL)
-		config_fn[0] = cp;
-	profile_set_syntax_err_cb(syntax_err_report);
-	profile_init(config_fn, &ctx->profile);
 
 	if (flush) {
 		fd = open(ctx->filesystem_name, O_RDONLY, 0);

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

  parent reply	other threads:[~2008-02-02  8:29 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-02  7:59 [PATCH][0/28] Lustre e2fsprogs patch series Andreas Dilger
2008-02-02  8:14 ` [PATCH][1/28] e2fsprogs-specdotin.patch Andreas Dilger
2008-02-02  8:16 ` [PATCH] [2/28] e2fsprogs-eacheck.patch Andreas Dilger
2008-02-02  8:17 ` [PATCH][3/28] e2fsprogs-extended_ops.patch Andreas Dilger
2008-02-02  8:20 ` [PATCH][4/28] e2fsprogs-tests-f_unsorted_EAs.patch Andreas Dilger
2008-02-02  8:22 ` [PATCH][5/28] e2fsprogs-tests-f_ea_checks.patch Andreas Dilger
2008-02-02  8:25 ` [PATCH][6/28] e2fsprogs-nlinks.patch Andreas Dilger
2008-02-02  8:25 ` [PATCH][0/28] e2fsprogs-extents.patch Andreas Dilger
2008-02-02  8:27   ` [PATCH][7/28] e2fsprogs-extents.patch Andreas Dilger
2008-02-18 17:56     ` Eric Sandeen
2008-02-18 18:12       ` Eric Sandeen
2008-02-18 19:53       ` Theodore Tso
2008-02-18 20:48         ` Eric Sandeen
2008-02-18 22:09           ` Theodore Tso
2008-02-19  4:35       ` Andreas Dilger
2008-02-02  8:29 ` Andreas Dilger [this message]
2008-02-02  8:30 ` [PATCH][9/28] e2fsprogs-SLES10--m-support.patch Andreas Dilger
2008-02-02  8:34 ` [PATCH][10/28] e2fsprogs-uninit.patch Andreas Dilger
2008-03-15 19:41   ` Theodore Tso
2008-03-16  0:34     ` Andreas Dilger
2008-03-17 12:33   ` Theodore Tso
2008-02-02  8:36 ` [PATCH][11/28] e2fsprogs-nlinks-flag.patch Andreas Dilger
2008-02-02  8:36 ` [PATCH][12/28] e2fsprogs-expand-extra-isize.patch Andreas Dilger
2008-02-02  8:40 ` [PATCH][14/28] e2fsprogs-tests-f_expisize_ea_del.patch Andreas Dilger
2008-02-02  8:41 ` [PATCH][15/28] e2fsprogs-ibadness-counter.patch Andreas Dilger
2008-02-02  8:43 ` [PATCH][16/28] e2fsprogs-tests-f_ibadness.patch Andreas Dilger
2008-02-02  8:46 ` [PATCH][18/28] e2fsprogs-tests-f_random_corruption.patch Andreas Dilger
2008-02-02  8:47 ` [PATCH][19/28] e2fsprogs-stride_option.patch Andreas Dilger
2008-02-02  8:48 ` [PATCH][20/28] e2fsprogs-mmp.patch Andreas Dilger
2008-02-02  8:49 ` [PATCH][21/28] e2fsprogs-journal_chksum.patch Andreas Dilger
2008-02-02  8:54 ` [PATCH][25/28] e2fsprogs-i_size-corruption.patch Andreas Dilger
2008-02-02  8:54 ` [PATCH][26/28] e2fsprogs-fiemap.patch Andreas Dilger
2008-02-02  8:56 ` [PATCH][27/28] e2fsprogs-debugfs-supported_features.patch Andreas Dilger
2008-02-02  8:57 ` [PATCH][28/28] e2fsprogs-lts-make_rpms.patch Andreas Dilger
2008-02-11  4:19 ` [PATCH][0/28] Lustre e2fsprogs patch series Theodore Tso
2008-02-11 10:22   ` Aneesh Kumar K.V
2008-02-11 20:09   ` Andreas Dilger

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=20080202082925.GI31694@webber.adilger.int \
    --to=adilger@sun.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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;
as well as URLs for NNTP newsgroup(s).