Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quotactl01 test case failed #189

Closed
DengkeDu opened this issue Aug 2, 2017 · 8 comments
Closed

quotactl01 test case failed #189

DengkeDu opened this issue Aug 2, 2017 · 8 comments

Comments

@DengkeDu
Copy link
Contributor

DengkeDu commented Aug 2, 2017

It shows:
quotactl01.c:195: FAIL: quotactl failed to turn on quota for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to set disk quota limit for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to get disk quota limit for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to set information about quotafile for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to get information about quotafile for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to get quota format for user: ESRCH
quotactl01.c:206: PASS: quotactl succeeded to update quota usages for user
quotactl01.c:206: PASS: quotactl succeeded to turn off quota for user

[ 9885.969833] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: usrquota,grpquota
[ 9885.976671] EXT4-fs (loop0): re-mounted. Opts: (null)
[ 9885.979168] EXT4-fs (loop0): re-mounted. Opts: (null)

I have enable the following in kernel:
CONFIG_QUOTA=y
CONFIG_QUOTACTL=y

My command:
./runltp -p -f ddk_quotactl01 -d /opt/tmp -b /dev/loop0 &> ddk_quotactl01.log

@metan-ucw
Copy link
Member

What LTP version do you have. Also can you paste a strace of the failing testcase here?

BTW you can execute most of the tests just by executing the test binary (without using runltp at all). So something as:

cd /opt/ltp/testcases/bin/
strace ./quotaclt01

May work as well.

@DengkeDu
Copy link
Contributor Author

DengkeDu commented Aug 4, 2017

I have re-test it on the latest commit: mem/ksm: fix two errors in ksm06.c

My command:
strace ./quotactl01 &> quotactl01.log

The log:
execve("./quotactl01", ["./quotactl01"], 0xbf9e7a20 /* 15 vars /) = 0
brk(NULL) = 0x8061000
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb777c000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=54350, ...}) = 0
mmap2(NULL, 54350, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb776e000
close(3) = 0
openat(AT_FDCWD, "/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\211XI4\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1643336, ...}) = 0
mmap2(0x49570000, 1649148, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x49570000
mprotect(0x496fc000, 4096, PROT_NONE) = 0
mmap2(0x496fd000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18c000) = 0x496fd000
mmap2(0x49700000, 10748, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x49700000
close(3) = 0
set_thread_area({entry_number:-1, base_addr:0xb777d280, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 (entry_numb
mprotect(0x496fd000, 8192, PROT_READ) = 0
mprotect(0x805d000, 4096, PROT_READ) = 0
mprotect(0x4956c000, 4096, PROT_READ) = 0
munmap(0xb776e000, 54350) = 0
getpid() = 1024
geteuid32() = 0
access("/dev/shm", F_OK) = 0
getpid() = 1024
openat(AT_FDCWD, "/dev/shm/ltp_quotactl01_1024", O_RDWR|O_CREAT|O_EXCL, 0600) = 3
ftruncate(3, 4096) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0xb777b000
unlink("/dev/shm/ltp_quotactl01_1024") = 0
close(3) = 0
gettimeofday({tv_sec=1501827602, tv_usec=960389}, NULL) = 0
getpid() = 1024
mkdir("/tmp/MylSri", 0700) = 0
brk(NULL) = 0x8061000
brk(0x8082000) = 0x8082000
brk(0x8083000) = 0x8083000
getgid32() = 0
chown32("/tmp/MylSri", -1, 0) = 0
chmod("/tmp/MylSri", 0777) = 0
getcwd("/opt/ltp/testcases/bin", 4096) = 23
chdir("/tmp/MylSri") = 0
openat(AT_FDCWD, "test_dev.img", O_WRONLY|O_CREAT|O_TRUNC, 0600) = 3
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024) = 1024
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024) = 1024
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024) = 1024
...................................
write(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1024) = 1024
brk(0x8082000) = 0x8082000
close(3) = 0
openat(AT_FDCWD, "/dev/loop-control", O_RDWR) = 3
ioctl(3, LOOP_CTL_GET_FREE) = 0
close(3) = 0
stat64("/dev/loop0", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 0), ...}) = 0
ioctl(2, TCGETS, 0xbffa923c) = -1 ENOTTY (Inappropriate ioctl for device)
write(2, "tst_device.c:82: INFO: Found fre"..., 54tst_device.c:82: INFO: Found free device '/dev/loop0'
) = 54
openat(AT_FDCWD, "/dev/loop0", O_RDWR) = 3
openat(AT_FDCWD, "test_dev.img", O_RDWR) = 4
ioctl(3, LOOP_SET_FD, 4) = 0
close(3) = 0
close(4) = 0
write(2, "tst_mkfs.c:79: INFO: Formatting "..., 75tst_mkfs.c:79: INFO: Formatting /dev/loop0 with ext4 opts='' extra opts=''
) = 75
openat(AT_FDCWD, "/dev/null", O_WRONLY|O_CREAT|O_APPEND, 0644) = 3
rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[CHLD], sa_flags=SA_RESTART}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
vfork() = 1027
waitpid(1027, mke2fs 1.43.4 (31-Jan-2017)
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 1027
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1027, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
rt_sigaction(SIGCHLD, {sa_handler=SIG_DFL, sa_mask=[CHLD], sa_flags=SA_RESTART}, {sa_handler=SIG_DFL, sa_mask=[CHLD], sa_flags=SA_RESTART}, 8) = 0
close(3) = 0
mkdir("mntpoint", 0777) = 0
mount("/dev/loop0", "mntpoint", "ext4", 0, "usrquota,grpquota") = 0
rt_sigaction(SIGALRM, {sa_handler=0x804a680, sa_mask=[ALRM], sa_flags=SA_RESTART}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGUSR1, {sa_handler=0x804a590, sa_mask=[USR1], sa_flags=SA_RESTART}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
write(2, "tst_test.c:908: INFO: Timeout pe"..., 52tst_test.c:908: INFO: Timeout per run is 0h 05m 00s
) = 52
getpid() = 1024
alarm(300) = 0
rt_sigaction(SIGINT, {sa_handler=0x804a640, sa_mask=[INT], sa_flags=SA_RESTART}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb777d2e8) = 1031
waitpid(1031, quotactl01.c:195: FAIL: quotactl failed to turn on quota for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to set disk quota limit for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to get disk quota limit for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to set information about quotafile for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to get information about quotafile for user: ESRCH
quotactl01.c:195: FAIL: quotactl failed to get quota format for user: ESRCH
quotactl01.c:206: PASS: quotactl succeeded to update quota usages for user
quotactl01.c:206: PASS: quotactl succeeded to turn off quota for user
quotactl01.c:195: FAIL: quotactl failed to turn on quota for group: ESRCH
quotactl01.c:195: FAIL: quotactl failed to set disk quota limit for group: ESRCH
quotactl01.c:195: FAIL: quotactl failed to set disk quota limit for group: ESRCH
quotactl01.c:195: FAIL: quotactl failed to set information about quotafile for group: ESRCH
quotactl01.c:195: FAIL: quotactl failed to get information about quotafile for group: ESRCH
quotactl01.c:195: FAIL: quotactl failed to get quota format for group: ESRCH
quotactl01.c:206: PASS: quotactl succeeded to update quota usages for group
quotactl01.c:206: PASS: quotactl succeeded to turn off quota for group
[{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0) = 1031
--- SIGUSR1 {si_signo=SIGUSR1, si_code=SI_USER, si_pid=1031, si_uid=0} ---
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=1031, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
alarm(300) = 300
sigreturn({mask=[]}) = 1031
alarm(0) = 300
rt_sigaction(SIGINT, {sa_handler=SIG_DFL, sa_mask=[INT], sa_flags=SA_RESTART}, {sa_handler=0x804a640, sa_mask=[INT], sa_flags=SA_RESTART}, 8) = 0
fstat64(1, {st_mode=S_IFREG|0644, st_size=24386104, ...}) = 0
umount("mntpoint") = 0
openat(AT_FDCWD, "/dev/loop0", O_RDONLY) = 3
ioctl(3, LOOP_CLR_FD) = 0
nanosleep({tv_sec=0, tv_nsec=50000000}, NULL) = 0
ioctl(3, LOOP_CLR_FD) = -1 ENXIO (No such device or address)
close(3) = 0
openat(AT_FDCWD, "/tmp/MylSri", O_RDONLY|O_DIRECTORY|O_NOFOLLOW) = 3
close(3) = 0
open("/tmp/MylSri", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFDIR|0777, st_size=80, ...}) = 0
getdents(3, /
4 entries /, 32768) = 76
openat(AT_FDCWD, "/tmp/MylSri/mntpoint", O_RDONLY|O_DIRECTORY|O_NOFOLLOW) = 4
close(4) = 0
open("/tmp/MylSri/mntpoint", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 4
fstat64(4, {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
getdents(4, /
2 entries /, 32768) = 32
getdents(4, /
0 entries /, 32768) = 0
close(4) = 0
lstat64("/tmp/MylSri/mntpoint", {st_mode=S_IFDIR|0755, st_size=40, ...}) = 0
unlink("/tmp/MylSri/mntpoint") = -1 EISDIR (Is a directory)
rmdir("/tmp/MylSri/mntpoint") = 0
openat(AT_FDCWD, "/tmp/MylSri/test_dev.img", O_RDONLY|O_DIRECTORY|O_NOFOLLOW) = -1 ENOTDIR (Not a directory)
unlink("/tmp/MylSri/test_dev.img") = 0
getdents(3, /
0 entries */, 32768) = 0
close(3) = 0
lstat64("/tmp/MylSri", {st_mode=S_IFDIR|0777, st_size=40, ...}) = 0
unlink("/tmp/MylSri") = -1 EISDIR (Is a directory)
rmdir("/tmp/MylSri") = 0
access("/dev/shm/ltp_quotactl01_1024", F_OK) = -1 ENOENT (No such file or directory)
msync(0xb777b000, 4096, MS_SYNC) = 0
munmap(0xb777b000, 4096) = 0
write(1, "\nSummary:\npassed 4\nfailed 12"..., 55
Summary:
passed 4
failed 12
skipped 0
warnings 0
) = 55
exit_group(1) = ?

@metan-ucw
Copy link
Member

Can you pretty please repeat with strace with added -f parameter to include the syscalls from the child process that actually runs the test?

The log you have send looks pretty much fine, the device is formatted and mounted with quotas but then we fail to turn on the quota in the child process and ESRCH most likely means "quotas are not enabled for this fs" which sounds confusing.

@DengkeDu
Copy link
Contributor Author

DengkeDu commented Aug 4, 2017

We can check it here:

quotactl01.txt

@metan-ucw
Copy link
Member

That link appears to be broken.

@kamiccolo
Copy link
Contributor

kamiccolo commented Aug 4, 2017 via email

@metan-ucw
Copy link
Member

This strace goes up to the point where the first test case fails. We can see that quotacheck successfully initialized the user and group quotast and that everything up to the point the test calls first quotactl() went fine. The ESRCH suggest that the quota format is not supported by kernel, do you have CONFIG_QFMT_V2 enabled?

@DengkeDu
Copy link
Contributor Author

DengkeDu commented Aug 7, 2017

Thanks, it works!

@DengkeDu DengkeDu closed this as completed Aug 7, 2017
pevik pushed a commit to pevik/ltp that referenced this issue Oct 31, 2019
Current quotactl01.c has logic problem. There is no relation between
Q_GETINFO and quota format. The format should depend on quotacheck -F and
kernel config such as CONFIG_QFMT_V1 or CONFIG_QFMT_V2(most linux distributions
use the v2).

Q_GETINFO cmd was introduced since Linux 2.4.22, we don't need to
check it now.  Also, specfiy quota format to QFMT_VFS_V0 by quotacheck
-F and check CONFIG_QFMT_V2 in kernel config to avoid issue such as#189[1].
So in quotactl01.c, we don't need to use the macro of ltp-quota.m4.
In quotactl0[2-3].c, we don't need to check very basic header <sys/quota.h>
(it was introdued in glibc since 1997). Remove quota version macro.

Don't remove ltp-quota.m4 because I will rewrite it to detect
if_nextdqblk struct for Q_GETNEXTQUOTA cmd on the coming patch.

[1]linux-test-project#189

Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
pevik pushed a commit to pevik/ltp that referenced this issue Oct 31, 2019
Current quotactl01.c has logic problem. There is no relation between
Q_GETINFO and quota format. The format should depend on quotacheck -F
and kernel config such as CONFIG_QFMT_V1 or CONFIG_QFMT_V2 (most linux
distributions use the v2).

Q_GETINFO cmd was introduced since Linux 2.4.22, we don't need to
check it now. Also, specify quota format to QFMT_VFS_V0 by quotacheck
-F and check CONFIG_QFMT_V2 in kernel config to avoid issue such as linux-test-project#189 [1].
So in quotactl01.c, we don't need to use the macro of ltp-quota.m4.
In quotactl0[2-3].c, we don't need to check very basic header <sys/quota.h>
(it was introdued in glibc since 1997). Remove quota version macro.

Don't remove ltp-quota.m4 because I will rewrite it to detect
if_nextdqblk struct for Q_GETNEXTQUOTA cmd on the coming patch.

[1]linux-test-project#189

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
pevik pushed a commit to pevik/ltp that referenced this issue Oct 31, 2019
Current quotactl01.c has logic problem. There is no relation between
Q_GETINFO and quota format. The format should depend on quotacheck -F
and kernel config such as CONFIG_QFMT_V1 or CONFIG_QFMT_V2 (most linux
distributions use the v2).

Q_GETINFO cmd was introduced since Linux 2.4.22, we don't need to
check it now. Also, specify quota format to QFMT_VFS_V0 by quotacheck -F
and check CONFIG_QFMT_V2 in kernel config to avoid issue such as linux-test-project#189 [1].
Therefore in quotactl01.c, we don't need to use the macro from ltp-quota.m4.

In quotactl0[2-3].c, we don't need to check very basic header <sys/quota.h>
(it was introdued in glibc since 1997). Remove quota version macro.

[1] linux-test-project#189

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
[pvorel: removed ltp-quota.m4]
Signed-off-by: Petr Vorel <pvorel@suse.cz>
pevik pushed a commit to pevik/ltp that referenced this issue Oct 31, 2019
Current quotactl01.c has logic problem. There is no relation between
Q_GETINFO and quota format. The format should depend on quotacheck -F
and kernel config such as CONFIG_QFMT_V1 or CONFIG_QFMT_V2 (most linux
distributions use the v2).

Q_GETINFO cmd was introduced since Linux 2.4.22, we don't need to
check it now. Also, specify quota format to QFMT_VFS_V0 by quotacheck -F
and check CONFIG_QFMT_V2 in kernel config to avoid issue such as linux-test-project#189 [1].
Therefore in quotactl01.c, we don't need to use the macro from ltp-quota.m4.

In quotactl0[2-3].c, we don't need to check very basic header <sys/quota.h>
(it was introdued in glibc since 1997). Remove quota version macro.

[1] linux-test-project#189

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
[pvorel: removed ltp-quota.m4]
Signed-off-by: Petr Vorel <pvorel@suse.cz>
pevik pushed a commit to pevik/ltp that referenced this issue Oct 31, 2019
Current quotactl01.c has logic problem. There is no relation between
Q_GETINFO and quota format. The format should depend on quotacheck -F
and kernel config such as CONFIG_QFMT_V1 or CONFIG_QFMT_V2 (most linux
distributions use the v2).

Q_GETINFO cmd was introduced since Linux 2.4.22, we don't need to
check it now. Also, specify quota format to QFMT_VFS_V0 by quotacheck -F
and check CONFIG_QFMT_V2 in kernel config to avoid issue such as linux-test-project#189 [1].
Therefore in quotactl01.c, we don't need to use the macro from ltp-quota.m4.

In quotactl0[2-3].c, we don't need to check very basic header <sys/quota.h>
(it was introdued in glibc since 1997). Remove quota version macro.

[1] linux-test-project#189

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
[pvorel: removed ltp-quota.m4]
Signed-off-by: Petr Vorel <pvorel@suse.cz>
pevik pushed a commit that referenced this issue Oct 31, 2019
Current quotactl01.c has logic problem. There is no relation between
Q_GETINFO and quota format. The format should depend on quotacheck -F
and kernel config such as CONFIG_QFMT_V1 or CONFIG_QFMT_V2 (most linux
distributions use the v2).

Q_GETINFO cmd was introduced since Linux 2.4.22, we don't need to
check it now. Also, specify quota format to QFMT_VFS_V0 by quotacheck -F
and check CONFIG_QFMT_V2 in kernel config to avoid issue such as #189 [1].
Therefore in quotactl01.c, we don't need to use the macro from ltp-quota.m4.

In quotactl0[2-3].c, we don't need to check very basic header <sys/quota.h>
(it was introdued in glibc since 1997). Remove quota version macro.

+ Add missing breaks in quotactl01.c.

[1] #189

Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
[pvorel: removed ltp-quota.m4]
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants