From patchwork Tue Apr 19 06:11:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kazuya Mio X-Patchwork-Id: 91922 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 B1E8BB700B for ; Tue, 19 Apr 2011 16:12:16 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751943Ab1DSGMP (ORCPT ); Tue, 19 Apr 2011 02:12:15 -0400 Received: from TYO202.gate.nec.co.jp ([202.32.8.206]:58421 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751393Ab1DSGMO (ORCPT ); Tue, 19 Apr 2011 02:12:14 -0400 Received: from mailgate3.nec.co.jp ([10.7.69.192]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id p3J6C9FB010593; Tue, 19 Apr 2011 15:12:09 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id p3J6C9x23350; Tue, 19 Apr 2011 15:12:09 +0900 (JST) Received: from mail03.kamome.nec.co.jp (mail03.kamome.nec.co.jp [10.25.43.7]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id p3J6C9dn020423; Tue, 19 Apr 2011 15:12:09 +0900 (JST) Received: from togyo.jp.nec.com ([10.26.220.4] [10.26.220.4]) by mail02.kamome.nec.co.jp with ESMTP id BT-MMP-493687; Tue, 19 Apr 2011 15:11:34 +0900 Received: from [10.64.168.30] ([10.64.168.30] [10.64.168.30]) by mail.jp.nec.com with ESMTP; Tue, 19 Apr 2011 15:11:34 +0900 Message-ID: <4DAD2796.5010409@sx.jp.nec.com> Date: Tue, 19 Apr 2011 15:11:34 +0900 From: Kazuya Mio User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; ja; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 MIME-Version: 1.0 To: ext4 , Theodore Tso Subject: [PATCH] e2fsprogs: Unify the upper limit of reserved blocks count Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org In e2fsprogs, the upper limit of reserved blocks count is a half of filesystem's blocks count. This patch fixes the incorrect checks of reserved blocks count. Signed-off-by: Kazuya Mio --- lib/ext2fs/initialize.c | 2 +- misc/tune2fs.c | 2 +- 2 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/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c index e1f229b..afefbfd 100644 --- a/lib/ext2fs/initialize.c +++ b/lib/ext2fs/initialize.c @@ -192,7 +192,7 @@ errcode_t ext2fs_initialize(const char *name, int flags, ext2fs_blocks_count_set(super, ext2fs_blocks_count(param)); ext2fs_r_blocks_count_set(super, ext2fs_r_blocks_count(param)); - if (ext2fs_r_blocks_count(super) >= ext2fs_blocks_count(param)) { + if (ext2fs_r_blocks_count(super) > ext2fs_blocks_count(param) / 2) { retval = EXT2_ET_INVALID_ARGUMENT; goto cleanup; } diff --git a/misc/tune2fs.c b/misc/tune2fs.c index bcada11..fad86c0 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -1718,7 +1718,7 @@ retry_open: reserved_ratio, ext2fs_r_blocks_count(sb)); } if (r_flag) { - if (reserved_blocks >= ext2fs_blocks_count(sb)/2) { + if (reserved_blocks > ext2fs_blocks_count(sb) / 2) { com_err(program_name, 0, _("reserved blocks count is too big (%llu)"), reserved_blocks);