From patchwork Tue Jul 23 09:25:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 11054179 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 AA5991580 for ; Tue, 23 Jul 2019 09:25:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A5552022B for ; Tue, 23 Jul 2019 09:25:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E79A2623D; Tue, 23 Jul 2019 09:25:55 +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 819472022B for ; Tue, 23 Jul 2019 09:25:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732302AbfGWJZx (ORCPT ); Tue, 23 Jul 2019 05:25:53 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41018 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726432AbfGWJZw (ORCPT ); Tue, 23 Jul 2019 05:25:52 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 56DCFE290D39BCEC26F5; Tue, 23 Jul 2019 17:25:46 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Jul 2019 17:25:40 +0800 From: Chao Yu To: CC: , , , , Chao Yu Subject: [PATCH 1/3] generic/38[3456]: adjust to check prjquota before mount Date: Tue, 23 Jul 2019 17:25:27 +0800 Message-ID: <20190723092529.112426-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 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 Move _require_prjquota() to front of _qmount() since we do the check on device directly instead of mountpoint, it can avoid potential failure if filesystem utils needs exclusive open on device. Signed-off-by: Chao Yu --- tests/generic/383 | 2 +- tests/generic/384 | 2 +- tests/generic/385 | 2 +- tests/generic/386 | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/generic/383 b/tests/generic/383 index 2c8c5923..cf5ac255 100755 --- a/tests/generic/383 +++ b/tests/generic/383 @@ -39,6 +39,7 @@ _require_xfs_quota_foreign _scratch_mkfs >/dev/null 2>&1 _scratch_enable_pquota +_require_prjquota $SCRATCH_DEV do_project_test() { @@ -76,7 +77,6 @@ EOF # Test project _qmount_option "usrquota,prjquota" _qmount -_require_prjquota $SCRATCH_DEV do_project_test # success, all done diff --git a/tests/generic/384 b/tests/generic/384 index b7c940d7..2c0cd00b 100755 --- a/tests/generic/384 +++ b/tests/generic/384 @@ -57,10 +57,10 @@ chmod a+rwx $seqres.full # arbitrary users will write here _require_scratch _scratch_mkfs >/dev/null 2>&1 _scratch_enable_pquota +_require_prjquota $SCRATCH_DEV _qmount_option "prjquota" _qmount -_require_prjquota $SCRATCH_DEV report_quota() { diff --git a/tests/generic/385 b/tests/generic/385 index 937131a9..56ce6eb0 100755 --- a/tests/generic/385 +++ b/tests/generic/385 @@ -56,9 +56,9 @@ quota_cmd="$XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid" _scratch_mkfs >/dev/null 2>&1 _scratch_enable_pquota +_require_prjquota $SCRATCH_DEV _qmount_option "prjquota" _qmount -_require_prjquota $SCRATCH_DEV # # Create the project root diff --git a/tests/generic/386 b/tests/generic/386 index 462c5869..e4f7d23b 100755 --- a/tests/generic/386 +++ b/tests/generic/386 @@ -112,10 +112,10 @@ echo $proj_num:$proj_dir > "$my_projects" _scratch_mkfs >> "$seqres.full" 2>&1 _scratch_enable_pquota +_require_prjquota $SCRATCH_DEV _qmount_option "prjquota" _qmount -_require_prjquota $SCRATCH_DEV mkdir -p "${proj_dir}" From patchwork Tue Jul 23 09:25:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 11054181 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 D3DF4912 for ; Tue, 23 Jul 2019 09:26:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C41561FFBE for ; Tue, 23 Jul 2019 09:26:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B867D204BE; Tue, 23 Jul 2019 09:26:04 +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 5D15D1FFBE for ; Tue, 23 Jul 2019 09:26:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726432AbfGWJZ7 (ORCPT ); Tue, 23 Jul 2019 05:25:59 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:43822 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732316AbfGWJZ6 (ORCPT ); Tue, 23 Jul 2019 05:25:58 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 6D662C290FC82737B9F7; Tue, 23 Jul 2019 17:25:51 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Jul 2019 17:25:40 +0800 From: Chao Yu To: CC: , , , , Chao Yu Subject: [PATCH 2/3] common/quota: support f2fs in _require_quota() and _check_quota_usage() Date: Tue, 23 Jul 2019 17:25:28 +0800 Message-ID: <20190723092529.112426-2-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20190723092529.112426-1-yuchao0@huawei.com> References: <20190723092529.112426-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 This can let f2fs pass the check of quota testcases. Signed-off-by: Chao Yu --- common/quota | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/quota b/common/quota index f19f81a1..9af280a2 100644 --- a/common/quota +++ b/common/quota @@ -12,7 +12,7 @@ _require_quota() [ -n "$QUOTA_PROG" ] || _notrun "Quota user tools not installed" case $FSTYP in - ext2|ext3|ext4|ext4dev|reiserfs) + ext2|ext3|ext4|ext4dev|f2fs|reiserfs) if [ ! -d /proc/sys/fs/quota ]; then _notrun "Installed kernel does not support quotas" fi @@ -257,7 +257,7 @@ _check_quota_usage() VFS_QUOTA=0 case $FSTYP in - ext2|ext3|ext4|ext4dev|reiserfs|gfs2) + ext2|ext3|ext4|ext4dev|f2fs|reiserfs|gfs2) VFS_QUOTA=1 quotaon -f -u -g $SCRATCH_MNT 2>/dev/null ;; From patchwork Tue Jul 23 09:25:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 11054177 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 292621399 for ; Tue, 23 Jul 2019 09:25:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 149B7204BE for ; Tue, 23 Jul 2019 09:25:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 04AFD26E51; Tue, 23 Jul 2019 09:25:55 +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 A1CA5204BE for ; Tue, 23 Jul 2019 09:25:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732318AbfGWJZy (ORCPT ); Tue, 23 Jul 2019 05:25:54 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:43816 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728809AbfGWJZx (ORCPT ); Tue, 23 Jul 2019 05:25:53 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 68C621A8ECFF5BE390B8; Tue, 23 Jul 2019 17:25:51 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.439.0; Tue, 23 Jul 2019 17:25:41 +0800 From: Chao Yu To: CC: , , , , Chao Yu Subject: [PATCH 3/3] common/rc: check quota sysfile feature for f2fs Date: Tue, 23 Jul 2019 17:25:29 +0800 Message-ID: <20190723092529.112426-3-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20190723092529.112426-1-yuchao0@huawei.com> References: <20190723092529.112426-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(), f2fs missed to check whether we have enabled quota sysfile feature in the image, add it. Signed-off-by: Chao Yu --- common/quota | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/quota b/common/quota index 9af280a2..3f46eb19 100644 --- a/common/quota +++ b/common/quota @@ -80,6 +80,8 @@ _require_prjquota() if [ "$FSTYP" == "f2fs" ]; then dump.f2fs $_dev 2>&1 | grep -qw project_quota [ $? -ne 0 ] && _notrun "Project quota not enabled in this device $_dev" + dump.f2fs $_dev 2>&1 | grep -qw quota_ino + [ $? -ne 0 ] && _notrun "quota sysfile 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