* [LTP] [PATCH 0/3] quotactl ESRCH fixes
@ 2022-02-23 15:32 Petr Vorel
2022-02-23 15:32 ` [LTP] [PATCH 1/3] quotactl: Move do_mount() to header Petr Vorel
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Petr Vorel @ 2022-02-23 15:32 UTC (permalink / raw)
To: ltp
Hi,
simple cleanup to use already provided errno ESRCH handling.
Fortunately all tests which require do_mount() use
quotactl_syscall_var.h, thus I didn't have to introduce yet another
header.
Kind regards,
Petr
Petr Vorel (3):
quotactl: Move do_mount() to header
quotactl08: Use do_mount()
quotactl09: Use do_mount()
.../kernel/syscalls/quotactl/quotactl04.c | 25 ++-----------------
.../kernel/syscalls/quotactl/quotactl08.c | 2 +-
.../kernel/syscalls/quotactl/quotactl09.c | 16 +++++++++---
.../syscalls/quotactl/quotactl_syscall_var.h | 25 +++++++++++++++++--
4 files changed, 39 insertions(+), 29 deletions(-)
--
2.35.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 15+ messages in thread* [LTP] [PATCH 1/3] quotactl: Move do_mount() to header 2022-02-23 15:32 [LTP] [PATCH 0/3] quotactl ESRCH fixes Petr Vorel @ 2022-02-23 15:32 ` Petr Vorel 2022-02-23 15:32 ` [LTP] [PATCH 2/3] quotactl08: Use do_mount() Petr Vorel 2022-02-23 15:32 ` [LTP] [PATCH 3/3] quotactl09: " Petr Vorel 2 siblings, 0 replies; 15+ messages in thread From: Petr Vorel @ 2022-02-23 15:32 UTC (permalink / raw) To: ltp This allows do_mount() to be reusable in quotactl08.c and quotactl09.c. Add inline keyword to it and to the other two functions (to follow LTP convention). Signed-off-by: Petr Vorel <pvorel@suse.cz> --- .../kernel/syscalls/quotactl/quotactl04.c | 25 ++----------------- .../syscalls/quotactl/quotactl_syscall_var.h | 25 +++++++++++++++++-- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/testcases/kernel/syscalls/quotactl/quotactl04.c b/testcases/kernel/syscalls/quotactl/quotactl04.c index 55da282705..f45ee43960 100644 --- a/testcases/kernel/syscalls/quotactl/quotactl04.c +++ b/testcases/kernel/syscalls/quotactl/quotactl04.c @@ -25,7 +25,6 @@ #include <string.h> #include <unistd.h> #include <sys/stat.h> -#include <sys/mount.h> #include "tst_test.h" #include "quotactl_syscall_var.h" @@ -95,28 +94,6 @@ 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}; @@ -124,6 +101,8 @@ static void setup(void) 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); + mount_flag = 1; + fd = SAFE_OPEN(MNTPOINT, O_RDONLY); } diff --git a/testcases/kernel/syscalls/quotactl/quotactl_syscall_var.h b/testcases/kernel/syscalls/quotactl/quotactl_syscall_var.h index 3d1a2c8f5a..ba25fd9936 100644 --- a/testcases/kernel/syscalls/quotactl/quotactl_syscall_var.h +++ b/testcases/kernel/syscalls/quotactl/quotactl_syscall_var.h @@ -7,6 +7,7 @@ #ifndef LTP_QUOTACTL_SYSCALL_VAR_H #define LTP_QUOTACTL_SYSCALL_VAR_H +#include <sys/mount.h> #include "lapi/quotactl.h" #define QUOTACTL_SYSCALL_VARIANTS 2 @@ -14,14 +15,14 @@ static int fd = -1; -static int do_quotactl(int fd, int cmd, const char *special, int id, caddr_t addr) +static inline int do_quotactl(int fd, int cmd, const char *special, int id, caddr_t addr) { if (tst_variant == 0) return quotactl(cmd, special, id, addr); return quotactl_fd(fd, cmd, id, addr); } -static void quotactl_info(void) +static inline void quotactl_info(void) { if (tst_variant == 0) tst_res(TINFO, "Test quotactl()"); @@ -29,4 +30,24 @@ static void quotactl_info(void) tst_res(TINFO, "Test quotactl_fd()"); } +static inline 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); + } +} + #endif /* LTP_QUOTACTL_SYSCALL_VAR_H */ -- 2.35.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 15+ messages in thread
* [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-02-23 15:32 [LTP] [PATCH 0/3] quotactl ESRCH fixes Petr Vorel 2022-02-23 15:32 ` [LTP] [PATCH 1/3] quotactl: Move do_mount() to header Petr Vorel @ 2022-02-23 15:32 ` Petr Vorel 2022-02-24 1:47 ` xuyang2018.jy 2022-02-23 15:32 ` [LTP] [PATCH 3/3] quotactl09: " Petr Vorel 2 siblings, 1 reply; 15+ messages in thread From: Petr Vorel @ 2022-02-23 15:32 UTC (permalink / raw) To: ltp to change quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) to TCONF if FS quota is not supported (the same fix as 4aab31e4c7). Signed-off-by: Petr Vorel <pvorel@suse.cz> --- testcases/kernel/syscalls/quotactl/quotactl08.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/kernel/syscalls/quotactl/quotactl08.c b/testcases/kernel/syscalls/quotactl/quotactl08.c index 3793867f23..9f54bebcc0 100644 --- a/testcases/kernel/syscalls/quotactl/quotactl08.c +++ b/testcases/kernel/syscalls/quotactl/quotactl08.c @@ -157,7 +157,7 @@ static void setup(void) quotactl_info(); SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL); - SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); + do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); mount_flag = 1; fd = SAFE_OPEN(MNTPOINT, O_RDONLY); -- 2.35.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-02-23 15:32 ` [LTP] [PATCH 2/3] quotactl08: Use do_mount() Petr Vorel @ 2022-02-24 1:47 ` xuyang2018.jy 2022-02-28 13:49 ` Petr Vorel ` (2 more replies) 0 siblings, 3 replies; 15+ messages in thread From: xuyang2018.jy @ 2022-02-24 1:47 UTC (permalink / raw) To: Petr Vorel; +Cc: ltp@lists.linux.it Hi Petr > to change > quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) I doubt why fs quota is not supported on this case since we have check kernel config? Best Regards Yang Xu > > to TCONF if FS quota is not supported (the same fix as 4aab31e4c7). > > Signed-off-by: Petr Vorel<pvorel@suse.cz> > --- > testcases/kernel/syscalls/quotactl/quotactl08.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/testcases/kernel/syscalls/quotactl/quotactl08.c b/testcases/kernel/syscalls/quotactl/quotactl08.c > index 3793867f23..9f54bebcc0 100644 > --- a/testcases/kernel/syscalls/quotactl/quotactl08.c > +++ b/testcases/kernel/syscalls/quotactl/quotactl08.c > @@ -157,7 +157,7 @@ static void setup(void) > quotactl_info(); > > SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL); > - SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); > + do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); > mount_flag = 1; > > fd = SAFE_OPEN(MNTPOINT, O_RDONLY); -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-02-24 1:47 ` xuyang2018.jy @ 2022-02-28 13:49 ` Petr Vorel 2022-02-28 16:19 ` Petr Vorel 2022-03-03 11:38 ` Martin Doucha 2 siblings, 0 replies; 15+ messages in thread From: Petr Vorel @ 2022-02-28 13:49 UTC (permalink / raw) To: xuyang2018.jy@fujitsu.com; +Cc: ltp@lists.linux.it > Hi Petr > > to change > > quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) > I doubt why fs quota is not supported on this case since we have check > kernel config? I have no idea. And yes, the config contains CONFIG_QFMT_V2=m Kind regards, Petr > Best Regards > Yang Xu > > to TCONF if FS quota is not supported (the same fix as 4aab31e4c7). > > Signed-off-by: Petr Vorel<pvorel@suse.cz> > > --- > > testcases/kernel/syscalls/quotactl/quotactl08.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/testcases/kernel/syscalls/quotactl/quotactl08.c b/testcases/kernel/syscalls/quotactl/quotactl08.c > > index 3793867f23..9f54bebcc0 100644 > > --- a/testcases/kernel/syscalls/quotactl/quotactl08.c > > +++ b/testcases/kernel/syscalls/quotactl/quotactl08.c > > @@ -157,7 +157,7 @@ static void setup(void) > > quotactl_info(); > > SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL); > > - SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); > > + do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); > > mount_flag = 1; > > fd = SAFE_OPEN(MNTPOINT, O_RDONLY); -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-02-24 1:47 ` xuyang2018.jy 2022-02-28 13:49 ` Petr Vorel @ 2022-02-28 16:19 ` Petr Vorel 2022-03-01 1:11 ` xuyang2018.jy 2022-03-03 11:38 ` Martin Doucha 2 siblings, 1 reply; 15+ messages in thread From: Petr Vorel @ 2022-02-28 16:19 UTC (permalink / raw) To: xuyang2018.jy@fujitsu.com; +Cc: Martin Doucha, ltp@lists.linux.it Hi Xu, > Hi Petr > > to change > > quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) > I doubt why fs quota is not supported on this case since we have check > kernel config? There is probably bug on the SUT, thus it might be correct it fails. But how about martin's fix 4aab31e4c7 ("syscalls/quotactl: Skip tests if FS quota is not supported") - quotactl04.c also checks for CONFIG_QFMT_V2 and uses do_mount(). I'll check whether it was another bug on the system. Kind regards, Petr > Best Regards > Yang Xu > > to TCONF if FS quota is not supported (the same fix as 4aab31e4c7). > > Signed-off-by: Petr Vorel<pvorel@suse.cz> > > --- > > testcases/kernel/syscalls/quotactl/quotactl08.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/testcases/kernel/syscalls/quotactl/quotactl08.c b/testcases/kernel/syscalls/quotactl/quotactl08.c > > index 3793867f23..9f54bebcc0 100644 > > --- a/testcases/kernel/syscalls/quotactl/quotactl08.c > > +++ b/testcases/kernel/syscalls/quotactl/quotactl08.c > > @@ -157,7 +157,7 @@ static void setup(void) > > quotactl_info(); > > SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL); > > - SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); > > + do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); > > mount_flag = 1; > > fd = SAFE_OPEN(MNTPOINT, O_RDONLY); -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-02-28 16:19 ` Petr Vorel @ 2022-03-01 1:11 ` xuyang2018.jy 2022-03-01 7:58 ` Petr Vorel 0 siblings, 1 reply; 15+ messages in thread From: xuyang2018.jy @ 2022-03-01 1:11 UTC (permalink / raw) To: Petr Vorel; +Cc: Martin Doucha, ltp@lists.linux.it Hi Petr > Hi Xu, > >> Hi Petr >>> to change >>> quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) >> I doubt why fs quota is not supported on this case since we have check >> kernel config? > > There is probably bug on the SUT, thus it might be correct it fails. > > But how about martin's fix 4aab31e4c7 ("syscalls/quotactl: Skip tests if FS > quota is not supported") - quotactl04.c also checks for CONFIG_QFMT_V2 and uses > do_mount(). I'll check whether it was another bug on the system. Maybe we miss check the following kernel config? CONFIG_QUOTA=y CONFIG_QUOTA_TREE=y CONFIG_QUOTACTL=y Best Regards Yang Xu > > Kind regards, > Petr > >> Best Regards >> Yang Xu > >>> to TCONF if FS quota is not supported (the same fix as 4aab31e4c7). > >>> Signed-off-by: Petr Vorel<pvorel@suse.cz> >>> --- >>> testcases/kernel/syscalls/quotactl/quotactl08.c | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>> diff --git a/testcases/kernel/syscalls/quotactl/quotactl08.c b/testcases/kernel/syscalls/quotactl/quotactl08.c >>> index 3793867f23..9f54bebcc0 100644 >>> --- a/testcases/kernel/syscalls/quotactl/quotactl08.c >>> +++ b/testcases/kernel/syscalls/quotactl/quotactl08.c >>> @@ -157,7 +157,7 @@ static void setup(void) >>> quotactl_info(); > >>> SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL); >>> - SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); >>> + do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); >>> mount_flag = 1; > >>> fd = SAFE_OPEN(MNTPOINT, O_RDONLY); -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-03-01 1:11 ` xuyang2018.jy @ 2022-03-01 7:58 ` Petr Vorel 2022-03-01 8:10 ` xuyang2018.jy 0 siblings, 1 reply; 15+ messages in thread From: Petr Vorel @ 2022-03-01 7:58 UTC (permalink / raw) To: xuyang2018.jy@fujitsu.com; +Cc: Martin Doucha, ltp@lists.linux.it > Hi Petr > > Hi Xu, > >> Hi Petr > >>> to change > >>> quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) > >> I doubt why fs quota is not supported on this case since we have check > >> kernel config? > > There is probably bug on the SUT, thus it might be correct it fails. > > But how about martin's fix 4aab31e4c7 ("syscalls/quotactl: Skip tests if FS > > quota is not supported") - quotactl04.c also checks for CONFIG_QFMT_V2 and uses > > do_mount(). I'll check whether it was another bug on the system. > Maybe we miss check the following kernel config? In my case it's probably a problem with mkfs. > CONFIG_QUOTA=y Selected by [m]: - OCFS2_FS [=m] && BLOCK [=y] && INET [=y] && SYSFS [=y] && CONFIGFS_FS [=m] => very unlikely not to be selected (but we might want to check also corner case configurations; but I guess also CONFIG_QUOTA=m would be ok) > CONFIG_QUOTA_TREE=y Selected by [m]: - OCFS2_FS [=m] && BLOCK [=y] && INET [=y] && SYSFS [=y] && CONFIGFS_FS [=m] Selected by [n]: - QFMT_V2 [=n] && QUOTA [=y] ditto > CONFIG_QUOTACTL=y Selected by [y]: - QUOTA [=y] Selected by [m]: - XFS_QUOTA [=y] && BLOCK [=y] && XFS_FS [=m] - GFS2_FS [=m] && BLOCK [=y] even more likely to be selected. Kind regards, Petr > Best Regards > Yang Xu > > Kind regards, > > Petr > >> Best Regards > >> Yang Xu > >>> to TCONF if FS quota is not supported (the same fix as 4aab31e4c7). > >>> Signed-off-by: Petr Vorel<pvorel@suse.cz> > >>> --- > >>> testcases/kernel/syscalls/quotactl/quotactl08.c | 2 +- > >>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>> diff --git a/testcases/kernel/syscalls/quotactl/quotactl08.c b/testcases/kernel/syscalls/quotactl/quotactl08.c > >>> index 3793867f23..9f54bebcc0 100644 > >>> --- a/testcases/kernel/syscalls/quotactl/quotactl08.c > >>> +++ b/testcases/kernel/syscalls/quotactl/quotactl08.c > >>> @@ -157,7 +157,7 @@ static void setup(void) > >>> quotactl_info(); > >>> SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL); > >>> - SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); > >>> + do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); > >>> mount_flag = 1; > >>> fd = SAFE_OPEN(MNTPOINT, O_RDONLY); -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-03-01 7:58 ` Petr Vorel @ 2022-03-01 8:10 ` xuyang2018.jy 2022-03-01 10:17 ` Petr Vorel 0 siblings, 1 reply; 15+ messages in thread From: xuyang2018.jy @ 2022-03-01 8:10 UTC (permalink / raw) To: Petr Vorel; +Cc: Martin Doucha, ltp@lists.linux.it Hi Petr >> Hi Petr >>> Hi Xu, > >>>> Hi Petr >>>>> to change >>>>> quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) >>>> I doubt why fs quota is not supported on this case since we have check >>>> kernel config? > >>> There is probably bug on the SUT, thus it might be correct it fails. > >>> But how about martin's fix 4aab31e4c7 ("syscalls/quotactl: Skip tests if FS >>> quota is not supported") - quotactl04.c also checks for CONFIG_QFMT_V2 and uses >>> do_mount(). I'll check whether it was another bug on the system. >> Maybe we miss check the following kernel config? > In my case it's probably a problem with mkfs. Another possible way about loop driver. So do you use default loop image to create ext4 filesystem or export LTP_DEV? Best Regards Yang Xu > >> CONFIG_QUOTA=y > Selected by [m]: > - OCFS2_FS [=m]&& BLOCK [=y]&& INET [=y]&& SYSFS [=y]&& CONFIGFS_FS [=m] > => very unlikely not to be selected (but we might want to check also corner case > configurations; but I guess also CONFIG_QUOTA=m would be ok) > >> CONFIG_QUOTA_TREE=y > Selected by [m]: > - OCFS2_FS [=m]&& BLOCK [=y]&& INET [=y]&& SYSFS [=y]&& CONFIGFS_FS [=m] > Selected by [n]: > - QFMT_V2 [=n]&& QUOTA [=y] > ditto > >> CONFIG_QUOTACTL=y > Selected by [y]: > - QUOTA [=y] > Selected by [m]: > - XFS_QUOTA [=y]&& BLOCK [=y]&& XFS_FS [=m] > - GFS2_FS [=m]&& BLOCK [=y] > even more likely to be selected. > > Kind regards, > Petr > >> Best Regards >> Yang Xu > >>> Kind regards, >>> Petr > >>>> Best Regards >>>> Yang Xu > >>>>> to TCONF if FS quota is not supported (the same fix as 4aab31e4c7). > >>>>> Signed-off-by: Petr Vorel<pvorel@suse.cz> >>>>> --- >>>>> testcases/kernel/syscalls/quotactl/quotactl08.c | 2 +- >>>>> 1 file changed, 1 insertion(+), 1 deletion(-) > >>>>> diff --git a/testcases/kernel/syscalls/quotactl/quotactl08.c b/testcases/kernel/syscalls/quotactl/quotactl08.c >>>>> index 3793867f23..9f54bebcc0 100644 >>>>> --- a/testcases/kernel/syscalls/quotactl/quotactl08.c >>>>> +++ b/testcases/kernel/syscalls/quotactl/quotactl08.c >>>>> @@ -157,7 +157,7 @@ static void setup(void) >>>>> quotactl_info(); > >>>>> SAFE_MKFS(tst_device->dev, tst_device->fs_type, fs_opts, NULL); >>>>> - SAFE_MOUNT(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); >>>>> + do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); >>>>> mount_flag = 1; > >>>>> fd = SAFE_OPEN(MNTPOINT, O_RDONLY); -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-03-01 8:10 ` xuyang2018.jy @ 2022-03-01 10:17 ` Petr Vorel 2022-03-03 11:41 ` Martin Doucha 0 siblings, 1 reply; 15+ messages in thread From: Petr Vorel @ 2022-03-01 10:17 UTC (permalink / raw) To: xuyang2018.jy@fujitsu.com; +Cc: Martin Doucha, ltp@lists.linux.it Hi Xu, ... > >>>>> to change > >>>>> quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) > >>>> I doubt why fs quota is not supported on this case since we have check > >>>> kernel config? > >>> There is probably bug on the SUT, thus it might be correct it fails. > >>> But how about martin's fix 4aab31e4c7 ("syscalls/quotactl: Skip tests if FS > >>> quota is not supported") - quotactl04.c also checks for CONFIG_QFMT_V2 and uses > >>> do_mount(). I'll check whether it was another bug on the system. > >> Maybe we miss check the following kernel config? > > In my case it's probably a problem with mkfs. > Another possible way about loop driver. So do you use default loop image > to create ext4 filesystem or export LTP_DEV? FYI: in our case it was JeOS broken due missing quota_v2 kernel driver (JeOS tries to be minimal, so it's always a fiddling between space and functionality). I'm still not sure if we want to add check for .needs_drivers quota_v2. Kind regards, Petr -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-03-01 10:17 ` Petr Vorel @ 2022-03-03 11:41 ` Martin Doucha 2022-03-03 12:55 ` Petr Vorel 0 siblings, 1 reply; 15+ messages in thread From: Martin Doucha @ 2022-03-03 11:41 UTC (permalink / raw) To: Petr Vorel, xuyang2018.jy@fujitsu.com; +Cc: ltp@lists.linux.it, Martin Doucha On 01. 03. 22 11:17, Petr Vorel wrote: > FYI: in our case it was JeOS broken due missing quota_v2 kernel driver > (JeOS tries to be minimal, so it's always a fiddling between space and > functionality). I'm still not sure if we want to add check for .needs_drivers > quota_v2. .needs_drivers would probably be the cleaner solution. -- 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] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-03-03 11:41 ` Martin Doucha @ 2022-03-03 12:55 ` Petr Vorel 0 siblings, 0 replies; 15+ messages in thread From: Petr Vorel @ 2022-03-03 12:55 UTC (permalink / raw) To: Martin Doucha; +Cc: ltp@lists.linux.it, Martin Doucha Hi Martin, > On 01. 03. 22 11:17, Petr Vorel wrote: > > FYI: in our case it was JeOS broken due missing quota_v2 kernel driver > > (JeOS tries to be minimal, so it's always a fiddling between space and > > functionality). I'm still not sure if we want to add check for .needs_drivers > > quota_v2. > .needs_drivers would probably be the cleaner solution. Sure - I'm closing this as wrong approach. I just wasn't sure if we want to check for .needs_drivers. Because there could be numerous of other tests which require test for missing driver. And it's relevant just fo JeOS like installations, which strive for minimal size. BTW in our case it endup with module added to kernel-default-base package (thus to be always installed). Kind regards, Petr -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-02-24 1:47 ` xuyang2018.jy 2022-02-28 13:49 ` Petr Vorel 2022-02-28 16:19 ` Petr Vorel @ 2022-03-03 11:38 ` Martin Doucha 2022-03-04 2:57 ` xuyang2018.jy 2 siblings, 1 reply; 15+ messages in thread From: Martin Doucha @ 2022-03-03 11:38 UTC (permalink / raw) To: xuyang2018.jy@fujitsu.com, Petr Vorel; +Cc: ltp@lists.linux.it On 24. 02. 22 2:47, xuyang2018.jy@fujitsu.com wrote: > Hi Petr >> to change >> quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) > I doubt why fs quota is not supported on this case since we have check > kernel config? In this case, kernel config says that quota is enabled as a module (=M). But the module is packaged in a separate RPM and the test is running on a minimalistic system where that RPM is not available. Therefore just checking the kernel config is not sufficient. We need to query actual module presence. (Sorry for duplicate mail, I forgot to CC the mailing list.) -- 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] 15+ messages in thread
* Re: [LTP] [PATCH 2/3] quotactl08: Use do_mount() 2022-03-03 11:38 ` Martin Doucha @ 2022-03-04 2:57 ` xuyang2018.jy 0 siblings, 0 replies; 15+ messages in thread From: xuyang2018.jy @ 2022-03-04 2:57 UTC (permalink / raw) To: Martin Doucha; +Cc: ltp@lists.linux.it Hi Martin > On 24. 02. 22 2:47, xuyang2018.jy@fujitsu.com wrote: >> Hi Petr >>> to change >>> quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) >> I doubt why fs quota is not supported on this case since we have check >> kernel config? > > In this case, kernel config says that quota is enabled as a module (=M). > But the module is packaged in a separate RPM and the test is running on > a minimalistic system where that RPM is not available. Therefore just > checking the kernel config is not sufficient. We need to query actual > module presence. > > (Sorry for duplicate mail, I forgot to CC the mailing list.) Oh, I replied the personal mail. Thanks for your explaination. I don't know this complex situation before. I think the quota module is belong to kernel-default package but not belong to kernel-default-base package. So jeos use kernel-default-base will pass kernel config check but indeed it miss this module. This problem also occurs on centos if we use module from kernel-module-extra. So a better solution is that if the module is belong to kernel-default-base ,then we can use kconfig check, but if the module is not belong to kernel-default-base, then use need_driver maybe more correct. Best Regards Yang Xu > -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply [flat|nested] 15+ messages in thread
* [LTP] [PATCH 3/3] quotactl09: Use do_mount() 2022-02-23 15:32 [LTP] [PATCH 0/3] quotactl ESRCH fixes Petr Vorel 2022-02-23 15:32 ` [LTP] [PATCH 1/3] quotactl: Move do_mount() to header Petr Vorel 2022-02-23 15:32 ` [LTP] [PATCH 2/3] quotactl08: Use do_mount() Petr Vorel @ 2022-02-23 15:32 ` Petr Vorel 2 siblings, 0 replies; 15+ messages in thread From: Petr Vorel @ 2022-02-23 15:32 UTC (permalink / raw) To: ltp to change: quotactl08.c:160: TBROK: mount(/dev/loop0, mntpoint, ext4, 0, (nil)) failed: ESRCH (3) to TCONF if FS quota is not supported (the same fix as 4aab31e4c7). Signed-off-by: Petr Vorel <pvorel@suse.cz> --- testcases/kernel/syscalls/quotactl/quotactl09.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/testcases/kernel/syscalls/quotactl/quotactl09.c b/testcases/kernel/syscalls/quotactl/quotactl09.c index 8b959909ca..57030f7d2e 100644 --- a/testcases/kernel/syscalls/quotactl/quotactl09.c +++ b/testcases/kernel/syscalls/quotactl/quotactl09.c @@ -32,7 +32,7 @@ #define OPTION_INVALID 999 static int32_t fmt_id = QFMT_VFS_V1; -static int test_id; +static int test_id, mount_flag; static int getnextquota_nsup, socket_fd = -1; static struct if_nextdqblk res_ndq; @@ -144,6 +144,12 @@ static void setup(void) { unsigned int i; + if (!tst_variant) + SAFE_MKDIR(MNTPOINT, 0777); + + do_mount(tst_device->dev, MNTPOINT, tst_device->fs_type, 0, NULL); + mount_flag = 1; + quotactl_info(); socket_fd = SAFE_SOCKET(PF_INET, SOCK_STREAM, 0); @@ -163,8 +169,12 @@ static void cleanup(void) { if (fd > -1) SAFE_CLOSE(fd); + if (socket_fd > -1) SAFE_CLOSE(socket_fd); + + if (mount_flag && tst_umount(MNTPOINT)) + tst_res(TWARN | TERRNO, "umount(%s)", MNTPOINT); } static struct tst_test test = { @@ -178,8 +188,8 @@ static struct tst_test test = { .test = verify_quotactl, .dev_fs_opts = (const char *const[]){"-O quota", NULL}, .dev_fs_type = "ext4", - .mntpoint = MNTPOINT, - .mount_device = 1, + //.mntpoint = MNTPOINT, + .format_device = 1, .needs_root = 1, .test_variants = QUOTACTL_SYSCALL_VARIANTS, .needs_cmds = (const char *[]) { -- 2.35.1 -- Mailing list info: https://lists.linux.it/listinfo/ltp ^ permalink raw reply related [flat|nested] 15+ messages in thread
end of thread, other threads:[~2022-03-04 2:57 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-02-23 15:32 [LTP] [PATCH 0/3] quotactl ESRCH fixes Petr Vorel 2022-02-23 15:32 ` [LTP] [PATCH 1/3] quotactl: Move do_mount() to header Petr Vorel 2022-02-23 15:32 ` [LTP] [PATCH 2/3] quotactl08: Use do_mount() Petr Vorel 2022-02-24 1:47 ` xuyang2018.jy 2022-02-28 13:49 ` Petr Vorel 2022-02-28 16:19 ` Petr Vorel 2022-03-01 1:11 ` xuyang2018.jy 2022-03-01 7:58 ` Petr Vorel 2022-03-01 8:10 ` xuyang2018.jy 2022-03-01 10:17 ` Petr Vorel 2022-03-03 11:41 ` Martin Doucha 2022-03-03 12:55 ` Petr Vorel 2022-03-03 11:38 ` Martin Doucha 2022-03-04 2:57 ` xuyang2018.jy 2022-02-23 15:32 ` [LTP] [PATCH 3/3] quotactl09: " Petr Vorel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox