From patchwork Thu May 5 02:44:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Dong X-Patchwork-Id: 94196 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 9F710B6F70 for ; Thu, 5 May 2011 12:44:28 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752615Ab1EECoU (ORCPT ); Wed, 4 May 2011 22:44:20 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:54711 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337Ab1EECoT (ORCPT ); Wed, 4 May 2011 22:44:19 -0400 Received: by pvg12 with SMTP id 12so771422pvg.19 for ; Wed, 04 May 2011 19:44:19 -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:to; bh=QEbqdqXwlYE0WsaMEGbiIOFAZxJC5w2yLzlyx0qckFw=; b=qQ54xduQv2ZORMqe21e1bDk6brfLHX50EH+31Oo2LeEvz5At0MUE9IMcVJXmaxj4yw aYoPLB30THvVpmeJ+WrQt7uxsYCDGnGUvdyLQa/5gSfQ5GDP1DUda2UAkKnHRHjYprkM 4+tY9Vw3cGBVYvz+YAZ/QxnTJiQQINPdebc24= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=Wr1U+6J6k536XK0hNxYt0Przo4pOIgusXIp80qYlJSGiUpTBq2Xj1OI7pbLiDASOxQ FFZMCFb3a5ZkXEj6FGT8pk6PK1cqiFQs4BAHAuQb6KDPKDXkpGAZsX7w4XUZ5i/KY0I+ QZYgy3fv8BPNep7mA/89KpweksABStnuccssY= Received: by 10.142.185.6 with SMTP id i6mr1013042wff.163.1304563458805; Wed, 04 May 2011 19:44:18 -0700 (PDT) Received: from localhost.localdomain ([114.251.86.0]) by mx.google.com with ESMTPS id 25sm2187995wfb.22.2011.05.04.19.44.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 04 May 2011 19:44:17 -0700 (PDT) From: Robin Dong To: linux-ext4@vger.kernel.org Cc: Robin Dong , Jan Kara Subject: [PATCH] ext2: fix error msg when mounting fs with too-large blocksize Date: Thu, 5 May 2011 10:44:04 +0800 Message-Id: <1304563444-4842-1-git-send-email-sanbai@taobao.com> X-Mailer: git-send-email 1.7.1 To: linux-ext4@vger.kernel.org Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org When ext2 mounts a filesystem, it attempts to set the block device blocksize with a call to sb_set_blocksize, which can fail for several reasons. The current failure message in ext2 prints: EXT2-fs (loop1): error: blocksize is too small which is not correct in all cases. This can be demonstrated by creating a filesystem with # mkfs.ext2 -b 8192 on a 4k page system, and attempting to mount it. Change the error message to a more generic: EXT2-fs (loop1): bad blocksize 8192 to match the error message in ext3. Signed-off-by: Robin Dong Reviewed-by: Coly Li Reviewed-by: Eric Sandeen --- fs/ext2/super.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/fs/ext2/super.c b/fs/ext2/super.c index d89e0b6..8dfae33 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -882,7 +882,8 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) brelse(bh); if (!sb_set_blocksize(sb, blocksize)) { - ext2_msg(sb, KERN_ERR, "error: blocksize is too small"); + ext2_msg(sb, KERN_ERR, + "error: bad blocksize %d", blocksize); goto failed_sbi; }