From patchwork Tue Sep 24 21:11:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 277621 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B98352C00C9 for ; Wed, 25 Sep 2013 07:13:11 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755031Ab3IXVM7 (ORCPT ); Tue, 24 Sep 2013 17:12:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:28782 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753951Ab3IXVM5 (ORCPT ); Tue, 24 Sep 2013 17:12:57 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8OLBnVs003518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 24 Sep 2013 17:11:49 -0400 Received: from Liberator.local (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r8OLBmfK030624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Sep 2013 17:11:48 -0400 Message-ID: <52420014.8090901@redhat.com> Date: Tue, 24 Sep 2013 16:11:48 -0500 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 MIME-Version: 1.0 To: ext4 development CC: Bert DeKnuydt Subject: [PATCH] tune2fs: more respect for quota config option X-Enigmail-Version: 1.5.2 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Commit 44a2cca3 disabled tune2fs -O quota when the build didn't have --enable-quota at configure time, but that wasn't quite enough. We need to exclude the "-Q" option as well from tune2fs when --enable-quota isn't specified at configure time. Otherwise, tune2fs -Q can set the quota feature, but no other utility will touch the filesystem due to the unknown flag, if buitl w/o --enable-quota. So put everything related to "-Q" under #ifdef CONFIG_QUOTA; usage output (was missing before) and option parsing. Addresses-Red-Hat-Bugzilla: #1010709 Reported-by: Bert DeKnuydt Signed-off-by: Eric Sandeen --- -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/misc/tune2fs.c b/misc/tune2fs.c index c38711d..ee21fa8 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -124,6 +124,9 @@ static void usage(void) "\t[-r reserved_blocks_count] [-u user] [-C mount_count] " "[-L volume_label]\n" "\t[-M last_mounted_dir] [-O [^]feature[,...]]\n" +#ifdef CONFIG_QUOTA + "\t[-Q quota_options]\n" +#endif "\t[-E extended-option[,...]] [-T last_check_time] " "[-U UUID]\n\t[ -I new_inode_size ] device\n"), program_name); exit(1); @@ -1282,11 +1285,15 @@ static void parse_tune2fs_options(int argc, char **argv) char *tmp; struct group *gr; struct passwd *pw; + char optstring[100] = "c:e:fg:i:jlm:o:r:s:u:C:E:I:J:L:M:O:T:U:"; +#ifdef CONFIG_QUOTA + strcat(optstring, "Q:"); +#endif open_flag = 0; printf("tune2fs %s (%s)\n", E2FSPROGS_VERSION, E2FSPROGS_DATE); - while ((c = getopt(argc, argv, "c:e:fg:i:jlm:o:r:s:u:C:E:I:J:L:M:O:Q:T:U:")) != EOF) + while ((c = getopt(argc, argv, optstring)) != EOF) switch (c) { case 'c': max_mount_count = strtol(optarg, &tmp, 0); @@ -1440,11 +1447,13 @@ static void parse_tune2fs_options(int argc, char **argv) features_cmd = optarg; open_flag = EXT2_FLAG_RW; break; +#ifdef CONFIG_QUOTA case 'Q': Q_flag = 1; parse_quota_opts(optarg); open_flag = EXT2_FLAG_RW; break; +#endif case 'r': reserved_blocks = strtoul(optarg, &tmp, 0); if (*tmp) {