[PATCH][e2fsprogs] [resend]tune2fs: add force flag to tune2fs -I

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux