* [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check
@ 2022-03-16 3:32 Yang Xu
2022-03-16 3:32 ` [LTP] [PATCH 2/2] syscalls/quotactl: Remove tst_require_quota_support Yang Xu
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Yang Xu @ 2022-03-16 3:32 UTC (permalink / raw)
To: pvorel; +Cc: ltp, martin.doucha
Ext4 supports project quota since kernel 4.5 instead of 4.10.
Also Q_GETNEXTQUOTA is supported since kernel 4.6, so add
a check for this command like quotactl01 does.
Reported-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
testcases/kernel/syscalls/quotactl/quotactl04.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
index fdd1c9b50..3eb6e4a34 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl04.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
@@ -47,6 +47,7 @@ static struct dqinfo res_qf;
static int32_t fmt_buf;
static struct if_nextdqblk res_ndq;
+static int getnextquota_nsup;
static struct tcase {
int cmd;
@@ -125,6 +126,11 @@ static void setup(void)
SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL);
fd = SAFE_OPEN(MNTPOINT, O_RDONLY);
+
+ TEST(do_quotactl(fd, QCMD(Q_GETNEXTQUOTA, PRJQUOTA), tst_device->dev,
+ test_id, (void *) &res_ndq));
+ if (TST_ERR == EINVAL || TST_ERR == ENOSYS)
+ getnextquota_nsup = 1;
}
static void cleanup(void)
@@ -145,6 +151,11 @@ static void verify_quota(unsigned int n)
tst_res(TINFO, "Test #%d: %s", n, tc->tname);
+ if (tc->cmd == QCMD(Q_GETNEXTQUOTA, PRJQUOTA) && getnextquota_nsup) {
+ tst_res(TCONF, "current system doesn't support this cmd");
+ return;
+ }
+
TST_EXP_PASS_SILENT(do_quotactl(fd, tc->cmd, tst_device->dev, *tc->id, tc->addr),
"do_quotactl to %s", tc->des);
if (!TST_PASS)
@@ -166,7 +177,7 @@ static struct tst_test test = {
"quota_v2",
NULL
},
- .min_kver = "4.10", /* commit 689c958cbe6b (ext4: add project quota support) */
+ .min_kver = "4.5", /* commit 689c958cbe6b (ext4: add project quota support) */
.test = verify_quota,
.tcnt = ARRAY_SIZE(tcases),
.setup = setup,
--
2.23.0
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [LTP] [PATCH 2/2] syscalls/quotactl: Remove tst_require_quota_support
2022-03-16 3:32 [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check Yang Xu
@ 2022-03-16 3:32 ` Yang Xu
2022-03-17 14:01 ` Petr Vorel
2022-03-17 11:03 ` [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check Petr Vorel
2022-03-17 12:01 ` Martin Doucha
2 siblings, 1 reply; 8+ messages in thread
From: Yang Xu @ 2022-03-16 3:32 UTC (permalink / raw)
To: pvorel; +Cc: ltp, martin.doucha
Since we have check quota support on ext4/xfs by using needs_drivers or
needs_kconfigs, we don't need this api any more.
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
include/tst_fs.h | 15 ---------
lib/tst_supported_fs_types.c | 32 -------------------
.../kernel/syscalls/quotactl/quotactl01.c | 2 --
.../kernel/syscalls/quotactl/quotactl04.c | 25 ++-------------
.../kernel/syscalls/quotactl/quotactl06.c | 2 --
5 files changed, 2 insertions(+), 74 deletions(-)
diff --git a/include/tst_fs.h b/include/tst_fs.h
index 3bab9da8b..bc6692bd4 100644
--- a/include/tst_fs.h
+++ b/include/tst_fs.h
@@ -197,21 +197,6 @@ const char **tst_get_supported_fs_types(const char *const *skiplist);
*/
int tst_fs_in_skiplist(const char *fs_type, const char *const *skiplist);
-/*
- * Check whether device supports FS quotas. Negative return value means that
- * quotas appear to be broken.
- */
-int tst_check_quota_support(const char *device, int format, char *quotafile);
-
-/*
- * Check for quota support and terminate the test with appropriate exit status
- * if quotas are not supported or broken.
- */
-#define tst_require_quota_support(dev, fmt, qfile) \
- tst_require_quota_support_(__FILE__, __LINE__, (dev), (fmt), (qfile))
-void tst_require_quota_support_(const char *file, const int lineno,
- const char *device, int format, char *quotafile);
-
/*
* Creates and writes to files on given path until write fails with ENOSPC
*/
diff --git a/lib/tst_supported_fs_types.c b/lib/tst_supported_fs_types.c
index 23e5ce877..9726d193a 100644
--- a/lib/tst_supported_fs_types.c
+++ b/lib/tst_supported_fs_types.c
@@ -173,35 +173,3 @@ const char **tst_get_supported_fs_types(const char *const *skiplist)
return fs_types;
}
-
-int tst_check_quota_support(const char *device, int format, char *quotafile)
-{
- const long ret = quotactl(QCMD(Q_QUOTAON, USRQUOTA), device, format,
- quotafile);
-
- /* Not supported */
-
- if (ret == -1 && errno == ESRCH)
- return 0;
-
- /* Broken */
- if (ret)
- return -1;
-
- quotactl(QCMD(Q_QUOTAOFF, USRQUOTA), device, 0, 0);
- return 1;
-}
-
-void tst_require_quota_support_(const char *file, const int lineno,
- const char *device, int format, char *quotafile)
-{
- int status = tst_check_quota_support(device, format, quotafile);
-
- if (!status) {
- tst_brk_(file, lineno, TCONF,
- "Kernel or device does not support FS quotas");
- }
-
- if (status < 0)
- tst_brk_(file, lineno, TBROK|TERRNO, "FS quotas are broken");
-}
diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 63f6e9181..c14228e35 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -166,8 +166,6 @@ static void setup(void)
if (access(GRPPATH, F_OK) == -1)
tst_brk(TFAIL | TERRNO, "group quotafile didn't exist");
- tst_require_quota_support(tst_device->dev, fmt_id, usrpath);
-
TEST(quotactl(QCMD(Q_GETNEXTQUOTA, USRQUOTA), tst_device->dev,
test_id, (void *) &res_ndq));
if (TST_ERR == EINVAL || TST_ERR == ENOSYS)
diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
index 3eb6e4a34..a57e6be60 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl04.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
@@ -96,35 +96,14 @@ static struct tcase {
};
-static void do_mount(const char *source, const char *target,
- const char *filesystemtype, unsigned long mountflags,
- const void *data)
-{
- TEST(mount(source, target, filesystemtype, mountflags, data));
-
- if (TST_RET == -1 && TST_ERR == ESRCH)
- tst_brk(TCONF, "Kernel or device does not support FS quotas");
-
- if (TST_RET == -1) {
- tst_brk(TBROK | TTERRNO, "mount(%s, %s, %s, %lu, %p) failed",
- source, target, filesystemtype, mountflags, data);
- }
-
- if (TST_RET) {
- tst_brk(TBROK | TTERRNO, "mount(%s, %s, %s, %lu, %p) failed",
- source, target, filesystemtype, mountflags, data);
- }
-
- mount_flag = 1;
-}
-
static void setup(void)
{
const char *const fs_opts[] = {"-I 256", "-O quota,project", NULL};
quotactl_info();
SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
- do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL);
+ SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL);
+ mount_flag = 1;
fd = SAFE_OPEN(MNTPOINT, O_RDONLY);
TEST(do_quotactl(fd, QCMD(Q_GETNEXTQUOTA, PRJQUOTA), tst_device->dev,
diff --git a/testcases/kernel/syscalls/quotactl/quotactl06.c b/testcases/kernel/syscalls/quotactl/quotactl06.c
index feb475022..ae8d7faca 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl06.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl06.c
@@ -189,8 +189,6 @@ static void setup(void)
if (access(USRPATH, F_OK) == -1)
tst_brk(TBROK | TERRNO, "user quotafile didn't exist");
- tst_require_quota_support(tst_device->dev, fmt_id, usrpath);
-
SAFE_MKDIR(TESTDIR1, 0666);
TEST(quotactl(QCMD(Q_GETNEXTQUOTA, USRQUOTA), tst_device->dev,
--
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 1/2] syscalls/quotactl04: Use correct min_kver version check
2022-03-16 3:32 [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check Yang Xu
2022-03-16 3:32 ` [LTP] [PATCH 2/2] syscalls/quotactl: Remove tst_require_quota_support Yang Xu
@ 2022-03-17 11:03 ` Petr Vorel
2022-03-17 12:01 ` Martin Doucha
2 siblings, 0 replies; 8+ messages in thread
From: Petr Vorel @ 2022-03-17 11:03 UTC (permalink / raw)
To: Yang Xu; +Cc: ltp, martin.doucha
Hi Xu,
> Ext4 supports project quota since kernel 4.5 instead of 4.10.
> Also Q_GETNEXTQUOTA is supported since kernel 4.6, so add
> a check for this command like quotactl01 does.
LGTM.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check
2022-03-16 3:32 [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check Yang Xu
2022-03-16 3:32 ` [LTP] [PATCH 2/2] syscalls/quotactl: Remove tst_require_quota_support Yang Xu
2022-03-17 11:03 ` [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check Petr Vorel
@ 2022-03-17 12:01 ` Martin Doucha
2022-03-17 13:49 ` Petr Vorel
2 siblings, 1 reply; 8+ messages in thread
From: Martin Doucha @ 2022-03-17 12:01 UTC (permalink / raw)
To: Yang Xu, pvorel; +Cc: ltp
Hi,
this should have been sent as two separate patches but otherwise:
Reviewed-by: Martin Doucha <mdoucha@suse.cz>
On 16. 03. 22 4:32, Yang Xu wrote:
> Ext4 supports project quota since kernel 4.5 instead of 4.10.
> Also Q_GETNEXTQUOTA is supported since kernel 4.6, so add
> a check for this command like quotactl01 does.
>
> Reported-by: Petr Vorel <pvorel@suse.cz>
> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> ---
> testcases/kernel/syscalls/quotactl/quotactl04.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
> index fdd1c9b50..3eb6e4a34 100644
> --- a/testcases/kernel/syscalls/quotactl/quotactl04.c
> +++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
> @@ -47,6 +47,7 @@ static struct dqinfo res_qf;
> static int32_t fmt_buf;
>
> static struct if_nextdqblk res_ndq;
> +static int getnextquota_nsup;
>
> static struct tcase {
> int cmd;
> @@ -125,6 +126,11 @@ static void setup(void)
> SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
> do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL);
> fd = SAFE_OPEN(MNTPOINT, O_RDONLY);
> +
> + TEST(do_quotactl(fd, QCMD(Q_GETNEXTQUOTA, PRJQUOTA), tst_device->dev,
> + test_id, (void *) &res_ndq));
> + if (TST_ERR == EINVAL || TST_ERR == ENOSYS)
> + getnextquota_nsup = 1;
> }
>
> static void cleanup(void)
> @@ -145,6 +151,11 @@ static void verify_quota(unsigned int n)
>
> tst_res(TINFO, "Test #%d: %s", n, tc->tname);
>
> + if (tc->cmd == QCMD(Q_GETNEXTQUOTA, PRJQUOTA) && getnextquota_nsup) {
> + tst_res(TCONF, "current system doesn't support this cmd");
> + return;
> + }
> +
> TST_EXP_PASS_SILENT(do_quotactl(fd, tc->cmd, tst_device->dev, *tc->id, tc->addr),
> "do_quotactl to %s", tc->des);
> if (!TST_PASS)
> @@ -166,7 +177,7 @@ static struct tst_test test = {
> "quota_v2",
> NULL
> },
> - .min_kver = "4.10", /* commit 689c958cbe6b (ext4: add project quota support) */
> + .min_kver = "4.5", /* commit 689c958cbe6b (ext4: add project quota support) */
> .test = verify_quota,
> .tcnt = ARRAY_SIZE(tcases),
> .setup = setup,
--
Martin Doucha mdoucha@suse.cz
QA Engineer for Software Maintenance
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check
2022-03-17 12:01 ` Martin Doucha
@ 2022-03-17 13:49 ` Petr Vorel
2022-03-18 1:12 ` xuyang2018.jy
0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2022-03-17 13:49 UTC (permalink / raw)
To: Martin Doucha; +Cc: ltp
> Hi,
> this should have been sent as two separate patches but otherwise:
Well, these are 2 actions, but I treated it as somehow atomic (the check is
needed only after fixing .min_kver). I don't have strong opinion whether merged
separated or as single commit.
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH 2/2] syscalls/quotactl: Remove tst_require_quota_support
2022-03-16 3:32 ` [LTP] [PATCH 2/2] syscalls/quotactl: Remove tst_require_quota_support Yang Xu
@ 2022-03-17 14:01 ` Petr Vorel
2022-03-18 1:37 ` xuyang2018.jy
0 siblings, 1 reply; 8+ messages in thread
From: Petr Vorel @ 2022-03-17 14:01 UTC (permalink / raw)
To: Yang Xu; +Cc: ltp, martin.doucha
Hi Xu,
Reviewed-by: Petr Vorel <pvorel@suse.cz>
> Since we have check quota support on ext4/xfs by using needs_drivers or
> needs_kconfigs, we don't need this api any more.
nit: maybe also mention it effectively reverts 4aab31e4c7 and ed1885e0e2?
And that 57d05ce21f (the commit which made these checks redundant)?
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check
2022-03-17 13:49 ` Petr Vorel
@ 2022-03-18 1:12 ` xuyang2018.jy
0 siblings, 0 replies; 8+ messages in thread
From: xuyang2018.jy @ 2022-03-18 1:12 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp@lists.linux.it
Hi Petr, Martin
>> Hi,
>> this should have been sent as two separate patches but otherwise:
> Well, these are 2 actions, but I treated it as somehow atomic (the check is
> needed only after fixing .min_kver). I don't have strong opinion whether merged
> separated or as single commit.
Yes, that is why I add these two actions in a single patch.
Best Regards
Yang Xu
>
> Kind regards,
> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [LTP] [PATCH 2/2] syscalls/quotactl: Remove tst_require_quota_support
2022-03-17 14:01 ` Petr Vorel
@ 2022-03-18 1:37 ` xuyang2018.jy
0 siblings, 0 replies; 8+ messages in thread
From: xuyang2018.jy @ 2022-03-18 1:37 UTC (permalink / raw)
To: Petr Vorel; +Cc: ltp@lists.linux.it, martin.doucha@suse.com
Hi Petr
> Hi Xu,
>
> Reviewed-by: Petr Vorel<pvorel@suse.cz>
>
>> Since we have check quota support on ext4/xfs by using needs_drivers or
>> needs_kconfigs, we don't need this api any more.
>
> nit: maybe also mention it effectively reverts 4aab31e4c7 and ed1885e0e2?
> And that 57d05ce21f (the commit which made these checks redundant)?
Of course, I modified commit message and pushed. Thanks.
Best Regards
Yang Xu
>
> Kind regards,
> Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2022-03-18 1:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-16 3:32 [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check Yang Xu
2022-03-16 3:32 ` [LTP] [PATCH 2/2] syscalls/quotactl: Remove tst_require_quota_support Yang Xu
2022-03-17 14:01 ` Petr Vorel
2022-03-18 1:37 ` xuyang2018.jy
2022-03-17 11:03 ` [LTP] [PATCH 1/2] syscalls/quotactl04: Use correct min_kver version check Petr Vorel
2022-03-17 12:01 ` Martin Doucha
2022-03-17 13:49 ` Petr Vorel
2022-03-18 1:12 ` xuyang2018.jy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.