From patchwork Thu Dec 11 01:53:07 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peng Tao X-Patchwork-Id: 13388 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.176.167]) by ozlabs.org (Postfix) with ESMTP id 76CD3DE041 for ; Thu, 11 Dec 2008 12:53:32 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754068AbYLKBxb (ORCPT ); Wed, 10 Dec 2008 20:53:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754086AbYLKBxa (ORCPT ); Wed, 10 Dec 2008 20:53:30 -0500 Received: from ti-out-0910.google.com ([209.85.142.187]:21014 "EHLO ti-out-0910.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754068AbYLKBx3 (ORCPT ); Wed, 10 Dec 2008 20:53:29 -0500 Received: by ti-out-0910.google.com with SMTP id b6so467822tic.23 for ; Wed, 10 Dec 2008 17:53:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :x-enigmail-version:content-type; bh=pSCQBnBH1l4Aegyvv3vnxfeuS6YgoxUF8pVlSo9uV9s=; b=JdgQiO9D9Ku+0mItpvdJdLeb4faYs6umvor/awPNvjnesR7dCUTYSeDhLp+DsAO0dS IQxHxbZMUYehfL7J3uGGTT5n19reKoeHbYk+zYsbDuvFvyloryOmtE+GLB8/lskA8iED O5Er2brAi77Jga5CDmmzKWQtIDYPZ0ZYvjxRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=gM1N2wqfBnAS1PvY1QHaqXxzTW1q/ccRdygwvo13I5vpTARxMnBidn5me5qUmWClTP XMXyHmiTURsJ4rvJs8I+YvNqovE/hKxTZiovP2kFN26mDoedFBCjseafc7Gr7lb/b+hJ SfQPOtbrKH3T3H1u7l01ZN+jFEZVNkU+es3TM= Received: by 10.110.15.9 with SMTP id 9mr2906949tio.48.1228960407922; Wed, 10 Dec 2008 17:53:27 -0800 (PST) Received: from ?59.64.157.2? ([59.64.157.2]) by mx.google.com with ESMTPS id d4sm2495976tib.11.2008.12.10.17.53.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Dec 2008 17:53:26 -0800 (PST) Message-ID: <49407283.8090804@gmail.com> Date: Thu, 11 Dec 2008 09:53:07 +0800 From: Peng Tao User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) MIME-Version: 1.0 To: ext4 development Subject: [PATCH][e2fsprogs] [resend]tune2fs: add force flag to tune2fs -I References: <493F7852.2040201@gmail.com> In-Reply-To: <493F7852.2040201@gmail.com> X-Enigmail-Version: 0.95.7 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 --- 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 "