linux-test-project / ltp

Linux Test Project (mailing list: https://lists.linux.it/listinfo/ltp)
https://linux-test-project.readthedocs.io/
GNU General Public License v2.0
2.28k stars 999 forks source link

syscalls/statx01: Reading mnt_id value from mountinfo fails in ostree image #1001

Closed BeeGrech closed 1 year ago

BeeGrech commented 1 year ago
>>> 1373:statx01 FAIL <<<
###############################################################################
# Test Num    : 1373                                                          #
# Test Case   : statx01                                                       #
# Test Result : FAIL                                                          #
###############################################################################

     1  <<<test_start>>>
     2  tag=statx01 stime=1670367575
     3  cmdline="statx01"
     4  contacts=""
     5  analysis=exit
     6  <<<test_output>>>
     7  tst_test.c:1559: TINFO: Timeout per run is 0h 00m 30s
     8  statx01.c:98: TPASS: statx(AT_FDCWD, test_file, 0, 0, &buff)
     9  statx01.c:105: TPASS: stx_uid(0) is correct
    10  statx01.c:111: TPASS: stx_gid(0) is correct
    11  statx01.c:117: TPASS: stx_size(256) is correct
    12  statx01.c:125: TPASS: stx_mode(33188) is correct
    13  statx01.c:131: TPASS: stx_blocks(8) is valid
    14  statx01.c:138: TPASS: stx_nlink(1) is correct
    15  statx01.c:82: TFAIL: statx.stx_mnt_id(43) is different from mount_id(63) in /proc/self/mountinfo
    16  statx01.c:88: TPASS: /proc/119006/fdinfo/3 mnt_id: = 43
    17  statx01.c:156: TPASS: statx(AT_FDCWD, mntpoint/blk_dev, 0, 0, &buff)
    18  statx01.c:163: TPASS: stx_rdev_major(8) is correct
    19  statx01.c:171: TPASS: stx_rdev_minor(1) is correct
    20  
    21  Summary:
    22  passed   11
    23  failed   1
    24  broken   0
    25  skipped  0
    26  warnings 0
    27  <<<execution_status>>>
    28  initiation_status="ok"
    29  duration=0 termination_type=exited termination_id=1 corefile=no
    30  cutime=1 cstime=0
    31  <<<test_end>>>

Kernel: kernel-automotive-5.14.0-200.163.el9iv.aarch64

This mount mismatch may be due to the design of ostree and its overlay fs concept. where: from /proc/sef/mountinfo

63 66 8:3 / /sysroot rw,relatime - ext4 /dev/sda3 rw,seclabel
43 66 8:3 /ostree/deploy/rhivos/var /var rw,relatime shared:3 - ext4 /dev/sda3 rw,seclabel
xuyang0410 commented 1 year ago

Yes, we don't consider overlay fs concept. How about modifying the current parse mnt_id way from /proc/self/mountinfo as below: `--- a/testcases/kernel/syscalls/statx/statx01.c +++ b/testcases/kernel/syscalls/statx/statx01.c @@ -68,7 +68,7 @@ static void test_mnt_id(struct statx buf) if (sscanf(line, "%"SCNu64" %d %d:%d", &mnt_id, &line_mjr, &line_mnr) != 3) continue;

`