From patchwork Fri May 6 08:40:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Dong X-Patchwork-Id: 94345 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 D1E28100814 for ; Fri, 6 May 2011 18:40:42 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754112Ab1EFIkl (ORCPT ); Fri, 6 May 2011 04:40:41 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:51369 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754065Ab1EFIkk (ORCPT ); Fri, 6 May 2011 04:40:40 -0400 Received: by pvg12 with SMTP id 12so1338387pvg.19 for ; Fri, 06 May 2011 01:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=PxwrZenysnlpQB3WnhA1VHyggk5OtQChmz78aYJTeaU=; b=qXeSR0eWlaopJcpHWk7zKwRiIGGUf3GpVyTIy8mIxMkoJn1c7Sy8/pxzJykqWpo5DT +vg0Gpd4nsXrhUotGIiTA+yAE65qlQcU0swaFnZ6qI9sJQNs4+/bbRMWSl1F2Oe3Rhhw zS4u8/CRYhV1SJeTPL+gOk9D51wUdUyu0Clco= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=rqf32sYXb9ddeTDqwJdfubJ8IvO/S5yrxAERggQpTvgXfs410Fl6fZNrS0GmYwY7nv CR5ql9zB1384Vh51IJGZdxi5l3ZQXK6uwsaUK3JsI672A9vkrQJk/EM2snNiNBx67Upx 8zuyBf0liRxvipUvPk8l3vQD0cDmFQyTl5NjM= Received: by 10.142.191.3 with SMTP id o3mr1884540wff.59.1304671239475; Fri, 06 May 2011 01:40:39 -0700 (PDT) Received: from localhost.localdomain ([114.251.86.0]) by mx.google.com with ESMTPS id k6sm3907096wfa.5.2011.05.06.01.40.35 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 06 May 2011 01:40:39 -0700 (PDT) From: Robin Dong To: linux-ext4@vger.kernel.org Cc: Robin Dong Subject: [PATCH] ext3: remove redundant checking for small blocksize Date: Fri, 6 May 2011 16:40:27 +0800 Message-Id: <1304671227-6163-1-git-send-email-sanbai@taobao.com> X-Mailer: git-send-email 1.7.1 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org The set_blocksize (which is in sb_set_blocksize) will fail if a blocksize is too small: /* Size cannot be smaller than the size supported by the device */ if (size < bdev_logical_block_size(bdev)) return -EINVAL; Therefore remove the checking for small blocksize before "sb_set_blocksize" to make it consistent to ext2. Signed-off-by: Robin Dong --- fs/ext3/super.c | 14 +------------- 1 files changed, 1 insertions(+), 13 deletions(-) diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 3c6a9e0..ae813cd 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -1628,7 +1628,6 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) unsigned long def_mount_opts; struct inode *root; int blocksize; - int hblock; int db_count; int i; int needs_recovery; @@ -1761,20 +1760,9 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) goto failed_mount; } - hblock = bdev_logical_block_size(sb->s_bdev); if (sb->s_blocksize != blocksize) { - /* - * Make sure the blocksize for the filesystem is larger - * than the hardware sectorsize for the machine. - */ - if (blocksize < hblock) { - ext3_msg(sb, KERN_ERR, - "error: fsblocksize %d too small for " - "hardware sectorsize %d", blocksize, hblock); - goto failed_mount; - } - brelse (bh); + if (!sb_set_blocksize(sb, blocksize)) { ext3_msg(sb, KERN_ERR, "error: bad blocksize %d", blocksize);