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

services.btrfs.autoScrub: running scrub prevents system suspend #79086

Closed
schmittlauch opened this issue Feb 2, 2020 · 2 comments
Closed

services.btrfs.autoScrub: running scrub prevents system suspend #79086

schmittlauch opened this issue Feb 2, 2020 · 2 comments

Comments

@schmittlauch
Copy link
Contributor

@schmittlauch schmittlauch commented Feb 2, 2020

Describe the bug

When the filesystem scrubbing service configured via services.btrfs.autoScrub is running, the system cannot suspend until the scrubbing is completed.

To Reproduce
Steps to reproduce the behavior:

  1. enable the autoscrub service on some Btrfs file system, e.g. by
services.btrfs.autoScrub = {enable = true; fileSystems = [ "/" ];};
  1. start the resulting service, e.g. systemctl start btrfs-scrub-.service
  2. suspend-to-ram the system: systemctl suspend
  3. the system fails to suspend and a trace appropriating this failure tu btrfs can be found in the system journal

Expected behavior

The scrub should be paused properly when the system suspends.

More context

It's likely that this is an upstream bug. I'll ask around on the btrfs mailing list and will update this issue accordingly.

Metadata

  • system: "x86_64-linux"
  • host os: Linux 4.19.98, NixOS, 19.09.1970.6d9a4a615ee (Loris)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.2
  • channels(root): "home-manager-19.09, nixos-19.09.1970.6d9a4a615ee, nixos-unstable-20.03pre210639.e59dcf8ccec"
  • channels(user): "home-manager-19.09"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
- tasks/filesystems/btrfs.nix
@symphorien
Copy link
Contributor

@symphorien symphorien commented Feb 2, 2020

The service probably needs Conflicts=suspend.target sleep.target and the other suspend related targets.

@schmittlauch
Copy link
Contributor Author

@schmittlauch schmittlauch commented Feb 7, 2020

The issue still appears with a 5.4 kernel.

system journal

symphorien added a commit to symphorien/nixpkgs that referenced this issue Feb 14, 2020
Ekleog added a commit that referenced this issue Mar 12, 2020
dtzWill added a commit to dtzWill/nixpkgs that referenced this issue Mar 13, 2020
Fixes: NixOS#79086 NixOS#79017
(cherry picked from commit 5359d90)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.