All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev
@ 2017-08-23 15:42 Theodore Ts'o
  2017-08-23 15:42 ` [PATCH 2/5] mke2fs: automatically use 256 byte inodes if project feature enabled Theodore Ts'o
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Theodore Ts'o @ 2017-08-23 15:42 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 misc/mke2fs.conf.in  | 5 -----
 tests/mke2fs.conf.in | 5 -----
 2 files changed, 10 deletions(-)

diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in
index 812f7c742..d0066b78b 100644
--- a/misc/mke2fs.conf.in
+++ b/misc/mke2fs.conf.in
@@ -14,11 +14,6 @@
 		features = has_journal,extent,huge_file,flex_bg,uninit_bg,64bit,dir_nlink,extra_isize
 		inode_size = 256
 	}
-	ext4dev = {
-		features = has_journal,extent,huge_file,flex_bg,uninit_bg,inline_data,64bit,dir_nlink,extra_isize
-		inode_size = 256
-		options = test_fs=1
-	}
 	small = {
 		blocksize = 1024
 		inode_size = 128
diff --git a/tests/mke2fs.conf.in b/tests/mke2fs.conf.in
index c06050d8d..ee246ba8b 100644
--- a/tests/mke2fs.conf.in
+++ b/tests/mke2fs.conf.in
@@ -17,11 +17,6 @@
 		features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
 		inode_size = 256
 	}
-	ext4dev = {
-		features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
-		inode_size = 256
-		options = test_fs=1
-	}
 	small = {
 		blocksize = 1024
 		inode_size = 128
-- 
2.11.0.rc0.7.gbe5a750

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/5] mke2fs: automatically use 256 byte inodes if project feature enabled
  2017-08-23 15:42 [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Theodore Ts'o
@ 2017-08-23 15:42 ` Theodore Ts'o
  2017-08-23 15:42 ` [PATCH 3/5] tune2fs: do not enable project feature or quota if inode size is 128 bytes Theodore Ts'o
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Theodore Ts'o @ 2017-08-23 15:42 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o

If the inode size is not implicitly requested on the command line, and
it is too small to support the project feature, automatically promote
the inode size to be 256 bytes so that the project feature will work.

Note the previous test to check for a too-small inode size didn't work
because it checked before inode size was set in fs_param.  Hence, it
was possible to create file systems with a 128 byte inode and the
project feature enabled.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 misc/mke2fs.c | 35 ++++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index b8d078a0a..7fd7fae40 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2319,6 +2319,26 @@ profile_error:
 			(unsigned long long) fs_blocks_count);
 	}
 
+	if (quotatype_bits & QUOTA_PRJ_BIT)
+		ext2fs_set_feature_project(&fs_param);
+
+	if (ext2fs_has_feature_project(&fs_param)) {
+		quotatype_bits |= QUOTA_PRJ_BIT;
+		if (inode_size == EXT2_GOOD_OLD_INODE_SIZE) {
+			com_err(program_name, 0,
+				_("%d byte inodes are too small for "
+				  "project quota"),
+				inode_size);
+			exit(1);
+		}
+		if (inode_size == 0) {
+			inode_size = get_int_from_profile(fs_types,
+							  "inode_size", 0);
+			if (inode_size <= EXT2_GOOD_OLD_INODE_SIZE*2)
+				inode_size = EXT2_GOOD_OLD_INODE_SIZE*2;
+		}
+	}
+
 	/* Don't allow user to set both metadata_csum and uninit_bg bits. */
 	if (ext2fs_has_feature_metadata_csum(&fs_param) &&
 	    ext2fs_has_feature_gdt_csum(&fs_param))
@@ -2419,19 +2439,6 @@ profile_error:
 		exit(1);
 	}
 
-	/*
-	 * If inode size is 128 and project quota is enabled, we need
-	 * to notify users that project ID will never be useful.
-	 */
-	if (ext2fs_has_feature_project(&fs_param) &&
-	    fs_param.s_inode_size == EXT2_GOOD_OLD_INODE_SIZE) {
-		com_err(program_name, 0,
-			_("%d byte inodes are too small for project quota; "
-			  "specify larger size"),
-			fs_param.s_inode_size);
-		exit(1);
-	}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 3/5] tune2fs: do not enable project feature or quota if inode size is 128 bytes
  2017-08-23 15:42 [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Theodore Ts'o
  2017-08-23 15:42 ` [PATCH 2/5] mke2fs: automatically use 256 byte inodes if project feature enabled Theodore Ts'o
@ 2017-08-23 15:42 ` Theodore Ts'o
  2017-08-23 15:42 ` [PATCH 4/5] tune2fs: explain why an fsck is needed Theodore Ts'o
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Theodore Ts'o @ 2017-08-23 15:42 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o

Don't allow the user to enable the project feature (or project quota)
if the inode size is 128 bytes.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 misc/tune2fs.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 85435674d..99c17cc47 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1310,6 +1310,11 @@ mmp_error:
 
 	if (FEATURE_ON(E2P_FEATURE_RO_INCOMPAT,
 		       EXT4_FEATURE_RO_COMPAT_PROJECT)) {
+		if (fs->super->s_inode_size == EXT2_GOOD_OLD_INODE_SIZE) {
+			fprintf(stderr, _("Cannot enable project feature; "
+					  "inode size too small.\n"));
+			exit(1);
+		}
 		Q_flag = 1;
 		quota_enable[PRJQUOTA] = QOPT_ENABLE;
 	}
@@ -1497,6 +1502,13 @@ static void handle_quota_options(ext2_filsys fs)
 		/* Nothing to do. */
 		return;
 
+	if (quota_enable[PRJQUOTA] == QOPT_ENABLE &&
+	    fs->super->s_inode_size == EXT2_GOOD_OLD_INODE_SIZE) {
+		fprintf(stderr, _("Cannot enable project quota; "
+				  "inode size too small.\n"));
+		exit(1);
+	}
+
 	for (qtype = 0; qtype < MAXQUOTAS; qtype++) {
 		if (quota_enable[qtype] == QOPT_ENABLE)
 			qtype_bits |= 1 << qtype;
-- 
2.11.0.rc0.7.gbe5a750

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 4/5] tune2fs: explain why an fsck is needed
  2017-08-23 15:42 [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Theodore Ts'o
  2017-08-23 15:42 ` [PATCH 2/5] mke2fs: automatically use 256 byte inodes if project feature enabled Theodore Ts'o
  2017-08-23 15:42 ` [PATCH 3/5] tune2fs: do not enable project feature or quota if inode size is 128 bytes Theodore Ts'o
@ 2017-08-23 15:42 ` Theodore Ts'o
  2017-08-23 15:42 ` [PATCH 5/5] tune2fs, mke2fs: clarify proceed delay question Theodore Ts'o
  2017-08-23 17:17 ` [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Darrick J. Wong
  4 siblings, 0 replies; 6+ messages in thread
From: Theodore Ts'o @ 2017-08-23 15:42 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o

Currently tune2fs just says without any explanation, "run fsck -f".
Add a short explanation that a freshly checked file system is required
to reduce user confusion.  (We could add even more details, but
hopefully this is enough.)

Addresses-Debian-Bug: #857336

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 misc/tune2fs.c                     | 8 ++++++--
 tests/t_dangerous/expect           | 4 ++++
 tests/t_enable_mcsum/expect        | 2 ++
 tests/t_enable_mcsum_initbg/expect | 2 ++
 tests/t_iexpand_mcsum/expect       | 2 ++
 5 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 99c17cc47..3e7ca23e1 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -116,6 +116,8 @@ struct blk_move {
 
 errcode_t ext2fs_run_ext3_journal(ext2_filsys *fs);
 
+static const char *fsck_explain = N_("\nThis operation requires a freshly checked filesystem.\n");
+
 static const char *please_fsck = N_("Please run e2fsck -f on the filesystem.\n");
 static const char *please_dir_fsck =
 		N_("Please run e2fsck -fD on the filesystem.\n");
@@ -419,7 +421,8 @@ static void check_fsck_needed(ext2_filsys fs, const char *prompt)
 	if (!(fs->super->s_state & EXT2_VALID_FS) ||
 	    (fs->super->s_state & EXT2_ERROR_FS) ||
 	    (fs->super->s_lastcheck < fs->super->s_mtime)) {
-		printf("\n%s\n", _(please_fsck));
+		puts(_(fsck_explain));
+		puts(_(please_fsck));
 		if (mount_flags & EXT2_MF_READONLY)
 			printf("%s", _("(and reboot afterwards!)\n"));
 		exit(1);
@@ -441,7 +444,8 @@ static void request_dir_fsck_afterwards(ext2_filsys fs)
 		return;
 	fsck_requested++;
 	fs->super->s_state &= ~EXT2_VALID_FS;
-	printf("\n%s\n", _(please_dir_fsck));
+	puts(_(fsck_explain));
+	puts(_(please_dir_fsck));
 	if (mount_flags & EXT2_MF_READONLY)
 		printf("%s", _("(and reboot afterwards!)\n"));
 }
diff --git a/tests/t_dangerous/expect b/tests/t_dangerous/expect
index bae7e0e6e..3bae8fafd 100644
--- a/tests/t_dangerous/expect
+++ b/tests/t_dangerous/expect
@@ -11,6 +11,8 @@ Writing superblocks and filesystem accounting information:      \b\b\b\b\bdone
 
 tune2fs -O metadata_csum test.img
 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -f on the filesystem.
 
 Exit status is 1
@@ -57,6 +59,8 @@ Exit status is 0
 tune2fs -O metadata_csum test.img
 Enabling checksums could take some time.
 Proceed anyway (or wait 5 seconds) ? (y,N) 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -fD on the filesystem.
 
 Exit status is 0
diff --git a/tests/t_enable_mcsum/expect b/tests/t_enable_mcsum/expect
index 5a1a33a50..c8a2674bf 100644
--- a/tests/t_enable_mcsum/expect
+++ b/tests/t_enable_mcsum/expect
@@ -18,6 +18,8 @@ Pass 5: Checking group summary information
 Exit status is 0
 tune2fs -O metadata_csum test.img
 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -fD on the filesystem.
 
 Exit status is 0
diff --git a/tests/t_enable_mcsum_initbg/expect b/tests/t_enable_mcsum_initbg/expect
index ed4774c2d..e05dd6031 100644
--- a/tests/t_enable_mcsum_initbg/expect
+++ b/tests/t_enable_mcsum_initbg/expect
@@ -18,6 +18,8 @@ Pass 5: Checking group summary information
 Exit status is 0
 tune2fs -O metadata_csum test.img
 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -fD on the filesystem.
 
 Exit status is 0
diff --git a/tests/t_iexpand_mcsum/expect b/tests/t_iexpand_mcsum/expect
index 0ebf1626d..772bd6238 100644
--- a/tests/t_iexpand_mcsum/expect
+++ b/tests/t_iexpand_mcsum/expect
@@ -19,6 +19,8 @@ Exit status is 0
 tune2fs -I 256 -O metadata_csum test.img
 Setting inode size 256
 
+This operation requires a freshly checked filesystem.
+
 Please run e2fsck -fD on the filesystem.
 
 Exit status is 0
-- 
2.11.0.rc0.7.gbe5a750

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 5/5] tune2fs, mke2fs: clarify proceed delay question
  2017-08-23 15:42 [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Theodore Ts'o
                   ` (2 preceding siblings ...)
  2017-08-23 15:42 ` [PATCH 4/5] tune2fs: explain why an fsck is needed Theodore Ts'o
@ 2017-08-23 15:42 ` Theodore Ts'o
  2017-08-23 17:17 ` [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Darrick J. Wong
  4 siblings, 0 replies; 6+ messages in thread
From: Theodore Ts'o @ 2017-08-23 15:42 UTC (permalink / raw)
  To: Ext4 Developers List; +Cc: Theodore Ts'o

The explanation of the what happens after delaying N seconds is
ambiguous.  Clarify what happens.

Addresses-Debian-Bug: #857336

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
 misc/util.c              |  2 +-
 tests/t_dangerous/expect | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/misc/util.c b/misc/util.c
index 0ff3d4967..1d33883d4 100644
--- a/misc/util.c
+++ b/misc/util.c
@@ -101,7 +101,7 @@ void proceed_question(int delay)
 			return;
 		}
 		signal(SIGALRM, alarm_signal);
-		printf(_("Proceed anyway (or wait %d seconds) ? (y,N) "),
+		printf(_("Proceed anyway (or wait %d seconds to proceed) ? (y,N) "),
 		       delay);
 		alarm(delay);
 	} else
diff --git a/tests/t_dangerous/expect b/tests/t_dangerous/expect
index 3bae8fafd..a9903b750 100644
--- a/tests/t_dangerous/expect
+++ b/tests/t_dangerous/expect
@@ -37,15 +37,15 @@ Pass 5: Checking group summary information
 Exit status is 0
 tune2fs -O metadata_csum test.img
 Enabling checksums could take some time.
-Proceed anyway (or wait 5 seconds) ? (y,N) 
+Proceed anyway (or wait 5 seconds to proceed) ? (y,N) 
 Exit status is 1
 tune2fs -I 512 test.img
 Resizing inodes could take some time.
-Proceed anyway (or wait 5 seconds) ? (y,N) 
+Proceed anyway (or wait 5 seconds to proceed) ? (y,N) 
 Exit status is 1
 tune2fs -U random test.img
 Setting UUID on a checksummed filesystem could take some time.
-Proceed anyway (or wait 5 seconds) ? (y,N) 
+Proceed anyway (or wait 5 seconds to proceed) ? (y,N) 
 Exit status is 1
 
 Change in FS metadata:
@@ -58,7 +58,7 @@ Pass 5: Checking group summary information
 Exit status is 0
 tune2fs -O metadata_csum test.img
 Enabling checksums could take some time.
-Proceed anyway (or wait 5 seconds) ? (y,N) 
+Proceed anyway (or wait 5 seconds to proceed) ? (y,N) 
 This operation requires a freshly checked filesystem.
 
 Please run e2fsck -fD on the filesystem.
@@ -76,11 +76,11 @@ Pass 5: Checking group summary information
 
 tune2fs -I 512 test.img
 Resizing inodes could take some time.
-Proceed anyway (or wait 5 seconds) ? (y,N) Setting inode size 512
+Proceed anyway (or wait 5 seconds to proceed) ? (y,N) Setting inode size 512
 Exit status is 0
 tune2fs -U f0f0f0f0-f0f0-f0f0-f0f0-f0f0f0f0f0f0 test.img
 Setting UUID on a checksummed filesystem could take some time.
-Proceed anyway (or wait 5 seconds) ? (y,N) Exit status is 0
+Proceed anyway (or wait 5 seconds to proceed) ? (y,N) Exit status is 0
 Backing up journal inode block information.
 
 
-- 
2.11.0.rc0.7.gbe5a750

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev
  2017-08-23 15:42 [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Theodore Ts'o
                   ` (3 preceding siblings ...)
  2017-08-23 15:42 ` [PATCH 5/5] tune2fs, mke2fs: clarify proceed delay question Theodore Ts'o
@ 2017-08-23 17:17 ` Darrick J. Wong
  4 siblings, 0 replies; 6+ messages in thread
From: Darrick J. Wong @ 2017-08-23 17:17 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Ext4 Developers List

On Wed, Aug 23, 2017 at 11:42:06AM -0400, Theodore Ts'o wrote:
> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
> ---
>  misc/mke2fs.conf.in  | 5 -----
>  tests/mke2fs.conf.in | 5 -----
>  2 files changed, 10 deletions(-)
> 
> diff --git a/misc/mke2fs.conf.in b/misc/mke2fs.conf.in
> index 812f7c742..d0066b78b 100644
> --- a/misc/mke2fs.conf.in
> +++ b/misc/mke2fs.conf.in
> @@ -14,11 +14,6 @@
>  		features = has_journal,extent,huge_file,flex_bg,uninit_bg,64bit,dir_nlink,extra_isize
>  		inode_size = 256
>  	}
> -	ext4dev = {
> -		features = has_journal,extent,huge_file,flex_bg,uninit_bg,inline_data,64bit,dir_nlink,extra_isize
> -		inode_size = 256
> -		options = test_fs=1

LOL, that was still there?? :)

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> -	}
>  	small = {
>  		blocksize = 1024
>  		inode_size = 128
> diff --git a/tests/mke2fs.conf.in b/tests/mke2fs.conf.in
> index c06050d8d..ee246ba8b 100644
> --- a/tests/mke2fs.conf.in
> +++ b/tests/mke2fs.conf.in
> @@ -17,11 +17,6 @@
>  		features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
>  		inode_size = 256
>  	}
> -	ext4dev = {
> -		features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
> -		inode_size = 256
> -		options = test_fs=1
> -	}
>  	small = {
>  		blocksize = 1024
>  		inode_size = 128
> -- 
> 2.11.0.rc0.7.gbe5a750
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-08-23 17:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 15:42 [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Theodore Ts'o
2017-08-23 15:42 ` [PATCH 2/5] mke2fs: automatically use 256 byte inodes if project feature enabled Theodore Ts'o
2017-08-23 15:42 ` [PATCH 3/5] tune2fs: do not enable project feature or quota if inode size is 128 bytes Theodore Ts'o
2017-08-23 15:42 ` [PATCH 4/5] tune2fs: explain why an fsck is needed Theodore Ts'o
2017-08-23 15:42 ` [PATCH 5/5] tune2fs, mke2fs: clarify proceed delay question Theodore Ts'o
2017-08-23 17:17 ` [PATCH 1/5] mke2fs.conf: remove legacy entry for ext4dev Darrick J. Wong

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.