From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1EA5C34026 for ; Tue, 18 Feb 2020 19:59:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 980A124670 for ; Tue, 18 Feb 2020 19:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582055985; bh=qmES+1uRtANOGz79p7/ycb4Nn1So7DrO0/YhdSWe8TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=QguajC/JXJ9gudlF+/DG6jixpyQhQd0JAZ//US7/Zr4BB2WM+18HgCvQfBNOaGcft UcT2jqmgjjCGBqqfdBsWgd5ioovJiaZhxP7AJItGsI+TTh/xW1bLE7SBeVcJD4lSN9 WeDF8f3R3HzHobMIE2t6yQVw2r4C7Xv0SEqqX5xA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728469AbgBRT7o (ORCPT ); Tue, 18 Feb 2020 14:59:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:38520 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727935AbgBRT7l (ORCPT ); Tue, 18 Feb 2020 14:59:41 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F20882464E; Tue, 18 Feb 2020 19:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582055981; bh=qmES+1uRtANOGz79p7/ycb4Nn1So7DrO0/YhdSWe8TY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BZOvjRyuZ2WSI25WnfZHlfJdPNKBDA1sr1Mm3Tz7BK0UAgCQfQiL40vJZcOp1fEvI zZyKqUjrvk61Y/DmOnQM6GYGTS3JvWIdcPZz2277b0jlYCJ0znbRWXrfhHLeNY0b6s akrIWK1BIn/m/nucwlLp7bhbiRBh1Cm3FUsz46ks= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Theodore Tso , stable@kernel.org Subject: [PATCH 5.4 18/66] ext4: improve explanation of a mount failure caused by a misconfigured kernel Date: Tue, 18 Feb 2020 20:54:45 +0100 Message-Id: <20200218190429.776224561@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200218190428.035153861@linuxfoundation.org> References: <20200218190428.035153861@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Theodore Ts'o commit d65d87a07476aa17df2dcb3ad18c22c154315bec upstream. If CONFIG_QFMT_V2 is not enabled, but CONFIG_QUOTA is enabled, when a user tries to mount a file system with the quota or project quota enabled, the kernel will emit a very confusing messsage: EXT4-fs warning (device vdc): ext4_enable_quotas:5914: Failed to enable quota tracking (type=0, err=-3). Please run e2fsck to fix. EXT4-fs (vdc): mount failed We will now report an explanatory message indicating which kernel configuration options have to be enabled, to avoid customer/sysadmin confusion. Link: https://lore.kernel.org/r/20200215012738.565735-1-tytso@mit.edu Google-Bug-Id: 149093531 Fixes: 7c319d328505b778 ("ext4: make quota as first class supported feature") Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -2961,17 +2961,11 @@ static int ext4_feature_set_ok(struct su return 0; } -#ifndef CONFIG_QUOTA - if (ext4_has_feature_quota(sb) && !readonly) { +#if !defined(CONFIG_QUOTA) || !defined(CONFIG_QFMT_V2) + if (!readonly && (ext4_has_feature_quota(sb) || + ext4_has_feature_project(sb))) { ext4_msg(sb, KERN_ERR, - "Filesystem with quota feature cannot be mounted RDWR " - "without CONFIG_QUOTA"); - return 0; - } - if (ext4_has_feature_project(sb) && !readonly) { - ext4_msg(sb, KERN_ERR, - "Filesystem with project quota feature cannot be mounted RDWR " - "without CONFIG_QUOTA"); + "The kernel was not built with CONFIG_QUOTA and CONFIG_QFMT_V2"); return 0; } #endif /* CONFIG_QUOTA */