Skip to content

bcachefs: 2022-05 -> 2022-09#179396

Merged
SuperSandro2000 merged 2 commits intoNixOS:masterfrom
Madouura:dev/bcachefs
Oct 7, 2022
Merged

bcachefs: 2022-05 -> 2022-09#179396
SuperSandro2000 merged 2 commits intoNixOS:masterfrom
Madouura:dev/bcachefs

Conversation

@Madouura
Copy link
Contributor

@Madouura Madouura commented Jun 28, 2022

Description of changes

Currently, we can't patch due to printbuf changes.
Also, there is an error with modpost I don't understand happening even with these changes.

  CC      arch/x86/boot/compressed/kaslr.o
  CC      arch/x86/boot/compressed/ident_map_64.o
  CC      arch/x86/boot/compressed/idt_64.o
  AS      arch/x86/boot/compressed/idt_handlers_64.o
  AS      arch/x86/boot/compressed/mem_encrypt.o
  CC      arch/x86/boot/compressed/pgtable_64.o
  CC      arch/x86/boot/compressed/acpi.o
  AS      arch/x86/boot/compressed/efi_thunk_64.o
  CC      arch/x86/boot/compressed/misc.o
  ZSTD22  arch/x86/boot/compressed/vmlinux.bin.zst
ERROR: modpost: "stack_trace_save_tsk" [fs/bcachefs/bcachefs.ko] undefined!
make[1]: *** [../scripts/Makefile.modpost:134: modules-only.symvers] Error 1
make[1]: *** Deleting file 'modules-only.symvers'
make: *** [../Makefile:1749: modules] Error 2
make: *** Waiting for unfinished jobs....
  MKPIGGY arch/x86/boot/compressed/piggy.S
  AS      arch/x86/boot/compressed/piggy.o
  LD      arch/x86/boot/compressed/vmlinux
  OBJCOPY arch/x86/boot/vmlinux.bin
  ZOFFSET arch/x86/boot/zoffset.h
  AS      arch/x86/boot/header.o
  LD      arch/x86/boot/setup.elf
  OBJCOPY arch/x86/boot/setup.bin
  BUILD   arch/x86/boot/bzImage
Kernel: arch/x86/boot/bzImage is ready  (#1)
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/)
  • 22.11 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 6.topic: kernel The Linux kernel label Jun 28, 2022
@ofborg ofborg bot added the 8.has: clean-up This PR removes packages or removes other cruft label Jun 28, 2022
@ofborg ofborg bot requested a review from davidak June 28, 2022 01:10
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. labels Jun 28, 2022
@Madouura
Copy link
Contributor Author

Related: koverstreet/bcachefs#429
May be best to compile as built-in for now.

@github-actions github-actions bot added 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/` labels Jun 30, 2022
@Madouura Madouura marked this pull request as ready for review June 30, 2022 18:45
@Madouura
Copy link
Contributor Author

Ready for review.

@Madouura
Copy link
Contributor Author

Madouura commented Jul 6, 2022

cc @davidak

@Madouura
Copy link
Contributor Author

Madouura commented Jul 7, 2022

We may want to wait on merging actually, I'm not sure if it's a problem with 5.18 in general or if it is because we aren't patching anymore, but I'm getting the kernel not being able to work around duplicate NSIDs for NVME drives.

@Madouura
Copy link
Contributor Author

Madouura commented Jul 7, 2022

Patching problem is with block/bio.c, no idea why I didn't see that before.
Not sure how to properly work around this, but working on it.

@Madouura
Copy link
Contributor Author

Madouura commented Jul 7, 2022

I'm out of my depth again. Can't figure anything out even with any derivation of:

{
  name = "bcachefs-${commit}";

  patch = fetchpatch {
    name = "bcachefs-${commit}.diff";
    url = "https://evilpiepirate.org/git/bcachefs.git/rawdiff/?id=${commit}&id2=v${lib.versions.majorMinor kernel.version}";
    sha256 = diffHash;

    postFetch = ''
      ${pkgs.buildPackages.patchutils}/bin/filterdiff -x 'a/block/bio.c' "$out" > "$tmpfile"
      mv "$tmpfile" "$out"
    '';
};

@github-actions github-actions bot removed 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Jul 7, 2022
@Madouura
Copy link
Contributor Author

Madouura commented Jul 7, 2022

Looks like the duplicate NSID error is a problem with 5.18 in general.

@Madouura
Copy link
Contributor Author

At this point, we may want to consider getting rid of the linux bcachefs testing package and waiting for it to go into mainline.
AFAIK all the other bcachefs stuff (bcachefs-tools, tests, tasks) is fine, but it seems to be near-impossible to continue supporting this.

@jnsaff
Copy link
Contributor

jnsaff commented Jul 26, 2022

I managed to get your PR working when I changed it to the latest Kent has and compiled it as built in instead of a module. Not sure whether this is helpful but I would be glad if you would keep this PR open and we would keep up with the effort however futile it seems.

Thanks for doing this work on this PR!

@Madouura
Copy link
Contributor Author

Last time I tried it was an issue with patching. IIRC compiling it as built-in was required now anyway due to a bug.

@jnsaff
Copy link
Contributor

jnsaff commented Jul 26, 2022

This worked for me

{ lib
, pkgs
, fetchpatch
, kernel
, date ? "2022-07-03"
, commit ? "04962c7b97e783d4b705616a858af141cc6ba878"
, diffHash ? "sha256-zsieai/29Ry4LsJQuwMaxtdYdIJdEJCusg016ovUM2Q="
, kernelPatches # must always be defined in bcachefs' all-packages.nix entry because it's also a top-level attribute supplied by callPackage
, argsOverride ? {}
, ...
} @ args:

# NOTE: bcachefs-tools should be updated simultaneously to preserve compatibility
(kernel.override ( args // {
  argsOverride = {
    version = "${kernel.version}-bcachefs-unstable-${date}";

    extraMeta = {
      branch = "master";
      maintainers = with lib.maintainers; [ davidak Madouura ];
    };
  } // argsOverride;

  kernelPatches = [
    {
      name = "bcachefs-${commit}";

      patch = fetchpatch {
        name = "bcachefs-${commit}.diff";
        url = "https://evilpiepirate.org/git/bcachefs.git/rawdiff/?id=${commit}&id2=v${lib.versions.majorMinor kernel.version}";
        sha256 = diffHash;

        postFetch = ''
          ${pkgs.buildPackages.patchutils}/bin/filterdiff -x 'a/block/bio.c' "$out" > "$tmpfile"
          mv "$tmpfile" "$out"
        '';
      };

      extraConfig = "BCACHEFS_FS y";
    }

    {
      # Needed due to patching failure otherwise
      name = "linux-bcachefs-bio.c-fix";
      patch = ./linux-bcachefs-bio.c-fix.patch;
    }
  ] ++ kernelPatches;
}))

The only changes to your PR are the compiling in and a never commit from Kent's repo.

@Madouura
Copy link
Contributor Author

I'm unsure as to why the patching is working now, but it is.
I'll build, run the tests, and hopefully it'll be ready for review in an hour.

@Madouura
Copy link
Contributor Author

error: builder for '/nix/store/6qkiyxdrj4p2p76qsxlmrcx3v9qg8n6k-linux-5.18.13-bcachefs-unstable-2022-07-25.drv' failed with exit code 2;
       last 10 log lines:
       >   CC [M]  drivers/gpu/drm/nouveau/nouveau_led.o
       >   CC [M]  drivers/gpu/drm/nouveau/nvc0_fence.o
       >   CC [M]  drivers/gpu/drm/nouveau/nv84_fence.o
       >   CC [M]  drivers/gpu/drm/nouveau/nv50_fence.o
       >   CC [M]  drivers/gpu/drm/nouveau/nv17_fence.o
       >   CC [M]  drivers/gpu/drm/nouveau/nv10_fence.o
       >   LD [M]  drivers/gpu/drm/amd/amdgpu/amdgpu.o
       >   LD [M]  drivers/gpu/drm/nouveau/nouveau.o
       >   AR      drivers/gpu/built-in.a
       >   AR      drivers/built-in.a
       For full logs, run 'nix log /nix/store/6qkiyxdrj4p2p76qsxlmrcx3v9qg8n6k-linux-5.18.13-bcachefs-unstable-2022-07-25.drv'.

Last time this was a problem, it was solved by a kernel update. Not sure what to do in the meantime.

@Madouura Madouura changed the title bcachefs: 2022-05 -> 2022-06 bcachefs: 2022-05 -> 2022-07 Aug 1, 2022
@Madouura
Copy link
Contributor Author

Madouura commented Aug 1, 2022

Turns out I was compiling a previous source derivation, diffHash didn't give me an error.
Let's see how it goes now.

@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Aug 1, 2022
@Madouura
Copy link
Contributor Author

Madouura commented Aug 1, 2022

Builds, tests succeed. Ready for review.
I did have to change from metadata replicas to replicas (metadata replicas and data replicas) due to the bcachefsMulti test failing every third restart. Seems to be a write error leading to a trans path overflow, but that's on kent's side.
The reason why this change works is because the disks are now in a RAID 1-like mode, and can cover for the error.

@ofborg ofborg bot added the ofborg-internal-error Ofborg encountered an error label Aug 1, 2022
@jnsaff
Copy link
Contributor

jnsaff commented Aug 2, 2022

I tested this PR on my machine and it builds and works nicely.

@Madouura Madouura mentioned this pull request Aug 8, 2022
13 tasks
@bobby285271 bobby285271 added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 12, 2022
@cole-h
Copy link
Member

cole-h commented Aug 31, 2022

@ofborg eval

@cole-h cole-h removed the ofborg-internal-error Ofborg encountered an error label Sep 1, 2022
@Madouura Madouura changed the title bcachefs: 2022-05 -> 2022-07 bcachefs: 2022-05 -> 2022-09 Oct 1, 2022
@github-actions github-actions bot removed the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Oct 1, 2022
@Madouura
Copy link
Contributor Author

Madouura commented Oct 1, 2022

Looks like 5.19 fixed the weirdness.
Tests pass, had to temporarily remove "zfs" from nixos/modules/profile/base.nix to bypass ZFS not being updated to 5.19 yet.

@bobby285271 bobby285271 removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Oct 1, 2022
@Madouura
Copy link
Contributor Author

Madouura commented Oct 7, 2022

@SuperSandro2000 Are we good for merge?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

Successfully created backport PR #194905 for release-22.05.

@Madouura Madouura deleted the dev/bcachefs branch October 7, 2022 09:33
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 8.has: clean-up This PR removes packages or removes other cruft 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 101-500 This PR causes between 101 and 500 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants