Skip to content

bcachefs: 2023-06-28 -> 2023-09-22#256638

Merged
Mic92 merged 7 commits intoNixOS:stagingfrom
YellowOnion:bump-bcachefs
Oct 3, 2023
Merged

bcachefs: 2023-06-28 -> 2023-09-22#256638
Mic92 merged 7 commits intoNixOS:stagingfrom
YellowOnion:bump-bcachefs

Conversation

@YellowOnion
Copy link
Copy Markdown
Contributor

@YellowOnion YellowOnion commented Sep 22, 2023

This release includes an overhaul of various bcachefs systems in prep for mainline merge.

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@Madouura @Mic92 @davidak @PedroHLC @RaitoBezarius

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: kernel The Linux kernel 8.has: module (update) This PR changes an existing module in `nixos/` labels Sep 22, 2023
@YellowOnion
Copy link
Copy Markdown
Contributor Author

YellowOnion commented Sep 22, 2023

This supersedes: #252348

bcachefsSimple works on a kernel I pulled yesterday, I'm in the middle compiling the one I just pushed and will test it on my current system which is using a non-encrypted multi-device root.

@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Sep 22, 2023
@ofborg ofborg bot requested review from Madouura and davidak September 22, 2023 08:37
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels Sep 22, 2023
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 22, 2023
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 22, 2023
@YellowOnion YellowOnion force-pushed the bump-bcachefs branch 2 times, most recently from 547f8e5 to 6fb965a Compare September 23, 2023 05:21
Copy link
Copy Markdown
Member

@PedroHLC PedroHLC left a comment

Choose a reason for hiding this comment

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

No issues for me as long as we remember to drop all the workaround when we drop the "testing" kernel.

TL;DR: LGTM.

@Madouura
Copy link
Copy Markdown
Contributor

Madouura commented Sep 23, 2023

@YellowOnion

nix build --print-out-paths -L .#bcachefs-tools.tests.bcachefsSimple
trace: warning: mdadm: Neither MAILADDR nor PROGRAM has been set. This will cause the `mdmon` service to crash.
bcachefs> trying https://evilpiepirate.org/git/bcachefs.git/rawdiff/?id=508de596ed0b58b1dbe783ca1fbbee04d40e9ccf&id2=v6.5
bcachefs>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
bcachefs>                                  Dload  Upload   Total   Spent    Left  Speed
console-env> created 333 symlinks in user environment
bcachefs> 100 2611k    0 2611k    0     0  3003k      0 --:--:-- --:--:-- --:--:-- 3001k
fontconfig-etc> created 1 symlinks in user environment
error: hash mismatch in fixed-output derivation '/nix/store/ghrvp7r3lynprk4dk9iaxhkhmrk2z5lj-bcachefs-508de596ed0b58b1dbe783ca1fbbee04d40e9ccf.diff.drv':
         specified: sha256-wNMttW681D47YYXhRXjRT4/QWdFM0pOcKrrtZvgyd5w=
            got:    sha256-MdSoXJVxytSbIoJr73vD5gr9UC5Hwh4n6i28ElSeOUE=
error: 1 dependencies of derivation '/nix/store/kjvnkj2xaqgw6llk01jajm6svckfvvrn-linux-6.5.4.drv' failed to build
error: 1 dependencies of derivation '/nix/store/la77m480b0dvr4a8ld9vqm016224g2aj-linux-6.5.4-modules.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mvi3gahq31ipl2vvlmrac7wiz285w4ln-nixos-system-machine-23.11pre-git.drv' failed to build
error: 1 dependencies of derivation '/nix/store/j02a7i9mh2b194j50l7si39yrm0hprnr-nixos-vm.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ryrflimbb912wxkhzwsmk8r117nymjmg-nixos-test-driver-installer-bcachefs-simple.drv' failed to build
error: 1 dependencies of derivation '/nix/store/kgmjvjjiajpiapnp9zyxgxnlnf8pcqrb-vm-test-run-installer-bcachefs-simple.drv' failed to build

Replacing the hash fixes it.

diff --git a/pkgs/os-specific/linux/kernel/bcachefs.json b/pkgs/os-specific/linux/kernel/bcachefs.json
index 8082cffcc1e9..c24e2fb16dd8 100644
--- a/pkgs/os-specific/linux/kernel/bcachefs.json
+++ b/pkgs/os-specific/linux/kernel/bcachefs.json
@@ -1,4 +1,5 @@
 {
-  "diffHash": "sha256-wNMttW681D47YYXhRXjRT4/QWdFM0pOcKrrtZvgyd5w=",
-  "commit": "508de596ed0b58b1dbe783ca1fbbee04d40e9ccf"
+  "diffHash": "sha256-n3f9VWU7MsLja+roSCXQ2uZ0+63vbCSZKJWoiQM89zM=",
+  "commit": "38a4d47c01fb65fb74bb85584d27f950cdb2e2a7",
+  "date": "2023-09-22"
 }
diff --git a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
index f4fc5361003d..18af0f55bd74 100644
--- a/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
+++ b/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix
@@ -2,7 +2,6 @@
 , stdenv
 , fetchpatch
 , kernel
-, commitDate ? "2023-06-28"
 # bcachefs-tools stores the expected-revision in:
 #   https://evilpiepirate.org/git/bcachefs-tools.git/tree/.bcachefs_revision
 # but this does not means that it'll be the latest-compatible revision
@@ -18,7 +17,7 @@ in
 
 # NOTE: bcachefs-tools should be updated simultaneously to preserve compatibility
 (kernel.override ( args // {
-  version = "${kernel.version}-bcachefs-unstable-${commitDate}";
+  version = "${kernel.version}-bcachefs-unstable-${version.date}";
 
   extraMeta = {
     branch = "master";

@Madouura
Copy link
Copy Markdown
Contributor

All tests except for bcachefsEncrypted work. Same error as last time.

vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    0.970516] virtio_blk virtio3: [vda] 16777216 512-byte logical blocks (8.59 GB/8.00 GiB)
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    0.979977]  vda: vda1 vda2 vda3
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    0.982396] sr 1:0:0:0: [sr0] scsi3-mmc drive: 4x/4x cd/rw xa/form2 tray
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    0.983363] cdrom: Uniform CD-ROM driver Revision: 3.20
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.154878] raid6: avx2x4   gen() 36054 MB/s
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.171877] raid6: avx2x2   gen() 30172 MB/s
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.188878] raid6: avx2x1   gen() 28696 MB/s
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.189472] raid6: using algorithm avx2x4 gen() 36054 MB/s
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.206877] raid6: .... xor() 6476 MB/s, rmw enabled
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.207549] raid6: using avx2x2 recovery algorithm
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.211393] xor: automatically using best checksumming function   avx
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.375898] I/O error, dev fd0, sector 0 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 2
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.377013] floppy: error 10 while reading block 0
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.382647] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.383690] CPU: 0 PID: 1 Comm: init Not tainted 6.5.4 #1-NixOS
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.384467] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.2-0-gea1b7a073390-prebuilt.qemu.org 04/01/2014
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.385925] Call Trace:
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.386320]  <TASK>
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.386667]  dump_stack_lvl+0x47/0x60
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.387196]  panic+0x323/0x340
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.387654]  ? srso_alias_return_thunk+0x5/0x7f
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.388279]  do_exit+0x959/0xad0
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.388800]  ? handle_mm_fault+0x9e/0x350
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.389375]  do_group_exit+0x31/0x80
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.389888]  __x64_sys_exit_group+0x18/0x20
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.390473]  do_syscall_64+0x3e/0x90
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.390989]  entry_SYSCALL_64_after_hwframe+0x6e/0xd8
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.391671] RIP: 0033:0x7f5b8c6d42ed
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.392186] Code: 01 48 83 c8 ff c3 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 8b 35 1d 4b 10 00 ba e7 00 00 00 eb 07 66 0f 1f 44 00 00 f4 89 d0 0f 05 <48> 3d 00 f0 ff ff 76 f3 f7 d8 64 89 06 eb ec 0f 1f 40 00 f3 0f 1e
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.394522] RSP: 002b:00007ffd5fa06ae8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e7
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.395542] RAX: ffffffffffffffda RBX: 00007ffd5fa07f04 RCX: 00007f5b8c6d42ed
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.396452] RDX: 00000000000000e7 RSI: ffffffffffffff88 RDI: 0000000000000001
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.397361] RBP: 0000000000000004 R08: 00007ffd5fa06af0 R09: 0000000000000004
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.398275] R10: 02b87a7c7497567c R11: 0000000000000202 R12: 0000000000000000
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.399190] R13: 00007ffd5fa06ed0 R14: 0000000000000000 R15: 00007f5b8c924000
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.400105]  </TASK>
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.400524] Kernel Offset: 0x36c00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
vm-test-run-installer-bcachefs-encrypted> boot-after-install # [    1.401912] Rebooting in 1 seconds..

@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Sep 24, 2023

We could greatly simplify the amount of packages by just add this patchset to utillinux: util-linux/util-linux#2505

@YellowOnion
Copy link
Copy Markdown
Contributor Author

@Madouura I was meaning to run that test and got distracted, I know what the issue is, the device is encrypted so we can't find the UUID, I'm unsure how we're meant to handle this without also specifying a custom flag / parameter. Maybe I'll write a patch for upstream.

@delroth delroth added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 25, 2023
Copy link
Copy Markdown
Contributor

@Madouura Madouura left a comment

Choose a reason for hiding this comment

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

Since the encryption issue in the VM test is an upstream issue, LGTM.
Might wanna update to koverstreet/bcachefs@0a84850 since apparently there was a lock leak.

@delroth delroth added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Sep 26, 2023
@YellowOnion
Copy link
Copy Markdown
Contributor Author

@Madouura I found a work around for the encryption stuff, I can use blkid to get the device path, since bcachefs has a plain text super. I have a test branch in bump-bcachefs-test trying to figure out why cryptsetup isn't passing tests with the new util-linux I skipped the tests for now, but compile is taking a while.

@github-actions github-actions bot removed 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes 6.topic: printing Drivers, CUPS & Co. 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: ruby A dynamic, open source programming language with a focus on simplicity and productivity. 6.topic: vim Advanced text editor 6.topic: stdenv Standard environment 6.topic: nodejs Node.js is a free, open-source, cross-platform JavaScript runtime environment 6.topic: systemd Software suite that provides an array of system components for Linux operating systems. labels Oct 3, 2023
I believe this has been fixed upstream.
Includes prep work for mainline bcachefs release.
buildLinux doesn't provide argsOverride by default.

Prior to 663caaa, a default kernel was replaced with a direct invocation
to buildLinux, this broke the use of argsOverride, in 663caaa, the use
of argsOverride was removed, and then later the invocation of buildLinux
was replaced with vanilla linux kernel that required argsOverride
which then rebroke things again.

Recommend either: put argsOverride inside buildLinux, or replace it with
something less confusing to maintainers.
The json appearantly contained the wrong checksum and we don't have a way to generate this
@Mic92
Copy link
Copy Markdown
Member

Mic92 commented Oct 3, 2023

I fixed the build locally and made sure all nixos tests for bcachefs run. I suggest to move these json refactorings to a later PR, when this is merged into master.

@vcunat
Copy link
Copy Markdown
Member

vcunat commented Nov 16, 2023

This conflicted with PR #265820. Perhaps you want to check the result in 0fe5300

@ghost
Copy link
Copy Markdown

ghost commented Nov 17, 2023

Perhaps you want to check the result in 0fe5300

It's okay.

Also, I merged

which bumps us to 1.3.3.

@lukegb
Copy link
Copy Markdown
Contributor

lukegb commented Mar 17, 2024

This broke bcache during install (nixosTests.installer.bcache); grep(!qr#dev/bcachefs.*#, @bcacheDevices) is equivalent to
grep(!true, @bcacheDevices), because the qr operator returns a regex operator, rather than matching against $_.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: kernel The Linux kernel 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants