* [PATCH 3/3][e2fsprogs] tune2fs: Don't allow tune2fs -I if flex_bg on
@ 2008-12-10 8:05 Peng Tao
2008-12-11 1:53 ` [PATCH][e2fsprogs] [resend]tune2fs: add force flag to tune2fs -I Peng Tao
0 siblings, 1 reply; 2+ messages in thread
From: Peng Tao @ 2008-12-10 8:05 UTC (permalink / raw)
To: ext4 development
[-- Attachment #1: Type: text/plain, Size: 1148 bytes --]
add force flag to tune2fs -I, because it may cause data corruption
when the
last inode table block is followed by a in-use data block. If user
really want to
tune the inode size, they should be warned about this.
Signed-off-by: Peng Tao <bergwolf@gmail.com>
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 453a529..1227802 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -107,7 +107,7 @@ static void usage(void)
"[-L volume_label]\n"
"\t[-M last_mounted_dir] [-O [^]feature[,...]]\n"
"\t[-E extended-option[,...]] [-T last_check_time] "
- "[-U UUID]\n\t[ -I new_inode_size ] device\n"), program_name);
+ "[-U UUID]\n\t[ -I new_inode_size ] [-f] device\n"), program_name);
exit (1);
}
@@ -1598,6 +1598,13 @@ retry_open:
ext2fs_mark_super_dirty(fs);
}
if (I_flag) {
+ if (!f_flag) {
+ fputs(_("Enlarging inode size may cause data "
+ "corruption.\nUse with -f at your warranty. "
+ "Abort.\n"), stderr);
+ exit(1);
+ }
+
if (mount_flags & EXT2_MF_MOUNTED) {
fputs(_("The inode size may only be "
"changed when the filesystem is "
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH][e2fsprogs] [resend]tune2fs: add force flag to tune2fs -I
2008-12-10 8:05 [PATCH 3/3][e2fsprogs] tune2fs: Don't allow tune2fs -I if flex_bg on Peng Tao
@ 2008-12-11 1:53 ` Peng Tao
0 siblings, 0 replies; 2+ messages in thread
From: Peng Tao @ 2008-12-11 1:53 UTC (permalink / raw)
To: ext4 development
[-- Attachment #1: Type: text/plain, Size: 969 bytes --]
Sorry, just found out that I messed up this patch...
----------------------------------------
add force flag to tune2fs -I, because it may cause data corruption when
the last inode table block is followed by a in-use data block. If user
really want to tune the inode size, they should be warned about this.
Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
misc/tune2fs.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 453a529..7308773 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1598,6 +1598,12 @@ retry_open:
ext2fs_mark_super_dirty(fs);
}
if (I_flag) {
+ if (f_flag) {
+ fputs(_("Enlarging inode size may cause data "
+ "corruption.\nUse with -f at your warranty. "
+ "Abort.\n"), stderr);
+ exit(1);
+ }
if (mount_flags & EXT2_MF_MOUNTED) {
fputs(_("The inode size may only be "
"changed when the filesystem is "
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-11 1:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-10 8:05 [PATCH 3/3][e2fsprogs] tune2fs: Don't allow tune2fs -I if flex_bg on Peng Tao
2008-12-11 1:53 ` [PATCH][e2fsprogs] [resend]tune2fs: add force flag to tune2fs -I Peng Tao
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).