Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package lxcfs for openSUSE:Factory checked in at 2024-12-22 18:03:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lxcfs (Old) and /work/SRC/openSUSE:Factory/.lxcfs.new.1881 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lxcfs" Sun Dec 22 18:03:44 2024 rev:25 rq:1232910 version:6.0.3 Changes: -------- --- /work/SRC/openSUSE:Factory/lxcfs/lxcfs.changes 2024-09-24 17:35:29.594647763 +0200 +++ /work/SRC/openSUSE:Factory/.lxcfs.new.1881/lxcfs.changes 2024-12-22 18:04:03.043389249 +0100 @@ -1,0 +2,27 @@ +Fri Dec 20 05:52:47 UTC 2024 - Johannes Kastl <opensuse_buildserv...@ojkastl.de> + +- update to 6.0.3 LTS: + The LXCFS team is pleased to announce the release of LXCFS 6.0.3! + This is the third bugfix release for LXCFS 6.0 which is supported + until June 2029. + * Changes + - Better detection of swap accounting support + - Reworked testsuite including support for 64-bit Arm + * Detailed changelog + - lxcfs_read: Added LXCFS_TYPE macro to all FUSE filesystem + calls + - lxcfs: fix readdir for procfs subtree + - tests: add proc readdir test + - cgroups/cgfsng: improve swap accounting support detection + - github: Bump Ubuntu version + - github: Simplify tests workflow + - github: Add arm64 tests + - tests: Make sure to enable cpuset controller + - github: Use shared logic + - github: Update coverity workflow + - github: Simplify build action + - github: Update checkout to v4 + - github: Cleanup testsuite action + - github: Improve progress reporting + +------------------------------------------------------------------- Old: ---- lxcfs-6.0.2.tar.gz lxcfs-6.0.2.tar.gz.asc New: ---- lxcfs-6.0.3.tar.gz lxcfs-6.0.3.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ lxcfs.spec ++++++ --- /var/tmp/diff_new_pack.8xB69c/_old 2024-12-22 18:04:03.751418327 +0100 +++ /var/tmp/diff_new_pack.8xB69c/_new 2024-12-22 18:04:03.755418491 +0100 @@ -22,7 +22,7 @@ %endif Name: lxcfs -Version: 6.0.2 +Version: 6.0.3 Release: 0 Summary: FUSE filesystem for LXC License: Apache-2.0 ++++++ lxcfs-6.0.2.tar.gz -> lxcfs-6.0.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/.github/actions/build/action.yml new/lxcfs-6.0.3/.github/actions/build/action.yml --- old/lxcfs-6.0.2/.github/actions/build/action.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/lxcfs-6.0.3/.github/actions/build/action.yml 2024-12-19 16:38:31.000000000 +0100 @@ -0,0 +1,56 @@ +name: Build LXCFS +description: Install dependencies and build the codebase +inputs: + compiler: + required: true + fuse: + required: true + os: + required: true + +runs: + using: "composite" + steps: + - name: Install dependencies + shell: bash + run: | + echo "::group::Installing dependencies" + + sudo apt-get update -qq + sudo apt-get install -qq \ + ${{ inputs.compiler }} \ + lib${{ inputs.fuse }}-dev \ + meson \ + pkg-config \ + uuid-runtime + + echo "::endgroup::" + + - name: Compiler version + shell: bash + env: + CC: ${{ inputs.compiler }} + run: | + echo "::group::Compiler version" + + ${CC} --version + + echo "::endgroup::" + + - name: Build + shell: bash + env: + CC: ${{ inputs.compiler }} + run: | + echo "::group::Building LXCFS" + + # Standard build + meson setup build \ + -Ddocs=false \ + -Dtests=true \ + -Dinit-script=systemd \ + -Dprefix=/usr \ + -Db_sanitize=address,undefined + meson compile -C build + + echo "::endgroup::" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/.github/actions/testsuite/action.yml new/lxcfs-6.0.3/.github/actions/testsuite/action.yml --- old/lxcfs-6.0.2/.github/actions/testsuite/action.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/lxcfs-6.0.3/.github/actions/testsuite/action.yml 2024-12-19 16:38:31.000000000 +0100 @@ -0,0 +1,31 @@ +name: Test suite +description: Runs the testsuite +inputs: + compiler: + required: true + fuse: + required: true + os: + required: true + +runs: + using: "composite" + steps: + - name: Build LXCFS + uses: ./.github/actions/build + with: + compiler: ${{ inputs.compiler }} + fuse: ${{ inputs.fuse }} + os: ${{ inputs.os }} + + - name: Test + shell: bash + env: + CC: ${{ inputs.compiler }} + run: | + echo "::group::Running the testsuite" + + echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true + sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" build/tests/main.sh + + echo "::endgroup::" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/.github/workflows/builds.yml new/lxcfs-6.0.3/.github/workflows/builds.yml --- old/lxcfs-6.0.2/.github/workflows/builds.yml 2024-09-16 18:00:46.000000000 +0200 +++ new/lxcfs-6.0.3/.github/workflows/builds.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,54 +0,0 @@ -name: Builds -on: - push: - branches: - - master - -permissions: - contents: read - -jobs: - coverity: - name: Coverity - runs-on: ubuntu-22.04 - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Download Coverity Build Tool - run: | - wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=lxc/lxcfs" -O cov-analysis-linux64.tar.gz - mkdir cov-analysis-linux64 - tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 - env: - TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} - - - name: Install dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -qq gcc clang - sudo apt-get install -qq libfuse-dev uuid-runtime - sudo apt-get install -qq python3 python3-setuptools - sudo pip3 install meson ninja - - - name: Run coverity - run: | - export PATH="$(pwd)/cov-analysis-linux64/bin:${PATH}" - - meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr build/ - - # Build - cov-build --dir cov-int ninja -C build - tar czvf lxcfs.tgz cov-int - - # Submit the results - curl \ - --form project=lxc/lxcfs \ - --form token=${TOKEN} \ - --form email=lxc-de...@lists.linuxcontainers.org \ - --form file=@lxcfs.tgz \ - --form version=master \ - --form description="${GITHUB_SHA}" \ - https://scan.coverity.com/builds?project=lxc/lxcfs - env: - TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/.github/workflows/commits.yml new/lxcfs-6.0.3/.github/workflows/commits.yml --- old/lxcfs-6.0.2/.github/workflows/commits.yml 2024-09-16 18:00:46.000000000 +0200 +++ new/lxcfs-6.0.3/.github/workflows/commits.yml 2024-12-19 16:38:31.000000000 +0100 @@ -10,7 +10,7 @@ permissions: pull-requests: read # for tim-actions/get-pr-commits to get list of commits from the PR name: Signed-off-by (DCO) - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Get PR Commits id: 'get-pr-commits' @@ -27,7 +27,7 @@ permissions: contents: none name: Branch target - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: Check branch target env: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/.github/workflows/coverity.yml new/lxcfs-6.0.3/.github/workflows/coverity.yml --- old/lxcfs-6.0.2/.github/workflows/coverity.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/lxcfs-6.0.3/.github/workflows/coverity.yml 2024-12-19 16:38:31.000000000 +0100 @@ -0,0 +1,56 @@ +name: Coverity +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + coverity: + name: Build and upload + runs-on: ubuntu-24.04 + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download Coverity Build Tool + run: | + wget -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=$TOKEN&project=lxc/lxcfs" -O cov-analysis-linux64.tar.gz + mkdir cov-analysis-linux64 + tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64 + env: + TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} + + - name: Install dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -qq gcc clang meson + sudo apt-get install -qq libfuse-dev uuid-runtime python3 python3-setuptools + + - name: Run coverity + run: | + # Configure + export PATH="$(pwd)/cov-analysis-linux64/bin:${PATH}" + export CFLAGS="-Wall -Werror" + export LDFLAGS="-pthread -lpthread" + + BUILD="$(pwd)/build" + meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr build/ + + # Build + cov-build --dir cov-int ninja -C ${BUILD} + tar czvf upload.tgz cov-int + + # Submit the results + curl \ + --form project=lxc/lxcfs \ + --form token=${TOKEN} \ + --form email=lxc-de...@lists.linuxcontainers.org \ + --form file=@upload.tgz \ + --form version=main \ + --form description="${GITHUB_SHA}" \ + https://scan.coverity.com/builds?project=lxc/lxcfs + env: + TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/.github/workflows/tests.yml new/lxcfs-6.0.3/.github/workflows/tests.yml --- old/lxcfs-6.0.2/.github/workflows/tests.yml 2024-09-16 18:00:46.000000000 +0200 +++ new/lxcfs-6.0.3/.github/workflows/tests.yml 2024-12-19 16:38:31.000000000 +0100 @@ -7,129 +7,86 @@ contents: read jobs: - fuse2: - name: FUSE2 + testsuite-hosted: + name: Test suite (x86_64) strategy: fail-fast: false matrix: compiler: - gcc - clang + fuse: + - fuse + - fuse3 os: - - ubuntu-20.04 - ubuntu-22.04 + - ubuntu-24.04 runs-on: ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -qq gcc clang - sudo apt-get install -qq libfuse-dev uuid-runtime - sudo apt-get install -qq python3 python3-setuptools - sudo pip3 install meson==0.55.1 ninja + - name: Run the testsuite + uses: ./.github/actions/testsuite + with: + compiler: ${{ matrix.compiler }} + fuse: ${{ matrix.fuse }} + os: ${{ matrix.os }} - - name: Compiler version - env: - CC: ${{ matrix.compiler }} - run: | - ${CC} --version - - - name: Build - env: - CC: ${{ matrix.compiler }} - run: | - meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/ - meson compile -C build - - name: Test - env: - CC: ${{ matrix.compiler }} - run: | - echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true - sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" build/tests/main.sh - - fuse3: - name: FUSE3 + testsuite-self-hosted: + name: Test suite (aarch64) strategy: fail-fast: false matrix: compiler: - gcc - clang + fuse: + - fuse + - fuse3 os: - - ubuntu-20.04 - ubuntu-22.04 - runs-on: ${{ matrix.os }} + - ubuntu-24.04 + runs-on: + - self-hosted + - cpu-4 + - mem-4G + - disk-50G + - arch-arm64 + - image-${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v2 - - - name: Install dependencies - run: | - sudo add-apt-repository universe - sudo apt-get update -qq - sudo apt-get install -qq gcc clang - sudo apt-get install -qq libfuse3-dev uuid-runtime - sudo apt-get install -qq python3 python3-setuptools - sudo pip3 install meson==0.55.1 ninja + uses: actions/checkout@v4 - - name: Compiler version - env: - CC: ${{ matrix.compiler }} - run: | - ${CC} --version + - name: Run the testsuite + uses: ./.github/actions/testsuite + with: + compiler: ${{ matrix.compiler }} + fuse: ${{ matrix.fuse }} + os: ${{ matrix.os }} - - name: Build - env: - CC: ${{ matrix.compiler }} - run: | - meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/ - meson compile -C build - - name: Test - env: - CC: ${{ matrix.compiler }} - run: | - echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children || true - sudo -E PATH="${PATH}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" build/tests/main.sh - - live-upgrade-compatibility: - name: Live upgrade test + upgrade-test: + name: Upgrade test strategy: fail-fast: false matrix: compiler: - gcc - - clang + fuse: + - fuse3 os: - - ubuntu-22.04 + - ubuntu-24.04 runs-on: ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo add-apt-repository universe - sudo apt-get update -qq - sudo apt-get install -qq gcc clang - sudo apt-get install -qq libfuse3-dev uuid-runtime - sudo apt-get install -qq python3 python3-setuptools - sudo pip3 install meson==0.55.1 ninja - - - name: Compiler version - env: - CC: ${{ matrix.compiler }} - run: | - ${CC} --version - - - name: Build PR head version - env: - CC: ${{ matrix.compiler }} - run: | - meson setup -Ddocs=false -Dtests=true -Dinit-script=systemd -Dprefix=/usr -Db_sanitize=address,undefined build/ - meson compile -C build + - name: Build LXCFS + uses: ./.github/actions/build + with: + compiler: ${{ matrix.compiler }} + fuse: ${{ matrix.fuse }} + os: ${{ matrix.os }} - name: Build upstream head version env: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/meson.build new/lxcfs-6.0.3/meson.build --- old/lxcfs-6.0.2/meson.build 2024-09-16 18:00:46.000000000 +0200 +++ new/lxcfs-6.0.3/meson.build 2024-12-19 16:38:31.000000000 +0100 @@ -4,7 +4,7 @@ project( 'lxcfs', 'c', - version: '6.0.2', + version: '6.0.3', license: 'LGPLv2+', default_options: [ 'b_colorout=always', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/src/cgroups/cgfsng.c new/lxcfs-6.0.3/src/cgroups/cgfsng.c --- old/lxcfs-6.0.2/src/cgroups/cgfsng.c 2024-09-16 18:00:46.000000000 +0200 +++ new/lxcfs-6.0.3/src/cgroups/cgfsng.c 2024-12-19 16:38:31.000000000 +0100 @@ -636,6 +636,7 @@ __do_free char *cgroup_rel = NULL, *junk_value = NULL; const char *file; struct hierarchy *h; + bool ret; h = ops->get_hierarchy(ops, "memory"); if (!h) @@ -643,13 +644,64 @@ cgroup_rel = must_make_path_relative(cgroup, NULL); file = is_unified_hierarchy(h) ? "memory.swap.current" : "memory.memsw.usage_in_bytes"; + /* For v2, we need to look at the lower levels of the hierarchy because * no 'memory.swap.current' file exists at the root. We must search * upwards in the hierarchy in case memory accounting is disabled via * cgroup.subtree_control for the given cgroup itself. */ - int ret = cgroup_walkup_to_root(ops->cgroup2_root_fd, h->fd, cgroup_rel, file, &junk_value); - return ret == 0; + if (is_cgroup2_fd(h->fd) && strcmp(cgroup, "/") == 0) { + /* + * It looks like LXCFS sits in the root cgroup, + * which means that we have to find *some* cgroup + * down the tree and check a (file) presence in there. + * + * Note, that this only needed for cgroup2. + */ + + __do_close int fd = -EBADF; + __do_closedir DIR *dir = NULL; + struct dirent *dent; + + fd = dup(h->fd); + if (fd < 0) + return false; + + dir = fdopendir(fd); + if (!dir) { + lxcfs_error("Failed to open memory cgroup hierarchy\n"); + return false; + } + /* Transfer ownership to fdopendir(). */ + move_fd(fd); + + ret = false; + while (((dent = readdir(dir)) != NULL)) { + if (strcmp(dent->d_name, ".") == 0 || + strcmp(dent->d_name, "..") == 0) + continue; + + if (dent->d_type == DT_DIR) { + __do_free char *path; + + path = must_make_path_relative(dent->d_name, "memory.swap.current", NULL); + + if (!faccessat(h->fd, path, F_OK, 0)) { + /* We found it. Exit. */ + ret = true; + break; + } + } + } + } else { + /* + * We can check a (file) presence on the current + * level and go up in the cgroup tree if needed. + */ + ret = cgroup_walkup_to_root(ops->cgroup2_root_fd, h->fd, cgroup_rel, file, &junk_value) == 0; + } + + return ret; } static int cgfsng_get_memory_stats(struct cgroup_ops *ops, const char *cgroup, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/src/cgroups/cgroup_utils.h new/lxcfs-6.0.3/src/cgroups/cgroup_utils.h --- old/lxcfs-6.0.2/src/cgroups/cgroup_utils.h 2024-09-16 18:00:46.000000000 +0200 +++ new/lxcfs-6.0.3/src/cgroups/cgroup_utils.h 2024-12-19 16:38:31.000000000 +0100 @@ -80,6 +80,7 @@ extern char *cg_legacy_get_current_cgroup(pid_t pid, const char *controller); extern bool mkdir_p(const char *dir, mode_t mode); extern bool is_cgroup_fd(int fd); +extern bool is_cgroup2_fd(int fd); static inline int openat_safe(int fd, const char *path) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/src/lxcfs.c new/lxcfs-6.0.3/src/lxcfs.c --- old/lxcfs-6.0.2/src/lxcfs.c 2024-09-16 18:00:46.000000000 +0200 +++ new/lxcfs-6.0.3/src/lxcfs.c 2024-12-19 16:38:31.000000000 +0100 @@ -746,6 +746,9 @@ #endif { int ret; + enum lxcfs_virt_t type; + + type = file_info_type(fi); if (strcmp(path, "/") == 0) { if (dir_filler(filler, buf, ".", 0) != 0 || @@ -758,7 +761,7 @@ return 0; } - if (cgroup_is_enabled && strncmp(path, "/cgroup", 7) == 0) { + if (cgroup_is_enabled && LXCFS_TYPE_CGROUP(type)) { up_users(); ret = do_cg_readdir(path, buf, filler, offset, fi); down_users(); @@ -772,7 +775,7 @@ return ret; } - if (strncmp(path, "/sys", 4) == 0) { + if (LXCFS_TYPE_SYS(type)) { up_users(); ret = do_sys_readdir(path, buf, filler, offset, fi); down_users(); @@ -879,28 +882,34 @@ struct fuse_file_info *fi) { int ret; + enum lxcfs_virt_t type; - if (cgroup_is_enabled && strncmp(path, "/cgroup", 7) == 0) { + type = file_info_type(fi); + + if (cgroup_is_enabled && LXCFS_TYPE_CGROUP(type)) { up_users(); ret = do_cg_read(path, buf, size, offset, fi); down_users(); return ret; } - if (strncmp(path, "/proc", 5) == 0) { + if (LXCFS_TYPE_PROC(type)) { up_users(); ret = do_proc_read(path, buf, size, offset, fi); down_users(); return ret; } - if (strncmp(path, "/sys", 4) == 0) { + if (LXCFS_TYPE_SYS(type)) { up_users(); ret = do_sys_read(path, buf, size, offset, fi); down_users(); return ret; } + lxcfs_error("unknown file type: path=%s, type=%d, fi->fh=%" PRIu64, + path, type, fi->fh); + return -EINVAL; } @@ -908,15 +917,18 @@ struct fuse_file_info *fi) { int ret; + enum lxcfs_virt_t type; - if (cgroup_is_enabled && strncmp(path, "/cgroup", 7) == 0) { + type = file_info_type(fi); + + if (cgroup_is_enabled && LXCFS_TYPE_CGROUP(type)) { up_users(); ret = do_cg_write(path, buf, size, offset, fi); down_users(); return ret; } - if (strncmp(path, "/sys", 4) == 0) { + if (LXCFS_TYPE_SYS(type)) { up_users(); ret = do_sys_write(path, buf, size, offset, fi); down_users(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lxcfs-6.0.2/tests/test_proc.in new/lxcfs-6.0.3/tests/test_proc.in --- old/lxcfs-6.0.2/tests/test_proc.in 2024-09-16 18:00:46.000000000 +0200 +++ new/lxcfs-6.0.3/tests/test_proc.in 2024-12-19 16:38:31.000000000 +0100 @@ -37,7 +37,7 @@ echo 1 > ${hierarchy_path}/lxcfs_test_proc/cgroup.procs - echo '+cpu +memory' > ${hierarchy_path}/cgroup.subtree_control + echo '+cpu +cpuset +memory' > ${hierarchy_path}/cgroup.subtree_control memory_limit_file=memory.max else @@ -65,6 +65,13 @@ echo $((64*1024*1024)) > ${mempath}/lxcfs_test_proc/${memory_limit_file} echo 0 > ${cpupath}/lxcfs_test_proc/cpuset.cpus +# Test that readdir on /proc basically works +echo "==> Testing directory listing on /proc" +ls -l ${LXCFSDIR}/proc | grep uptime +ls -l ${LXCFSDIR}/proc | grep cpuinfo +ls -l ${LXCFSDIR}/proc | grep stat +ls -l ${LXCFSDIR}/proc | grep meminfo + # Test uptime echo "==> Testing /proc/uptime" grep -Eq "^0.[0-9]{2} 0.[0-9]{2}$" ${LXCFSDIR}/proc/uptime