From patchwork Mon Jun 24 06:28:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kazuya Mio X-Patchwork-Id: 253634 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 9A4CF2C0095 for ; Mon, 24 Jun 2013 16:39:54 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752482Ab3FXGjy (ORCPT ); Mon, 24 Jun 2013 02:39:54 -0400 Received: from TYO200.gate.nec.co.jp ([210.143.35.50]:40674 "EHLO tyo200.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751922Ab3FXGjx (ORCPT ); Mon, 24 Jun 2013 02:39:53 -0400 Received: from tyo201.gate.nec.co.jp ([10.7.69.201]) by tyo200.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id r5O6dqg6004838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 24 Jun 2013 15:39:52 +0900 (JST) Received: from mailgate3.nec.co.jp ([10.7.69.160]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id r5O6Xe3R014220; Mon, 24 Jun 2013 15:33:40 +0900 (JST) Received: from mailsv3.nec.co.jp (imss62.nec.co.jp [10.7.69.157]) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) with ESMTP id r5O6Xep16919; Mon, 24 Jun 2013 15:33:40 +0900 (JST) Received: from mail01b.kamome.nec.co.jp (mail01b.kamome.nec.co.jp [10.25.43.2]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id r5O6XeWH028851; Mon, 24 Jun 2013 15:33:40 +0900 (JST) Received: from saigo.jp.nec.com ([10.26.220.6] [10.26.220.6]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-280046; Mon, 24 Jun 2013 15:28:59 +0900 Received: from [10.64.168.30] ([10.64.168.30] [10.64.168.30]) by mail.jp.nec.com with ESMTP; Mon, 24 Jun 2013 15:28:59 +0900 Message-ID: <51C7E72B.2070608@sx.jp.nec.com> Date: Mon, 24 Jun 2013 15:28:59 +0900 From: Kazuya Mio User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Andreas Dilger , tytso@mit.edu CC: linux-ext4@vger.kernel.org Subject: [PATCH 1/2 V2] mke2fs: fix force option to create filesystem on mounted device Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org According to mke2fs man, we can create a filesystem on the mounted device when -FF option is specified. However, currently we have to specify -F option third to force mke2fs. This patch fixes the problem. Signed-off-by: Kazuya Mio Reviewed-by: Zheng Liu --- misc/util.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) -- 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/util.c b/misc/util.c index 6c93e1c..40c8858 100644 --- a/misc/util.c +++ b/misc/util.c @@ -150,7 +150,7 @@ void check_mount(const char *device, int force, const char *type) } if (mount_flags & EXT2_MF_MOUNTED) { fprintf(stderr, _("%s is mounted; "), device); - if (force > 2) { + if (force >= 2) { fputs(_("mke2fs forced anyway. Hope /etc/mtab is " "incorrect.\n"), stderr); return; @@ -162,7 +162,7 @@ void check_mount(const char *device, int force, const char *type) if (mount_flags & EXT2_MF_BUSY) { fprintf(stderr, _("%s is apparently in use by the system; "), device); - if (force > 2) { + if (force >= 2) { fputs(_("mke2fs forced anyway.\n"), stderr); return; }