public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 01/12] syscalls/quotactl01: Also test with vfsv1 format
@ 2021-11-09 10:52 Yang Xu
  2021-11-09 10:52 ` [LTP] [PATCH v3 02/12] syscalls/quotactl06: " Yang Xu
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Yang Xu @ 2021-11-09 10:52 UTC (permalink / raw)
  To: ltp

Since usrquota and groupquota supports visible quota files
with two formats(vfsv0 and vfsv1) on ext4, so add a test variants to
test it.

Also fix docparse formatting and move some code to lapi/quotactl.h or
quotactl_var.h for reuse.

Remove useless geteuid.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 include/lapi/quotactl.h                       |  9 +++
 .../kernel/syscalls/quotactl/quotactl01.c     | 78 +++++++++----------
 .../syscalls/quotactl/quotactl_fmt_var.h      | 22 ++++++
 3 files changed, 70 insertions(+), 39 deletions(-)
 create mode 100644 testcases/kernel/syscalls/quotactl/quotactl_fmt_var.h

diff --git a/include/lapi/quotactl.h b/include/lapi/quotactl.h
index c1ec9d6e1..8e0315d03 100644
--- a/include/lapi/quotactl.h
+++ b/include/lapi/quotactl.h
@@ -8,6 +8,7 @@
 #ifndef LAPI_QUOTACTL_H__
 #define LAPI_QUOTACTL_H__
 
+#include "config.h"
 #include <sys/quota.h>
 
 #ifdef HAVE_STRUCT_IF_NEXTDQBLK
@@ -75,4 +76,12 @@ struct fs_quota_statv {
 # define Q_GETNEXTQUOTA 0x800009 /* get disk limits and usage >= ID */
 #endif
 
+#ifndef QFMT_VFS_V0
+# define QFMT_VFS_V0 2
+#endif
+
+#ifndef QFMT_VFS_V1
+# define QFMT_VFS_V1 4
+#endif
+
 #endif /* LAPI_QUOTACTL_H__ */
diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 56146b595..1e0f5da70 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -1,57 +1,47 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) Crackerjack Project., 2007
- * Copyright (c) 2016-2019 FUJITSU LIMITED. All rights reserved
+ * Copyright (c) 2016-2021 FUJITSU LIMITED. All rights reserved
  * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
+ * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
+ */
+
+/*\
+ * [Description]
+ * This testcases checks that quotactl(2) on ext4 filesystem succeeds to:
  *
- * This testcase checks the basic flag of quotactl(2) for non-XFS filesystems:
- * 1) quotactl(2) succeeds to turn on quota with Q_QUOTAON flag for user.
- * 2) quotactl(2) succeeds to set disk quota limits with Q_SETQUOTA flag
- *    for user.
- * 3) quotactl(2) succeeds to get disk quota limits with Q_GETQUOTA flag
- *    for user.
- * 4) quotactl(2) succeeds to set information about quotafile with Q_SETINFO
- *    flag for user.
- * 5) quotactl(2) succeeds to get information about quotafile with Q_GETINFO
- *    flag for user.
- * 6) quotactl(2) succeeds to get quota format with Q_GETFMT flag for user.
- * 7) quotactl(2) succeeds to update quota usages with Q_SYNC flag for user.
- * 8) quotactl(2) succeeds to get disk quota limit greater than or equal to
- *    ID with Q_GETNEXTQUOTA flag for user.
- * 9) quotactl(2) succeeds to turn off quota with Q_QUOTAOFF flag for user.
- * 10) quotactl(2) succeeds to turn on quota with Q_QUOTAON flag for group.
- * 11) quotactl(2) succeeds to set disk quota limits with Q_SETQUOTA flag
- *     for group.
- * 12) quotactl(2) succeeds to get disk quota limits with Q_GETQUOTA flag
- *     for group.
- * 13) quotactl(2) succeeds to set information about quotafile with Q_SETINFO
- *     flag for group.
- * 14) quotactl(2) succeeds to get information about quotafile with Q_GETINFO
- *     flag for group.
- * 15) quotactl(2) succeeds to get quota format with Q_GETFMT flag for group.
- * 16) quotactl(2) succeeds to update quota usages with Q_SYNC flag for group.
- * 17) quotactl(2) succeeds to get disk quota limit greater than or equal to
- *     ID with Q_GETNEXTQUOTA flag for group.
- * 18) quotactl(2) succeeds to turn off quota with Q_QUOTAOFF flag for group.
+ * - turn on quota with Q_QUOTAON flag for user
+ * - set disk quota limits with Q_SETQUOTA flag for user
+ * - get disk quota limits with Q_GETQUOTA flag for user
+ * - set information about quotafile with Q_SETINFO flag for user
+ * - get information about quotafile with Q_GETINFO flag for user
+ * - get quota format with Q_GETFMT flag for user
+ * - update quota usages with Q_SYNC flag for user
+ * - get disk quota limit greater than or equal to ID with Q_GETNEXTQUOTA flag for user
+ * - turn off quota with Q_QUOTAOFF flag for user
+ * - turn on quota with Q_QUOTAON flag for group
+ * - set disk quota limits with Q_SETQUOTA flag for group
+ * - get disk quota limits with Q_GETQUOTA flag for group
+ * - set information about quotafile with Q_SETINFO flag for group
+ * - get information about quotafile with Q_GETINFO flag for group
+ * - get quota format with Q_GETFMT flag for group
+ * - update quota usages with Q_SYNC flag for group
+ * - get disk quota limit greater than or equal to ID with Q_GETNEXTQUOTA flag for group
+ * - turn off quota with Q_QUOTAOFF flag for group
  */
 
-#include "config.h"
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
 #include <stdio.h>
-#include "lapi/quotactl.h"
 #include "tst_test.h"
+#include "quotactl_fmt_var.h"
 
-#ifndef QFMT_VFS_V0
-# define QFMT_VFS_V0	2
-#endif
 #define USRPATH MNTPOINT "/aquota.user"
 #define GRPPATH MNTPOINT "/aquota.group"
-#define FMTID	QFMT_VFS_V0
 #define MNTPOINT	"mntpoint"
 
-static int32_t fmt_id = FMTID;
+static int32_t fmt_id;
 static int test_id;
 static char usrpath[] = USRPATH;
 static char grppath[] = GRPPATH;
@@ -163,11 +153,13 @@ static struct tcase {
 
 static void setup(void)
 {
-	const char *const cmd[] = {"quotacheck", "-ugF", "vfsv0", MNTPOINT, NULL};
+	const struct quotactl_fmt_variant *var = &fmt_variants[tst_variant];
+	const char *const cmd[] = {"quotacheck", "-ugF", var->fmt_name, MNTPOINT, NULL};
 
+	tst_res(TINFO, "quotactl() with %s format", var->fmt_name);
 	SAFE_CMD(cmd, NULL, NULL);
+	fmt_id = var->fmt_id;
 
-	test_id = geteuid();
 	if (access(USRPATH, F_OK) == -1)
 		tst_brk(TFAIL | TERRNO, "user quotafile didn't exist");
 
@@ -182,6 +174,12 @@ static void setup(void)
 		getnextquota_nsup = 1;
 }
 
+static void cleanup(void)
+{
+	SAFE_UNLINK(USRPATH);
+	SAFE_UNLINK(GRPPATH);
+}
+
 static void verify_quota(unsigned int n)
 {
 	struct tcase *tc = &tcases[n];
@@ -231,4 +229,6 @@ static struct tst_test test = {
 		NULL
 	},
 	.setup = setup,
+	.cleanup = cleanup,
+	.test_variants = QUOTACTL_FMT_VARIANTS,
 };
diff --git a/testcases/kernel/syscalls/quotactl/quotactl_fmt_var.h b/testcases/kernel/syscalls/quotactl/quotactl_fmt_var.h
new file mode 100644
index 000000000..cb9fa4625
--- /dev/null
+++ b/testcases/kernel/syscalls/quotactl/quotactl_fmt_var.h
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (c) 2021 FUJITSU LIMITED. All rights reserved.
+ * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
+ */
+
+#ifndef LTP_QUOTACTL_FMT_VAR_H
+#define LTP_QUOTACTL_FMT_VAR_H
+
+#include "lapi/quotactl.h"
+
+#define QUOTACTL_FMT_VARIANTS 2
+
+static struct quotactl_fmt_variant {
+	int32_t fmt_id;
+	const char *fmt_name;
+} fmt_variants[] = {
+	{.fmt_id = QFMT_VFS_V0, .fmt_name = "vfsv0"},
+	{.fmt_id = QFMT_VFS_V1, .fmt_name = "vfsv1"}
+};
+
+#endif /* LAPI_QUOTACTL_FMT_VAR_H__ */
-- 
2.23.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH v3 02/12] syscalls/quotactl06: Also test with vfsv1 format
  2021-11-09 10:52 [LTP] [PATCH v3 01/12] syscalls/quotactl01: Also test with vfsv1 format Yang Xu
@ 2021-11-09 10:52 ` Yang Xu
  2021-11-09 10:52 ` [LTP] [PATCH v3 03/12] syscalls/quotactl04: Remove useless mount option Yang Xu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Yang Xu @ 2021-11-09 10:52 UTC (permalink / raw)
  To: ltp

Add a linux tag and fix docparse formatting.

Also remove useless geteuid.

Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 .../kernel/syscalls/quotactl/quotactl06.c     | 89 ++++++++++++-------
 1 file changed, 56 insertions(+), 33 deletions(-)

diff --git a/testcases/kernel/syscalls/quotactl/quotactl06.c b/testcases/kernel/syscalls/quotactl/quotactl06.c
index a10d1ca07..21a86ad1e 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl06.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl06.c
@@ -1,41 +1,49 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
- * Author: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
+ * Copyright (c) 2019-2021 FUJITSU LIMITED. All rights reserved.
+ * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
+ */
+
+/*\
+ * [Description]
+ *
+ * Tests basic error handling of the quotactl syscall with visible quota files
+ * (cover two formats, vfsv0 and vfsv1):
+ *
+ * - EACCES when cmd is Q_QUOTAON and addr existed but not a regular file
+ * - ENOENT when the file specified by special or addr does not exist
+ * - EBUSTY when cmd is Q_QUOTAON and another Q_QUOTAON had already been performed
+ * - EFAULT when addr or special is invalid
+ * - EINVAL when cmd or type is invalid
+ * - ENOTBLK when special is not a block device
+ * - ESRCH when no disk quota is found for the indicated user and quotas have not been
+ *   turned on for this fs
+ * - ESRCH when cmd is Q_QUOTAON, but the quota format was not found
+ * - ESRCH when cmd is Q_GETNEXTQUOTA, but there is no ID greater than or equal to id that
+ *   has an active quota
+ * - ERANGE when cmd is Q_SETQUOTA, but the specified limits are out of the range allowed
+ *   by the quota format
+ * - EPERM when the caller lacked the required privilege (CAP_SYS_ADMIN) for the specified
+ *   operation
+ *
+ * For ERANGE error, the vfsv0 and vfsv1 format's maximum quota limit setting have been
+ * fixed since the following kernel patch:
+ *
+ *  commit 7e08da50cf706151f324349f9235ebd311226997
+ *  Author: Jan Kara <jack@suse.cz>
+ *  Date:   Wed Mar 4 14:42:02 2015 +0100
  *
- * Tests basic error handling of the quotactl syscall.
- * 1) quotactl fails with EACCES when cmd is Q_QUOTAON and addr
- * existed but not a regular file.
- * 2) quotaclt fails with ENOENT when the file specified by special
- * or addr does not exist.
- * 3) quotactl fails with EBUSTY when  cmd is Q_QUOTAON and another
- * Q_QUOTAON had already been performed.
- * 4) quotactl fails with EFAULT when addr or special is invalid.
- * 5) quotactl fails with EINVAL when cmd or type is invalid.
- * 6) quotactl fails with ENOTBLK when special is not a block device.
- * 7) quotactl fails with ESRCH when no disk quota is found for the
- * indicated user and quotas have not been turned on for this fs.
- * 8) quotactl fails with ESRCH when cmd is Q_QUOTAON, but the quota
- * format was not found.
- * 9) quotactl fails with ESRCH when cmd is Q_GETNEXTQUOTA, but there
- * is no ID greater than or equal to id that has an active quota.
- * 10) quotactl fails with ERANGE when cmd is Q_SETQUOTA, but the
- * specified limits are out of the range allowed by the quota format.
- * 11) quotactl fails with EPERM when the caller lacked the required
- * privilege (CAP_SYS_ADMIN) for the specified operation.
+ *  quota: Fix maximum quota limit settings
  */
 
 #include <errno.h>
 #include <sys/quota.h>
 #include "tst_test.h"
-#include "lapi/quotactl.h"
+#include "quotactl_fmt_var.h"
 #include "tst_capability.h"
 
 #define OPTION_INVALID 999
-#define QFMT_VFS_V0     2
 #define USRPATH MNTPOINT "/aquota.user"
-#define FMTID QFMT_VFS_V0
-
 #define MNTPOINT "mntpoint"
 #define TESTDIR1 MNTPOINT "/testdir1"
 #define TESTDIR2 MNTPOINT "/testdir2"
@@ -43,9 +51,9 @@
 static char usrpath[] = USRPATH;
 static char testdir1[] = TESTDIR1;
 static char testdir2[] = TESTDIR2;
-static int32_t fmt_id = FMTID;
+static int32_t fmt_id;
 static int32_t fmt_invalid = 999;
-static int test_invalid;
+static int test_invalid = 1;
 static int test_id;
 static int getnextquota_nsup;
 
@@ -105,7 +113,7 @@ static void verify_quotactl(unsigned int n)
 
 	if (tc->on_flag) {
 		TEST(quotactl(QCMD(Q_QUOTAON, USRQUOTA), tst_device->dev,
-			FMTID, usrpath));
+			fmt_id, usrpath));
 		if (TST_RET == -1)
 			tst_brk(TBROK,
 				"quotactl with Q_QUOTAON returned %ld", TST_RET);
@@ -135,7 +143,7 @@ static void verify_quotactl(unsigned int n)
 
 	if (quota_on) {
 		TEST(quotactl(QCMD(Q_QUOTAOFF, USRQUOTA), tst_device->dev,
-			FMTID, usrpath));
+			fmt_id, usrpath));
 		if (TST_RET == -1)
 			tst_brk(TBROK,
 				"quotactl with Q_QUOTAOFF returned %ld", TST_RET);
@@ -150,10 +158,15 @@ static void verify_quotactl(unsigned int n)
 
 static void setup(void)
 {
-	const char *const cmd[] = {"quotacheck", "-uF", "vfsv0", MNTPOINT, NULL};
 	unsigned int i;
+	const struct quotactl_fmt_variant *var = &fmt_variants[tst_variant];
+	const char *const cmd[] = {"quotacheck", "-ugF", var->fmt_name, MNTPOINT, NULL};
 
+	tst_res(TINFO, "quotactl() with %s format", var->fmt_name);
 	SAFE_CMD(cmd, NULL, NULL);
+	fmt_id = var->fmt_id;
+	/* vfsv0 block limit 2^42, vfsv1 block limit 2^63 - 1 */
+	set_dqmax.dqb_bsoftlimit = tst_variant ? 0x20000000000000 : 0x100000000;
 
 	if (access(USRPATH, F_OK) == -1)
 		tst_brk(TFAIL | TERRNO, "user quotafile didn't exist");
@@ -161,8 +174,6 @@ static void setup(void)
 	tst_require_quota_support(tst_device->dev, fmt_id, usrpath);
 
 	SAFE_MKDIR(TESTDIR1, 0666);
-	test_id = geteuid();
-	test_invalid = test_id + 1;
 
 	TEST(quotactl(QCMD(Q_GETNEXTQUOTA, USRQUOTA), tst_device->dev,
 		test_id, (void *) &res_ndq));
@@ -175,8 +186,15 @@ static void setup(void)
 	}
 }
 
+static void cleanup(void)
+{
+	SAFE_UNLINK(USRPATH);
+	SAFE_RMDIR(TESTDIR1);
+}
+
 static struct tst_test test = {
 	.setup = setup,
+	.cleanup = cleanup,
 	.needs_kconfigs = (const char *[]) {
 		"CONFIG_QFMT_V2",
 		NULL
@@ -192,4 +210,9 @@ static struct tst_test test = {
 		NULL
 	},
 	.needs_root = 1,
+	.test_variants = QUOTACTL_FMT_VARIANTS,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "7e08da50cf70"},
+		{}
+	}
 };
-- 
2.23.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH v3 03/12] syscalls/quotactl04: Remove useless mount option
  2021-11-09 10:52 [LTP] [PATCH v3 01/12] syscalls/quotactl01: Also test with vfsv1 format Yang Xu
  2021-11-09 10:52 ` [LTP] [PATCH v3 02/12] syscalls/quotactl06: " Yang Xu
@ 2021-11-09 10:52 ` Yang Xu
  2021-11-10 15:26   ` Cyril Hrubis
  2021-11-09 10:52 ` [LTP] [PATCH v3 04/12] syscalls/quotactl:Add docparse formatting Yang Xu
  2021-11-09 10:52 ` [LTP] [PATCH v3 05/12] lapi/syscalls: Add syscall number for quotactl_fd Yang Xu
  3 siblings, 1 reply; 8+ messages in thread
From: Yang Xu @ 2021-11-09 10:52 UTC (permalink / raw)
  To: ltp

When use -O quota options for mkfs.ext4, quota mount option will be ignored
since 3.5 kernel[1]. Since the Oldest tested kernel version is 3.10,
we can remove mount option directly.

[1]https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7c319d3

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 testcases/kernel/syscalls/quotactl/quotactl04.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
index fd3afc888..f3e2cf3a5 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl04.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
@@ -141,7 +141,7 @@ static void setup(void)
 		tst_brk(TCONF, "Test needs mkfs.ext4 >= 1.43 for quota,project option, test skipped");
 	pclose(f);
 	SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
-	do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, "quota");
+	do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL);
 }
 
 static void cleanup(void)
-- 
2.23.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH v3 04/12] syscalls/quotactl:Add docparse formatting
  2021-11-09 10:52 [LTP] [PATCH v3 01/12] syscalls/quotactl01: Also test with vfsv1 format Yang Xu
  2021-11-09 10:52 ` [LTP] [PATCH v3 02/12] syscalls/quotactl06: " Yang Xu
  2021-11-09 10:52 ` [LTP] [PATCH v3 03/12] syscalls/quotactl04: Remove useless mount option Yang Xu
@ 2021-11-09 10:52 ` Yang Xu
  2021-11-10 15:37   ` Cyril Hrubis
  2021-11-09 10:52 ` [LTP] [PATCH v3 05/12] lapi/syscalls: Add syscall number for quotactl_fd Yang Xu
  3 siblings, 1 reply; 8+ messages in thread
From: Yang Xu @ 2021-11-09 10:52 UTC (permalink / raw)
  To: ltp

Also remove useless header files and add linux git in test structure.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 .../kernel/syscalls/quotactl/quotactl02.c     | 54 ++++++-------------
 .../kernel/syscalls/quotactl/quotactl02.h     |  3 +-
 .../kernel/syscalls/quotactl/quotactl03.c     | 17 +++---
 .../kernel/syscalls/quotactl/quotactl04.c     | 39 ++++++--------
 .../kernel/syscalls/quotactl/quotactl05.c     | 32 +++++------
 .../kernel/syscalls/quotactl/quotactl07.c     |  9 ++--
 6 files changed, 65 insertions(+), 89 deletions(-)

diff --git a/testcases/kernel/syscalls/quotactl/quotactl02.c b/testcases/kernel/syscalls/quotactl/quotactl02.c
index ad81ee7e5..55a6a8906 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl02.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl02.c
@@ -1,50 +1,28 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * Copyright (c) 2013-2019 FUJITSU LIMITED. All rights reserved
+ * Copyright (c) 2013-2021 FUJITSU LIMITED. All rights reserved
  * Author: DAN LI <li.dan@cn.fujitsu.com>
- * Author: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
+ * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
  */
 
 /*\
  * [Description]
  *
- * This testcase checks basic flags of quotactl(2) for an XFS file system:
+ * This testcases checks that quotactl(2) on xfs filesystem succeeds to:
  *
- * 1. quotactl(2) succeeds to turn off xfs quota and get xfs quota off status
- *    for user.
- *
- * 2. quotactl(2) succeeds to turn on xfs quota and get xfs quota on status
- *    for user.
- *
- * 3. quotactl(2) succeeds to set and use Q_XGETQUOTA to get xfs disk quota
- *    limits for user.
- *
- * 4. quotactl(2) succeeds to set and use Q_XGETNEXTQUOTA to get xfs disk
- *    quota limits greater than or equal to ID for user.
- *
- * 5. quotactl(2) succeeds to turn off xfs quota and get xfs quota off statv
- *    for user.
- *
- * 6. quotactl(2) succeeds to turn on xfs quota and get xfs quota on statv
- *    for user.
- *
- * 7. quotactl(2) succeeds to turn off xfs quota and get xfs quota off status
- *    for group.
- *
- * 8. quotactl(2) succeeds to turn on xfs quota and get xfs quota on status
- *    for group.
- *
- * 9. quotactl(2) succeeds to set and use Q_XGETQUOTA to get xfs disk quota
- *    limits for group.
- *
- * 10. quotactl(2) succeeds to set and use Q_XGETNEXTQUOTA to get xfs disk
- *     quota limits for group.
- *
- * 11. quotactl(2) succeeds to turn off xfs quota and get xfs quota off statv
- *     for group.
- *
- * 12. quotactl(2) succeeds to turn on xfs quota and get xfs quota on statv
- *     for group.
+ * - turn off xfs quota and get xfs quota off status for user
+ * - turn on xfs quota and get xfs quota on status for user
+ * - set and use Q_XGETQUOTA to get xfs disk quota limits for user
+ * - set and use Q_XGETNEXTQUOTA to get xfs disk quota limits greater than or
+ *   equal to ID for user
+ * - turn off xfs quota and get xfs quota off statv for user
+ * - turn on xfs quota and get xfs quota on statv for user
+ * - turn off xfs quota and get xfs quota off status for group
+ * - turn on xfs quota and get xfs quota on status for group
+ * - set and use Q_XGETQUOTA to get xfs disk quota limits for group
+ * - set and use Q_XGETNEXTQUOTA to get xfs disk quota limits for group
+ * - turn off xfs quota and get xfs quota off statv for group
+ * - turn on xfs quota and get xfs quota on statv for gorup
  */
 
 #include "quotactl02.h"
diff --git a/testcases/kernel/syscalls/quotactl/quotactl02.h b/testcases/kernel/syscalls/quotactl/quotactl02.h
index 37f3d7eb7..3351fb578 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl02.h
+++ b/testcases/kernel/syscalls/quotactl/quotactl02.h
@@ -1,14 +1,13 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
- * Author: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
+ * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
  */
 
 #ifndef QUOTACTL02_H
 #define QUOTACTL02_H
 
 #define _GNU_SOURCE
-#include "config.h"
 #include <errno.h>
 #include <unistd.h>
 #include <stdio.h>
diff --git a/testcases/kernel/syscalls/quotactl/quotactl03.c b/testcases/kernel/syscalls/quotactl/quotactl03.c
index 3ec931727..e0e4bf5b2 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl03.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl03.c
@@ -4,10 +4,9 @@
  * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
  */
 
-/*
- * Test Name: quotactl03
+/*\
+ * [Description]
  *
- * Description:
  * quotactl(2) with XGETNEXTQUOTA looks for the next active quota for an user
  * equal or higher to a given ID, in this test the ID is specified to a value
  * close to UINT_MAX(max value of unsigned int). When reaching the upper limit
@@ -16,11 +15,11 @@
  *
  * This kernel bug of xfs has been fixed in:
  *
- * commit 657bdfb7f5e68ca5e2ed009ab473c429b0d6af85
- * Author: Eric Sandeen <sandeen@redhat.com>
- * Date:   Tue Jan 17 11:43:38 2017 -0800
+ *  commit 657bdfb7f5e68ca5e2ed009ab473c429b0d6af85
+ *  Author: Eric Sandeen <sandeen@redhat.com>
+ *  Date:   Tue Jan 17 11:43:38 2017 -0800
  *
- *     xfs: don't wrap ID in xfs_dq_get_next_id
+ *  xfs: don't wrap ID in xfs_dq_get_next_id
  */
 
 #define _GNU_SOURCE
@@ -75,6 +74,10 @@ static struct tst_test test = {
 	.dev_fs_type = "xfs",
 	.mntpoint = mntpoint,
 	.mnt_data = "usrquota",
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "657bdfb7f5e6"},
+		{}
+	}
 };
 
 #else
diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
index f3e2cf3a5..dab61cf4d 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl04.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
@@ -1,24 +1,22 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
- * Author: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
+ * Copyright (c) 2019-2021 FUJITSU LIMITED. All rights reserved.
+ * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
+ */
+
+/*\
+ * [Description]
  *
- * This testcase checks the basic flag of quotactl(2) for project quota on
- * non-XFS filesystems.
+ * This testcase checks that quotactl(2) on ext4 filesystem succeeds to:
  *
- * 1) quotactl(2) succeeds to turn on quota with Q_QUOTAON flag for project.
- * 2) quotactl(2) succeeds to set disk quota limits with Q_SETQUOTA flag
- *    for project.
- * 3) quotactl(2) succeeds to get disk quota limits with Q_GETQUOTA flag
- *    for project.
- * 4) quotactl(2) succeeds to set information about quotafile with Q_SETINFO
- *    flag for project.
- * 5) quotactl(2) succeeds to get information about quotafile with Q_GETINFO
- *    flag for project.
- * 6) quotactl(2) succeeds to get quota format with Q_GETFMT flag for project.
- * 7) quotactl(2) succeeds to get disk quota limit greater than or equal to
- *    ID with Q_GETNEXTQUOTA flag for project.
- * 8) quotactl(2) succeeds to turn off quota with Q_QUOTAOFF flag for project.
+ * - turn on quota with Q_QUOTAON flag for project
+ * - set disk quota limits with Q_SETQUOTA flag for project
+ * - get disk quota limits with Q_GETQUOTA flag for project
+ * - set information about quotafile with Q_SETINFO flag for project
+ * - get information about quotafile with Q_GETINFO flag for project
+ * - get quota format with Q_GETFMT flag for project
+ * - get disk quota limit greater than or equal to ID with Q_GETNEXTQUOTA flag for project
+ * - turn off quota with Q_QUOTAOFF flag for project
  *
  * Minimum e2fsprogs version required is 1.43.
  */
@@ -29,14 +27,9 @@
 #include <stdio.h>
 #include <sys/stat.h>
 #include <sys/mount.h>
-#include "config.h"
-#include "lapi/quotactl.h"
 #include "tst_safe_stdio.h"
 #include "tst_test.h"
-
-#ifndef QFMT_VFS_V1
-# define QFMT_VFS_V1 4
-#endif
+#include "lapi/quotactl.h"
 
 #define FMTID QFMT_VFS_V1
 #define MNTPOINT	"mntpoint"
diff --git a/testcases/kernel/syscalls/quotactl/quotactl05.c b/testcases/kernel/syscalls/quotactl/quotactl05.c
index e811e47a4..15a6c1e67 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl05.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl05.c
@@ -1,23 +1,23 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
- * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
- * Author: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
+ * Copyright (c) 2019-2021 FUJITSU LIMITED. All rights reserved.
+ * Author: Yang Xu <xuyang2018.jy@.fujitsu.com>
+ */
+
+/*\
+ * [Description]
  *
- * This testcase checks basic flags of quotactl(2) for project on an XFS file
- * system:
- * 1) quotactl(2) succeeds to turn off xfs quota and get xfs quota off status
- *    for project.
- * 2) quotactl(2) succeeds to turn on xfs quota and get xfs quota on status
- *    for project.
- * 3) quotactl(2) succeeds to set and use Q_XGETQUOTA to get xfs disk quota
- *    limits for project.
- * 4) quotactl(2) succeeds to set and use Q_XGETNEXTQUOTA to get xfs disk
- *    quota limits Cgreater than or equal to ID for project.
- * 5) quotactl(2) succeeds to turn off xfs quota and get xfs quota off statv
- *    for project.
- * 6) quotactl(2) succeeds to turn on xfs quota and get xfs quota on statv
- *    for project.
+ * This testcases checks that quotactl(2) on xfs filesystem succeeds to:
+ *
+ * - turn off xfs quota and get xfs quota off status for project
+ * - turn on xfs quota and get xfs quota on status for project
+ * - set and use Q_XGETQUOTA to get xfs disk quota limits for project
+ * - set and use Q_XGETNEXTQUOTA to get xfs disk quota limits greater than or
+ *   equal to ID for project
+ * - turn off xfs quota and get xfs quota off statv for project
+ * - turn on xfs quota and get xfs quota on statvfor project
  */
+
 #include "quotactl02.h"
 #if defined(HAVE_XFS_XQM_H)
 
diff --git a/testcases/kernel/syscalls/quotactl/quotactl07.c b/testcases/kernel/syscalls/quotactl/quotactl07.c
index db477589b..2992a6112 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl07.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl07.c
@@ -1,19 +1,22 @@
 // SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
- * Author: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
+ * Author: Yang Xu <xuyang2018.jy@fujitsu.com>
+ */
+
+/*\
+ * [Description]
  *
  * This is a regresstion test for kernel commit 3dd4d40b4208
  * ("xfs: Sanity check flags of Q_XQUOTARM call").
  */
 
-#include "config.h"
 #include <errno.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <sys/quota.h>
-#include "lapi/quotactl.h"
 #include "tst_test.h"
+#include "lapi/quotactl.h"
 
 #ifdef HAVE_XFS_XQM_H
 # include <xfs/xqm.h>
-- 
2.23.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [LTP] [PATCH v3 05/12] lapi/syscalls: Add syscall number for quotactl_fd
  2021-11-09 10:52 [LTP] [PATCH v3 01/12] syscalls/quotactl01: Also test with vfsv1 format Yang Xu
                   ` (2 preceding siblings ...)
  2021-11-09 10:52 ` [LTP] [PATCH v3 04/12] syscalls/quotactl:Add docparse formatting Yang Xu
@ 2021-11-09 10:52 ` Yang Xu
  3 siblings, 0 replies; 8+ messages in thread
From: Yang Xu @ 2021-11-09 10:52 UTC (permalink / raw)
  To: ltp

Add syscall number for quotactl_fd, refer to glibc's submission[1].

[1]https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=89dc0372a9055e7ef86fe19be6201fa0b16b2f0e

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
---
 include/lapi/syscalls/aarch64.in   | 1 +
 include/lapi/syscalls/arc.in       | 1 +
 include/lapi/syscalls/arm.in       | 1 +
 include/lapi/syscalls/hppa.in      | 1 +
 include/lapi/syscalls/i386.in      | 1 +
 include/lapi/syscalls/ia64.in      | 1 +
 include/lapi/syscalls/mips_n32.in  | 1 +
 include/lapi/syscalls/mips_n64.in  | 1 +
 include/lapi/syscalls/mips_o32.in  | 1 +
 include/lapi/syscalls/powerpc.in   | 1 +
 include/lapi/syscalls/powerpc64.in | 1 +
 include/lapi/syscalls/s390.in      | 1 +
 include/lapi/syscalls/s390x.in     | 1 +
 include/lapi/syscalls/sh.in        | 1 +
 include/lapi/syscalls/sparc.in     | 1 +
 include/lapi/syscalls/sparc64.in   | 1 +
 include/lapi/syscalls/x86_64.in    | 1 +
 17 files changed, 17 insertions(+)

diff --git a/include/lapi/syscalls/aarch64.in b/include/lapi/syscalls/aarch64.in
index a47185954..89b63ee4b 100644
--- a/include/lapi/syscalls/aarch64.in
+++ b/include/lapi/syscalls/aarch64.in
@@ -294,4 +294,5 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
 _sysctl 1078
diff --git a/include/lapi/syscalls/arc.in b/include/lapi/syscalls/arc.in
index 9c1654b0b..72420754a 100644
--- a/include/lapi/syscalls/arc.in
+++ b/include/lapi/syscalls/arc.in
@@ -314,3 +314,4 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/arm.in b/include/lapi/syscalls/arm.in
index ded2f5e03..2a78d7c3c 100644
--- a/include/lapi/syscalls/arm.in
+++ b/include/lapi/syscalls/arm.in
@@ -392,3 +392,4 @@ close_range (__NR_SYSCALL_BASE+436)
 openat2 (__NR_SYSCALL_BASE+437)
 pidfd_getfd (__NR_SYSCALL_BASE+438)
 epoll_pwait2 (__NR_SYSCALL_BASE+441)
+quotactl_fd (__NR_SYSCALL_BASE+443)
diff --git a/include/lapi/syscalls/hppa.in b/include/lapi/syscalls/hppa.in
index d8f142b6a..2f0fc8153 100644
--- a/include/lapi/syscalls/hppa.in
+++ b/include/lapi/syscalls/hppa.in
@@ -41,3 +41,4 @@ fspick 433
 pidfd_open 434
 close_range 436
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/i386.in b/include/lapi/syscalls/i386.in
index f69268e10..34a8a621f 100644
--- a/include/lapi/syscalls/i386.in
+++ b/include/lapi/syscalls/i386.in
@@ -428,3 +428,4 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/ia64.in b/include/lapi/syscalls/ia64.in
index 3ba2406c4..b729cd3f0 100644
--- a/include/lapi/syscalls/ia64.in
+++ b/include/lapi/syscalls/ia64.in
@@ -341,3 +341,4 @@ close_range 1460
 openat2 1461
 pidfd_getfd 1462
 epoll_pwait2 1465
+quotactl_fd 1467
diff --git a/include/lapi/syscalls/mips_n32.in b/include/lapi/syscalls/mips_n32.in
index dad8107f4..46098a616 100644
--- a/include/lapi/syscalls/mips_n32.in
+++ b/include/lapi/syscalls/mips_n32.in
@@ -369,3 +369,4 @@ faccessat2 6439
 process_madvise 6440
 epoll_pwait2 6441
 mount_setattr 6442
+quotactl_fd 6443
diff --git a/include/lapi/syscalls/mips_n64.in b/include/lapi/syscalls/mips_n64.in
index a6c0c8cdd..07f96ac5d 100644
--- a/include/lapi/syscalls/mips_n64.in
+++ b/include/lapi/syscalls/mips_n64.in
@@ -345,3 +345,4 @@ faccessat2 5439
 process_madvise 5440
 epoll_pwait2 5441
 mount_setattr 5442
+quotactl_fd 5443
diff --git a/include/lapi/syscalls/mips_o32.in b/include/lapi/syscalls/mips_o32.in
index 238f77009..5e64a4a1c 100644
--- a/include/lapi/syscalls/mips_o32.in
+++ b/include/lapi/syscalls/mips_o32.in
@@ -415,3 +415,4 @@ faccessat2 4439
 process_madvise 4440
 epoll_pwait2 4441
 mount_setattr 4442
+quotactl_fd 4443
diff --git a/include/lapi/syscalls/powerpc.in b/include/lapi/syscalls/powerpc.in
index a4ed2169c..f4e85940c 100644
--- a/include/lapi/syscalls/powerpc.in
+++ b/include/lapi/syscalls/powerpc.in
@@ -421,3 +421,4 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/powerpc64.in b/include/lapi/syscalls/powerpc64.in
index a4ed2169c..f4e85940c 100644
--- a/include/lapi/syscalls/powerpc64.in
+++ b/include/lapi/syscalls/powerpc64.in
@@ -421,3 +421,4 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/s390.in b/include/lapi/syscalls/s390.in
index d99e5fd9e..3e16d8475 100644
--- a/include/lapi/syscalls/s390.in
+++ b/include/lapi/syscalls/s390.in
@@ -408,3 +408,4 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/s390x.in b/include/lapi/syscalls/s390x.in
index f26cdaaae..beb0819af 100644
--- a/include/lapi/syscalls/s390x.in
+++ b/include/lapi/syscalls/s390x.in
@@ -356,3 +356,4 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/sh.in b/include/lapi/syscalls/sh.in
index 20ee61ccc..a81cf8297 100644
--- a/include/lapi/syscalls/sh.in
+++ b/include/lapi/syscalls/sh.in
@@ -402,3 +402,4 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/sparc.in b/include/lapi/syscalls/sparc.in
index 86decdd82..6a7817ae5 100644
--- a/include/lapi/syscalls/sparc.in
+++ b/include/lapi/syscalls/sparc.in
@@ -407,3 +407,4 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/sparc64.in b/include/lapi/syscalls/sparc64.in
index 02dfe473a..d3995181c 100644
--- a/include/lapi/syscalls/sparc64.in
+++ b/include/lapi/syscalls/sparc64.in
@@ -372,3 +372,4 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
diff --git a/include/lapi/syscalls/x86_64.in b/include/lapi/syscalls/x86_64.in
index cf6d78bf6..a5b2a24fe 100644
--- a/include/lapi/syscalls/x86_64.in
+++ b/include/lapi/syscalls/x86_64.in
@@ -349,6 +349,7 @@ close_range 436
 openat2 437
 pidfd_getfd 438
 epoll_pwait2 441
+quotactl_fd 443
 rt_sigaction 512
 rt_sigreturn 513
 ioctl 514
-- 
2.23.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH v3 03/12] syscalls/quotactl04: Remove useless mount option
  2021-11-09 10:52 ` [LTP] [PATCH v3 03/12] syscalls/quotactl04: Remove useless mount option Yang Xu
@ 2021-11-10 15:26   ` Cyril Hrubis
  0 siblings, 0 replies; 8+ messages in thread
From: Cyril Hrubis @ 2021-11-10 15:26 UTC (permalink / raw)
  To: Yang Xu; +Cc: ltp

Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH v3 04/12] syscalls/quotactl:Add docparse formatting
  2021-11-09 10:52 ` [LTP] [PATCH v3 04/12] syscalls/quotactl:Add docparse formatting Yang Xu
@ 2021-11-10 15:37   ` Cyril Hrubis
  2021-11-11  2:52     ` xuyang2018.jy
  0 siblings, 1 reply; 8+ messages in thread
From: Cyril Hrubis @ 2021-11-10 15:37 UTC (permalink / raw)
  To: Yang Xu; +Cc: ltp

Hi!
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>

-- 
Cyril Hrubis
chrubis@suse.cz

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [LTP] [PATCH v3 04/12] syscalls/quotactl:Add docparse formatting
  2021-11-10 15:37   ` Cyril Hrubis
@ 2021-11-11  2:52     ` xuyang2018.jy
  0 siblings, 0 replies; 8+ messages in thread
From: xuyang2018.jy @ 2021-11-11  2:52 UTC (permalink / raw)
  To: Cyril Hrubis; +Cc: ltp@lists.linux.it

Hi Cyril
> Hi!
> Reviewed-by: Cyril Hrubis<chrubis@suse.cz>
>
I have merged the first 6 patches.

Thanks for your review.

Best Regards
Yang Xu

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-11  2:52 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-09 10:52 [LTP] [PATCH v3 01/12] syscalls/quotactl01: Also test with vfsv1 format Yang Xu
2021-11-09 10:52 ` [LTP] [PATCH v3 02/12] syscalls/quotactl06: " Yang Xu
2021-11-09 10:52 ` [LTP] [PATCH v3 03/12] syscalls/quotactl04: Remove useless mount option Yang Xu
2021-11-10 15:26   ` Cyril Hrubis
2021-11-09 10:52 ` [LTP] [PATCH v3 04/12] syscalls/quotactl:Add docparse formatting Yang Xu
2021-11-10 15:37   ` Cyril Hrubis
2021-11-11  2:52     ` xuyang2018.jy
2021-11-09 10:52 ` [LTP] [PATCH v3 05/12] lapi/syscalls: Add syscall number for quotactl_fd Yang Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox