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

filesystem: add bcachefs support #8126

Merged
merged 1 commit into from
Apr 20, 2024

Conversation

stintel
Copy link
Contributor

@stintel stintel commented Mar 22, 2024

SUMMARY

Add support for bcachefs to the filesystem module.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

filesystem

ADDITIONAL INFORMATION

Test playbook:

---
- hosts: localhost
  vars:
    img_file: /tmp/bcachefs.img
  tasks:
    - name: create 1GiB file
      community.general.filesize:
        path: "{{ img_file }}"
        size: 1GiB

    - name: create bcachefs filesystem on file
      ansible.legacy.filesystem:
        dev: "{{ img_file }}"
        fstype: bcachefs
        uuid: bfe441c5-93da-440b-8c9a-e807bc538abb

    - name: create bcachefs filesystem on file (no changes)
      ansible.legacy.filesystem:
        dev: "{{ img_file }}"
        force: False
        fstype: bcachefs

    - name: create bcachefs filesystem on file (force)
      ansible.legacy.filesystem:
        dev: "{{ img_file }}"
        force: True
        fstype: bcachefs

    - name: resize 1GiB file to 2GiB
      community.general.filesize:
        path: "{{ img_file }}"
        size: 2GiB

    - name: resize bcachefs filesystem on file
      ansible.legacy.filesystem:
        dev: "{{ img_file }}"
        fstype: bcachefs
        resizefs: True

Output:

PLAY [localhost] *****************************************************************************************************************************************

TASK [Gathering Facts] ***********************************************************************************************************************************
ok: [localhost]

TASK [create 1GiB file] **********************************************************************************************************************************
--- before
+++ after
@@ -1 +1 @@
-size: null
+size: 1073741824

changed: [localhost]

TASK [create bcachefs filesystem on file] ****************************************************************************************************************
changed: [localhost]

TASK [create bcachefs filesystem on file (no changes)] ***************************************************************************************************
ok: [localhost]

TASK [create bcachefs filesystem on file (force)] ********************************************************************************************************
changed: [localhost]

TASK [resize 1GiB file to 2GiB] **************************************************************************************************************************
--- before
+++ after
@@ -1 +1 @@
-size: 1073741824
+size: 2147483648

changed: [localhost]

TASK [resize bcachefs filesystem on file] ****************************************************************************************************************
changed: [localhost]

PLAY RECAP ***********************************************************************************************************************************************
localhost                  : ok=7    changed=5    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

@stintel stintel marked this pull request as draft March 22, 2024 00:06
@stintel stintel force-pushed the filesystem_bcachefs branch 2 times, most recently from f1d23f1 to 8f609b2 Compare March 22, 2024 00:09
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added WIP Work in progress feature This issue/PR relates to a feature request integration tests/integration module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests labels Mar 22, 2024
@stintel stintel force-pushed the filesystem_bcachefs branch 9 times, most recently from dc02771 to 803d98e Compare March 22, 2024 01:24
@stintel
Copy link
Contributor Author

stintel commented Mar 22, 2024

The UUID checks are most likely failing because the util-linux version on those distros does not have support for bcachefs. I'll try to look at that over the weekend.

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-8 Automatically create a backport for the stable-8 branch labels Mar 22, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I've added some first comments below.

@stintel stintel force-pushed the filesystem_bcachefs branch 2 times, most recently from d1c8c76 to a5a7607 Compare March 22, 2024 09:25
@stintel
Copy link
Contributor Author

stintel commented Mar 22, 2024

Would it be OK to limit the tests to Alpine >= 3.19 for now? That seems to be the only distribution with recent enough versions of both bcachefs-tools and util-linux used in the test matrix.

@felixfontein
Copy link
Collaborator

I would expect that at least with Arch Linux the tests should also pass, since Arch usually has very up to date packages. (https://archlinux.org/packages/core/x86_64/util-linux/, https://archlinux.org/packages/extra/x86_64/bcachefs-tools/)

@stintel stintel force-pushed the filesystem_bcachefs branch from a5a7607 to 5737842 Compare March 24, 2024 22:50
@stintel
Copy link
Contributor Author

stintel commented Mar 24, 2024

You're right, looking at the versions I'd expect it to work. I modified the tests to run bcachefs related tasks only on Alpine and Arch Linux.

@stintel stintel force-pushed the filesystem_bcachefs branch 2 times, most recently from 50d31f5 to 17d00b1 Compare March 25, 2024 10:41
@stintel stintel marked this pull request as ready for review March 25, 2024 21:34
@ansibullbot ansibullbot removed the WIP Work in progress label Mar 25, 2024
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Apr 2, 2024
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I lost track of this (too many things to do). I'll merge this on the upcoming weekend if nobody objects. There's just one small change needed.

@stintel stintel force-pushed the filesystem_bcachefs branch from 17d00b1 to a30428d Compare April 17, 2024 21:17
@ansibullbot ansibullbot removed the stale_ci CI is older than 7 days, rerun before merging label Apr 17, 2024
@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Apr 20, 2024
@felixfontein felixfontein merged commit 486c26b into ansible-collections:main Apr 20, 2024
132 of 133 checks passed
Copy link

patchback bot commented Apr 20, 2024

Backport to stable-8: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-8/486c26b2247c37428c41a094ab7db593f3355734/pr-8126

Backported as #8251

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Apr 20, 2024
Signed-off-by: Stijn Tintel <[email protected]>
(cherry picked from commit 486c26b)
@felixfontein
Copy link
Collaborator

@stintel thanks for your contribution!

felixfontein pushed a commit that referenced this pull request Apr 20, 2024
…rt (#8251)

filesystem: add bcachefs support (#8126)

Signed-off-by: Stijn Tintel <[email protected]>
(cherry picked from commit 486c26b)

Co-authored-by: Stijn Tintel <[email protected]>
@stintel stintel deleted the filesystem_bcachefs branch April 22, 2024 09:23
aretrosen pushed a commit to aretrosen/community.general that referenced this pull request Apr 22, 2024
Massl123 pushed a commit to Massl123/community.general that referenced this pull request Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8 Automatically create a backport for the stable-8 branch feature This issue/PR relates to a feature request integration tests/integration module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants