From patchwork Sun Sep 30 09:26:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 10621391 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D83FD16B1 for ; Sun, 30 Sep 2018 09:27:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA1F02982D for ; Sun, 30 Sep 2018 09:27:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE6E72983E; Sun, 30 Sep 2018 09:27:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C0302982D for ; Sun, 30 Sep 2018 09:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727861AbeI3P7e (ORCPT ); Sun, 30 Sep 2018 11:59:34 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13591 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727742AbeI3P7e (ORCPT ); Sun, 30 Sep 2018 11:59:34 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2A1799EB727F2; Sun, 30 Sep 2018 17:27:17 +0800 (CST) Received: from szvp000201624.huawei.com (10.120.216.130) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.399.0; Sun, 30 Sep 2018 17:27:08 +0800 From: Chao Yu To: CC: , , Chao Yu Subject: [PATCH 2/2] common/quota: adapt _require_prjquota() for f2fs Date: Sun, 30 Sep 2018 17:26:53 +0800 Message-ID: <20180930092653.122684-2-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20180930092653.122684-1-yuchao0@huawei.com> References: <20180930092653.122684-1-yuchao0@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In _require_prjquota(), let's check project quota support as below for f2fs: - For image support, check 'project_quota' on enabled feature list of specified device. - For kernel support, check /sys/fs/f2fs/features/project_quota sysfs entry status. Signed-off-by: Chao Yu --- common/quota | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/quota b/common/quota index 9ab091817804..9b8641350a4d 100644 --- a/common/quota +++ b/common/quota @@ -82,6 +82,13 @@ _require_prjquota() dumpe2fs -h $_dev 2>&1 | grep -qw project || \ _notrun "Project quota not available on this $FSTYP" fi + if [ "$FSTYP" == "f2fs" ]; then + dump.f2fs $_dev 2>&1 | grep -qw project_quota + [ $? -ne 0 ] && _notrun "Project quota not enabled in this device $_dev" + cat /sys/fs/f2fs/features/project_quota | grep -qw supported + [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas" + return + fi src/feature -P $_dev [ $? -ne 0 ] && _notrun "Installed kernel does not support project quotas" if [ "$USE_EXTERNAL" = yes -a ! -z "$_dev" ]; then