* [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[]
@ 2020-04-15 8:08 Xiao Yang
2020-04-15 8:08 ` [LTP] [PATCH 2/2] syscalls/quotactl04.c: Specify inode size for prjquota feature Xiao Yang
2020-04-17 4:43 ` [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[] Yang Xu
0 siblings, 2 replies; 6+ messages in thread
From: Xiao Yang @ 2020-04-15 8:08 UTC (permalink / raw)
To: ltp
extra_opts[] is to store the options which are passed after device name
(e.g. fs-size: mkfs -t ext4 /dev/sda1 <fs-size>) so perfer to use
fs_opts[] for quotactl04.c and statx05.c.
References:
https://github.com/linux-test-project/ltp/blob/master/doc/test-writing-guidelines.txt
https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mmap/mmap16.c
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
testcases/kernel/syscalls/quotactl/quotactl04.c | 4 ++--
testcases/kernel/syscalls/statx/statx05.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
index 8dab83da0..b0db8fe5d 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl04.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
@@ -102,10 +102,10 @@ static struct tcase {
static void setup(void)
{
- const char *const extra_opts[] = {"-O quota,project", NULL};
+ const char *const fs_opts[] = {"-O quota,project", NULL};
test_id = geteuid();
- SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, extra_opts);
+ SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, "quota");
mount_flag = 1;
}
diff --git a/testcases/kernel/syscalls/statx/statx05.c b/testcases/kernel/syscalls/statx/statx05.c
index 42911fc17..77684e1ed 100644
--- a/testcases/kernel/syscalls/statx/statx05.c
+++ b/testcases/kernel/syscalls/statx/statx05.c
@@ -87,12 +87,12 @@ static void run(unsigned int i)
static void setup(void)
{
char opt_bsize[32];
- const char *const extra_opts[] = {"-O encrypt", opt_bsize, NULL};
+ const char *const fs_opts[] = {"-O encrypt", opt_bsize, NULL};
int ret;
snprintf(opt_bsize, sizeof(opt_bsize), "-b %i", getpagesize());
- SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, extra_opts);
+ SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, 0);
mount_flag = 1;
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH 2/2] syscalls/quotactl04.c: Specify inode size for prjquota feature
2020-04-15 8:08 [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[] Xiao Yang
@ 2020-04-15 8:08 ` Xiao Yang
2020-04-15 8:42 ` Xiao Yang
2020-04-17 5:00 ` Yang Xu
2020-04-17 4:43 ` [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[] Yang Xu
1 sibling, 2 replies; 6+ messages in thread
From: Xiao Yang @ 2020-04-15 8:08 UTC (permalink / raw)
To: ltp
Background:
1) LTP uses default 256M filesystem to run test.
2) Mke2fs sets inode size to 128 bytes for small filesystem(e.g. 256M) usually.
3) Prjquota feature requires bigger inode size which is at least 256 bytes.
new mke2fs can adjust inode size to 256M automatically by commit 66aae96 in
e2fsprogs, but old mke2fs cannot do it and reports the following error:
-----------------------------------------------------------
mke2fs 1.43.4 (31-Jan-2017)
mkfs.ext4: 128 byte inodes are too small for project quota; specify larger size
-----------------------------------------------------------
Make quotactl04 with old mke2fs works by specifying inode size to 256 bytes.
Signed-off-by: Xiao Yang <yangx.jy@cn.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 b0db8fe5d..73980d7e9 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl04.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
@@ -102,7 +102,7 @@ static struct tcase {
static void setup(void)
{
- const char *const fs_opts[] = {"-O quota,project", NULL};
+ const char *const fs_opts[] = {"-I 256", "-O quota,project", NULL};
test_id = geteuid();
SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [LTP] [PATCH 2/2] syscalls/quotactl04.c: Specify inode size for prjquota feature
2020-04-15 8:08 ` [LTP] [PATCH 2/2] syscalls/quotactl04.c: Specify inode size for prjquota feature Xiao Yang
@ 2020-04-15 8:42 ` Xiao Yang
2020-04-17 5:00 ` Yang Xu
1 sibling, 0 replies; 6+ messages in thread
From: Xiao Yang @ 2020-04-15 8:42 UTC (permalink / raw)
To: ltp
On 2020/4/15 16:08, Xiao Yang wrote:
> Background:
> 1) LTP uses default 256M filesystem to run test.
> 2) Mke2fs sets inode size to 128 bytes for small filesystem(e.g. 256M) usually.
> 3) Prjquota feature requires bigger inode size which is at least 256 bytes.
>
> new mke2fs can adjust inode size to 256M automatically by commit 66aae96 in
Hi,
Sorry, correct 256M to 256 bytes here.
Thanks,
Xiao Yang
> e2fsprogs, but old mke2fs cannot do it and reports the following error:
> -----------------------------------------------------------
> mke2fs 1.43.4 (31-Jan-2017)
> mkfs.ext4: 128 byte inodes are too small for project quota; specify larger size
> -----------------------------------------------------------
>
> Make quotactl04 with old mke2fs works by specifying inode size to 256 bytes.
>
> Signed-off-by: Xiao Yang<yangx.jy@cn.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 b0db8fe5d..73980d7e9 100644
> --- a/testcases/kernel/syscalls/quotactl/quotactl04.c
> +++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
> @@ -102,7 +102,7 @@ static struct tcase {
>
> static void setup(void)
> {
> - const char *const fs_opts[] = {"-O quota,project", NULL};
> + const char *const fs_opts[] = {"-I 256", "-O quota,project", NULL};
>
> test_id = geteuid();
> SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[]
2020-04-15 8:08 [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[] Xiao Yang
2020-04-15 8:08 ` [LTP] [PATCH 2/2] syscalls/quotactl04.c: Specify inode size for prjquota feature Xiao Yang
@ 2020-04-17 4:43 ` Yang Xu
2020-04-17 6:44 ` Xiao Yang
1 sibling, 1 reply; 6+ messages in thread
From: Yang Xu @ 2020-04-17 4:43 UTC (permalink / raw)
To: ltp
Hi Xiao
> extra_opts[] is to store the options which are passed after device name
> (e.g. fs-size: mkfs -t ext4 /dev/sda1 <fs-size>) so perfer to use
> fs_opts[] for quotactl04.c and statx05.c.
Looks good to me, I guess we can add comment in
test-writing-guidelines.txt ie:
"If options can be passed before or after device name, 'fs_opts' is
preferred."
Best Regards
Yang Xu
>
> References:
> https://github.com/linux-test-project/ltp/blob/master/doc/test-writing-guidelines.txt
> https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mmap/mmap16.c
>
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
> testcases/kernel/syscalls/quotactl/quotactl04.c | 4 ++--
> testcases/kernel/syscalls/statx/statx05.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c
> index 8dab83da0..b0db8fe5d 100644
> --- a/testcases/kernel/syscalls/quotactl/quotactl04.c
> +++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
> @@ -102,10 +102,10 @@ static struct tcase {
>
> static void setup(void)
> {
> - const char *const extra_opts[] = {"-O quota,project", NULL};
> + const char *const fs_opts[] = {"-O quota,project", NULL};
>
> test_id = geteuid();
> - SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, extra_opts);
> + SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
> SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, "quota");
> mount_flag = 1;
> }
> diff --git a/testcases/kernel/syscalls/statx/statx05.c b/testcases/kernel/syscalls/statx/statx05.c
> index 42911fc17..77684e1ed 100644
> --- a/testcases/kernel/syscalls/statx/statx05.c
> +++ b/testcases/kernel/syscalls/statx/statx05.c
> @@ -87,12 +87,12 @@ static void run(unsigned int i)
> static void setup(void)
> {
> char opt_bsize[32];
> - const char *const extra_opts[] = {"-O encrypt", opt_bsize, NULL};
> + const char *const fs_opts[] = {"-O encrypt", opt_bsize, NULL};
> int ret;
>
> snprintf(opt_bsize, sizeof(opt_bsize), "-b %i", getpagesize());
>
> - SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, extra_opts);
> + SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
> SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, 0);
> mount_flag = 1;
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH 2/2] syscalls/quotactl04.c: Specify inode size for prjquota feature
2020-04-15 8:08 ` [LTP] [PATCH 2/2] syscalls/quotactl04.c: Specify inode size for prjquota feature Xiao Yang
2020-04-15 8:42 ` Xiao Yang
@ 2020-04-17 5:00 ` Yang Xu
1 sibling, 0 replies; 6+ messages in thread
From: Yang Xu @ 2020-04-17 5:00 UTC (permalink / raw)
To: ltp
Hi Xiao
Acked.
> Background:
> 1) LTP uses default 256M filesystem to run test.
> 2) Mke2fs sets inode size to 128 bytes for small filesystem(e.g. 256M) usually.
> 3) Prjquota feature requires bigger inode size which is at least 256 bytes.
>
> new mke2fs can adjust inode size to 256M automatically by commit 66aae96 in
> e2fsprogs, but old mke2fs cannot do it and reports the following error:
> -----------------------------------------------------------
> mke2fs 1.43.4 (31-Jan-2017)
> mkfs.ext4: 128 byte inodes are too small for project quota; specify larger size
> -----------------------------------------------------------
>
> Make quotactl04 with old mke2fs works by specifying inode size to 256 bytes.
>
> Signed-off-by: Xiao Yang <yangx.jy@cn.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 b0db8fe5d..73980d7e9 100644
> --- a/testcases/kernel/syscalls/quotactl/quotactl04.c
> +++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
> @@ -102,7 +102,7 @@ static struct tcase {
>
> static void setup(void)
> {
> - const char *const fs_opts[] = {"-O quota,project", NULL};
> + const char *const fs_opts[] = {"-I 256", "-O quota,project", NULL};
>
> test_id = geteuid();
> SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[]
2020-04-17 4:43 ` [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[] Yang Xu
@ 2020-04-17 6:44 ` Xiao Yang
0 siblings, 0 replies; 6+ messages in thread
From: Xiao Yang @ 2020-04-17 6:44 UTC (permalink / raw)
To: ltp
On 2020/4/17 12:43, Yang Xu wrote:
> Hi Xiao
>
>
>> extra_opts[] is to store the options which are passed after device name
>> (e.g. fs-size: mkfs -t ext4 /dev/sda1 <fs-size>) so perfer to use
>> fs_opts[] for quotactl04.c and statx05.c.
> Looks good to me, I guess we can add comment in
> test-writing-guidelines.txt ie:
> "If options can be passed before or after device name, 'fs_opts' is
> preferred."
Hi Xu,
Thanks for your comment.
I will add a hint to doc/test-writing-guidelines.txt.
Thanks,
Xiao Yang
>
> Best Regards
> Yang Xu
>>
>> References:
>> https://github.com/linux-test-project/ltp/blob/master/doc/test-writing-guidelines.txt
>>
>> https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/mmap/mmap16.c
>>
>>
>> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
>> ---
>> testcases/kernel/syscalls/quotactl/quotactl04.c | 4 ++--
>> testcases/kernel/syscalls/statx/statx05.c | 4 ++--
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c
>> b/testcases/kernel/syscalls/quotactl/quotactl04.c
>> index 8dab83da0..b0db8fe5d 100644
>> --- a/testcases/kernel/syscalls/quotactl/quotactl04.c
>> +++ b/testcases/kernel/syscalls/quotactl/quotactl04.c
>> @@ -102,10 +102,10 @@ static struct tcase {
>> static void setup(void)
>> {
>> - const char *const extra_opts[] = {"-O quota,project", NULL};
>> + const char *const fs_opts[] = {"-O quota,project", NULL};
>> test_id = geteuid();
>> - SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, extra_opts);
>> + SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
>> SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, "quota");
>> mount_flag = 1;
>> }
>> diff --git a/testcases/kernel/syscalls/statx/statx05.c
>> b/testcases/kernel/syscalls/statx/statx05.c
>> index 42911fc17..77684e1ed 100644
>> --- a/testcases/kernel/syscalls/statx/statx05.c
>> +++ b/testcases/kernel/syscalls/statx/statx05.c
>> @@ -87,12 +87,12 @@ static void run(unsigned int i)
>> static void setup(void)
>> {
>> char opt_bsize[32];
>> - const char *const extra_opts[] = {"-O encrypt", opt_bsize, NULL};
>> + const char *const fs_opts[] = {"-O encrypt", opt_bsize, NULL};
>> int ret;
>> snprintf(opt_bsize, sizeof(opt_bsize), "-b %i", getpagesize());
>> - SAFE_MKFS(tst_device->dev, tst_device->fs_type, NULL, extra_opts);
>> + SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL);
>> SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, 0);
>> mount_flag = 1;
>>
> .
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-04-17 6:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-15 8:08 [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[] Xiao Yang
2020-04-15 8:08 ` [LTP] [PATCH 2/2] syscalls/quotactl04.c: Specify inode size for prjquota feature Xiao Yang
2020-04-15 8:42 ` Xiao Yang
2020-04-17 5:00 ` Yang Xu
2020-04-17 4:43 ` [LTP] [PATCH 1/2] syscalls/{quotactl04, statx05}.c: Replace extra_opts[] with fs_opts[] Yang Xu
2020-04-17 6:44 ` Xiao Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).