From d117a8c9d3a6a1616d260e26f675af651d3dd2cc Mon Sep 17 00:00:00 2001 From: Fabio Fantoni Date: Fri, 3 Nov 2023 17:40:38 +0100 Subject: [PATCH 1/3] add github workflow for find typo using codespell --- .github/workflows/codespell.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..f23f3f2b --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,14 @@ +name: codespell +on: [pull_request] + +jobs: + check: + name: codespell + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: codespell + uses: codespell-project/actions-codespell@v2 + with: + only_warn: 1 \ No newline at end of file From 99c0b5578574d8a8ca557be7424fa4cde0567793 Mon Sep 17 00:00:00 2001 From: Fabio Fantoni Date: Sat, 4 Nov 2023 11:07:50 +0100 Subject: [PATCH 2/3] remove build automatic test from master actually master is used only for docs and upstream patches --- .circleci/config.yml | 82 ------------------------- .github/workflows/Kernel-module.yml | 48 --------------- .github/workflows/Linux.yml | 45 -------------- .github/workflows/build-other-archs.yml | 64 ------------------- 4 files changed, 239 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .github/workflows/Kernel-module.yml delete mode 100644 .github/workflows/Linux.yml delete mode 100644 .github/workflows/build-other-archs.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 3eac5278..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Use the latest 2.1 version of CircleCI pipeline process engine. -# See: https://circleci.com/docs/2.0/configuration-reference -version: 2.1 - -shared: &shared - steps: - - checkout - - run: - name: Prepare environment - command: | - echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections - apt-get update - apt-get dist-upgrade -y - - run: - name: Install dependencies - command: | - apt-get install -y g++ cmake uuid-dev libboost-program-options-dev libboost-filesystem-dev libssl-dev debhelper - apt-get install -y dh-dkms || apt-get install -y dkms - - run: - name: Build blksnap-dkms package - working_directory: pkg/deb - command: ./build-blksnap-dkms.sh - - run: - name: Build dev, tools and tests packages - working_directory: pkg/deb - command: ./build-blksnap.sh - - run: - name: Save generate packages as artifacts - working_directory: build - command: | - mkdir /tmp/artifacts - mv *.deb /tmp/artifacts - - store_artifacts: - path: /tmp/artifacts - -jobs: - debian10: - <<: *shared - docker: - - image: library/debian:buster - debian11: - <<: *shared - docker: - - image: library/debian:bullseye - debian12: - <<: *shared - docker: - - image: library/debian:bookworm - ubuntu1404: - <<: *shared - docker: - - image: library/ubuntu:trusty - ubuntu1604: - <<: *shared - docker: - - image: library/ubuntu:xenial - ubuntu1804: - <<: *shared - docker: - - image: library/ubuntu:bionic - ubuntu2004: - <<: *shared - docker: - - image: library/ubuntu:focal - ubuntu2204: - <<: *shared - docker: - - image: library/ubuntu:jammy - ubuntu2210: - <<: *shared - docker: - - image: library/ubuntu:kinetic - -workflows: - build-deb: - jobs: - - debian10 - - debian11 - - debian12 - - ubuntu2004 - - ubuntu2204 - - ubuntu2210 diff --git a/.github/workflows/Kernel-module.yml b/.github/workflows/Kernel-module.yml deleted file mode 100644 index e2a72be6..00000000 --- a/.github/workflows/Kernel-module.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build module - -on: - workflow_dispatch: - push: - branches: - - "*" - paths: - - "module/**" - pull_request: - branches: - - "*" - paths: - - "module/**" - -jobs: - build-on-image: - name: Kernel ${{ matrix.kversion }} - runs-on: ubuntu-latest - container: - image: ${{ matrix.image }} - # Disable seccomp until a container manager in GitHub recognizes - # clone3() syscall, - # . - options: --security-opt seccomp=unconfined - - strategy: - fail-fast: false - matrix: - include: - - kversion: "5.10" - image: "library/debian:bullseye" - - kversion: "6.1" - image: "library/debian:bookworm" - - steps: - - uses: actions/checkout@v4 - - - name: Install packages required - run: | - apt-get update - apt-get install -y linux-headers-amd64 make g++ - - - name: Build kernel module - run: | - cd module - make -Wall -C /lib/modules/*/build M=`pwd` - diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml deleted file mode 100644 index 57803891..00000000 --- a/.github/workflows/Linux.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Test build - -on: - push: - branches: - - "*" - paths-ignore: - - "README.md" - - "doc/**" - - "patches/**" - pull_request: - branches: - - "*" - paths-ignore: - - "README.md" - - "doc/**" - - "patches/**" - workflow_dispatch: - -jobs: - build: - name: amd64 - runs-on: ubuntu-22.04 - - strategy: - fail-fast: false - - steps: - - uses: actions/checkout@v4 - - - name: Install packages required - run: | - sudo apt-get update - sudo apt-get install -y linux-headers-$(uname -r) g++ cmake uuid-dev libboost-program-options-dev libboost-filesystem-dev libssl-dev - - - name: Build kernel module - run: | - cd module - ./mk.sh build - - - name: Build blksnap-dev, blksnap-tools and blksnap-tests - working-directory: . - run: | - cmake . - make diff --git a/.github/workflows/build-other-archs.yml b/.github/workflows/build-other-archs.yml deleted file mode 100644 index 71900368..00000000 --- a/.github/workflows/build-other-archs.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Test build on other archs - -on: - push: - branches: - - "*" - paths: - - "include/**" - - "lib/**" - - "tests/**" - - "tools/**" - pull_request: - branches: - - "*" - paths: - - "include/**" - - "lib/**" - - "tests/**" - - "tools/**" - workflow_dispatch: - -jobs: - build_job: - # The host should always be linux - runs-on: ubuntu-18.04 - name: ${{ matrix.arch }} - - strategy: - matrix: - include: - - arch: aarch64 - - arch: ppc64le - - arch: s390x - - arch: armv7 - steps: - - uses: actions/checkout@v4 - - uses: uraimo/run-on-arch-action@v2 - name: Build - id: build - with: - arch: ${{ matrix.arch }} - distro: bullseye - - # Not required, but speeds up builds - githubToken: ${{ github.token }} - - # The shell to run commands with in the container - shell: /bin/sh - - # Install some dependencies in the container. This speeds up builds if - # you are also using githubToken. Any dependencies installed here will - # be part of the container image that gets cached, so subsequent - # builds don't have to re-install them. The image layer is cached - # publicly in your project's package repository, so it is vital that - # no secrets are present in the container state or logs. - install: | - apt-get update -q -y - apt-get install -q -y g++ cmake uuid-dev libboost-program-options-dev libboost-filesystem-dev libssl-dev - - # Build blksnap-dev, blksnap-tools and blksnap-tests - run: | - cmake . - make - From bf28ea7cef9c635904ebeacc7fdfb825fdb55aed Mon Sep 17 00:00:00 2001 From: Fabio Fantoni Date: Sat, 4 Nov 2023 11:12:40 +0100 Subject: [PATCH 3/3] fix some typo spotted by codespell --- .github/ISSUE_TEMPLATE/Bug_report.yml | 2 +- CONTRIBUTING.md | 2 +- doc/blksnap.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.yml b/.github/ISSUE_TEMPLATE/Bug_report.yml index 0cc90eee..f1cc3c19 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.yml +++ b/.github/ISSUE_TEMPLATE/Bug_report.yml @@ -67,7 +67,7 @@ body: - type: textarea id: additional-info attributes: - label: Additional informations + label: Additional information description: Add any additional information related to the issue here. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 44f5db8b..f7fff8e0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -17,7 +17,7 @@ kernel documentation, comments in source code etc... Testing is important to have a quality software, see related part in [README](README.md#tests) and the [README](https://github.com/veeam/blksnap/blob/master/doc/README-upstream-kernel.md) related to upstream kernel integration -for some informations. +for some information. ## Contributing to Source Code diff --git a/doc/blksnap.md b/doc/blksnap.md index 33ecda84..c31db448 100644 --- a/doc/blksnap.md +++ b/doc/blksnap.md @@ -46,7 +46,7 @@ A change tracker map is created for each block device. One byte of this map corr The byte of the change tracking map stores a number from 0 to 255. This is the sequence number of the snapshot for which there have been changes in the block since the snapshot was taken. Each time a snapshot is taken, the number of the current snapshot increases by one. This number is written to the cell of the change tracking map when writing to the block. Thus, knowing the number of one of the previous snapshots and the number of the last one, we can determine from the change tracking map which blocks have been changed. When the number of the current change has reached the maximum allowed value for the map of 255, when creating the next snapshot, the change tracking map is reset to zero, and the number of the current snapshot is assigned the value 1. The tracker of changes is reset and a new UUID — a unique identifier of the generation of snapshots — is generated. The snapshot generation identifier allows to identify that a change tracking reset has been performed. -The change map has two copies. One is active, and it tracks the current changes on the block device. The second one is available for reading while the snapshot is being held, and it contains the history of changes that occured before the snapshot was taken. Copies are synchronized at the moment of taking a snapshot. After the snapshot is released, a second copy of the map is not needed, but it is not released, so as not to allocate memory for it again the next time the snapshot is created. +The change map has two copies. One is active, and it tracks the current changes on the block device. The second one is available for reading while the snapshot is being held, and it contains the history of changes that occurred before the snapshot was taken. Copies are synchronized at the moment of taking a snapshot. After the snapshot is released, a second copy of the map is not needed, but it is not released, so as not to allocate memory for it again the next time the snapshot is created. ### Copy-on-write Data is copied in blocks, or rather in chunks. The term "chunk" is used not to confuse it with change tracker blocks and I/O blocks. In addition, the "chunk" in the blksnap module means about the same as the "chunk" in the dm-snap module.