Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3883711pxb; Tue, 17 Nov 2020 06:09:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQAe+hstpecYPNaU0NH+dcclGNlkIp9pl3dbnsWVWc6xK2ju63w4HDHg80A9vPyhRkiOb8 X-Received: by 2002:aa7:db8a:: with SMTP id u10mr21296406edt.204.1605622181502; Tue, 17 Nov 2020 06:09:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605622181; cv=none; d=google.com; s=arc-20160816; b=tP/Txj3Y8FmYRnRjZ6aX9Xp3J8YmJsr75fvUlMB3XBBCt357ds5pOkcKF2e29pNuuk BziKgACfvqnJAGzgbz77bK5O3jEYmTLt1unyXHSjUN8aCQihn5vXfw4tmqwkurhjb17v kfU7XXM6/CKQmK5xlh4ZsRFLsW9jG2U2x/7/7J48zCNjxcZkKBZm+Y1ZunreVo5cWn7n K4AWvBsYDd04ZJ8I0YV8JLW25qi8oJaSgsdTcXBk7y7i2Jc9JwOROVCqLvn4TbEdH4Gq 72NuppD5uZTTV0B4Eab0lz/V/ls/OcrFcVgr9sHdGI53vwh39wgA81yEU1fBj42OXGG+ QCkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FgTn2DHjOkLgwI3ZT38LDNg+Y5n1HIzy2RrtWN8wKyQ=; b=cPL5bIzXIS0igClHi4ULQbxz9n1NNJeF/zHaWp7XlUCrwHY4Tksjqw554ZEqBBTVSc dKE88+f8YIVd1jVaQW/yEXYF2ywwPMt+HTVCZ3/je7PSTtrHiCxptE0DQlvcSwf5/Kxr lR9tH6qtKFVzEQkY1tAg9v0Lfpjfv6VScTFtrmHFgLnUNOS26Cn1XqlfIYWKCOSCWDlq 4H7x4NUShNkezM1Lky8oBVEYvPYmVaEMPkuZKmtZTswVIDNONc6MZ1sn5y5n+ATX40g8 I6RdrsQ7rhZMWoB3DC5zZok5a/+3IgH4LRfJScoCteOJewq8JI6IUmciSSf3X2nej+EZ 3pww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MP4XwT6c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n3si16024380eda.283.2020.11.17.06.09.18; Tue, 17 Nov 2020 06:09:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MP4XwT6c; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728555AbgKQNJA (ORCPT + 99 others); Tue, 17 Nov 2020 08:09:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:37442 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729315AbgKQNIq (ORCPT ); Tue, 17 Nov 2020 08:08:46 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 DA1252225B; Tue, 17 Nov 2020 13:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618525; bh=WFDBWOgLtPYNsgKmA17pqWgI3dxOGvpaXe70blMXWHQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MP4XwT6c44srEX7SavXe4qtCx4PkkWMSgPD7Q3ZbtpblgAZo7FFiSALT29l75lUFL 6L6dfXR+x+iMqz1W5zAgZ0gz9EI4uL/lTTc3yryawNg5o/YdJhkAk7QEOk9LISpXej ZeDyLiFYmfvR2qwXy852bQWDBZ6lkZMv4aSAceac= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kaixu Xia , Theodore Tso , stable@kernel.org Subject: [PATCH 4.4 32/64] ext4: correctly report "not supported" for {usr,grp}jquota when !CONFIG_QUOTA Date: Tue, 17 Nov 2020 14:04:55 +0100 Message-Id: <20201117122107.737917783@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122106.144800239@linuxfoundation.org> References: <20201117122106.144800239@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kaixu Xia commit 174fe5ba2d1ea0d6c5ab2a7d4aa058d6d497ae4d upstream. The macro MOPT_Q is used to indicates the mount option is related to quota stuff and is defined to be MOPT_NOSUPPORT when CONFIG_QUOTA is disabled. Normally the quota options are handled explicitly, so it didn't matter that the MOPT_STRING flag was missing, even though the usrjquota and grpjquota mount options take a string argument. It's important that's present in the !CONFIG_QUOTA case, since without MOPT_STRING, the mount option matcher will match usrjquota= followed by an integer, and will otherwise skip the table entry, and so "mount option not supported" error message is never reported. [ Fixed up the commit description to better explain why the fix works. --TYT ] Fixes: 26092bf52478 ("ext4: use a table-driven handler for mount options") Signed-off-by: Kaixu Xia Link: https://lore.kernel.org/r/1603986396-28917-1-git-send-email-kaixuxia@tencent.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1452,8 +1452,8 @@ static const struct mount_opts { MOPT_SET | MOPT_Q}, {Opt_noquota, (EXT4_MOUNT_QUOTA | EXT4_MOUNT_USRQUOTA | EXT4_MOUNT_GRPQUOTA), MOPT_CLEAR | MOPT_Q}, - {Opt_usrjquota, 0, MOPT_Q}, - {Opt_grpjquota, 0, MOPT_Q}, + {Opt_usrjquota, 0, MOPT_Q | MOPT_STRING}, + {Opt_grpjquota, 0, MOPT_Q | MOPT_STRING}, {Opt_offusrjquota, 0, MOPT_Q}, {Opt_offgrpjquota, 0, MOPT_Q}, {Opt_jqfmt_vfsold, QFMT_VFS_OLD, MOPT_QFMT},