public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <yuchao0@huawei.com>
To: fstests@vger.kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net, chao@kernel.org,
	Chao Yu <yuchao0@huawei.com>
Subject: [PATCH 2/2] common/quota: adapt _require_prjquota() for f2fs
Date: Sun, 30 Sep 2018 17:26:53 +0800	[thread overview]
Message-ID: <20180930092653.122684-2-yuchao0@huawei.com> (raw)
In-Reply-To: <20180930092653.122684-1-yuchao0@huawei.com>

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 <yuchao0@huawei.com>
---
 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
-- 
2.18.0.rc1

  reply	other threads:[~2018-09-30 15:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-30  9:26 [PATCH 1/2] check: recognize f2fs through parameter Chao Yu
2018-09-30  9:26 ` Chao Yu [this message]
2018-10-06  9:32 ` Eryu Guan
2018-10-07 13:51   ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180930092653.122684-2-yuchao0@huawei.com \
    --to=yuchao0@huawei.com \
    --cc=chao@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox