Skip to content

timeshift --delete never finishes with btrfs simple quotas (quota rescan retried forever) #575

Open

Description

@zommuter

Describe the bug
With btrfs simple quotas enabled (btrfs quota enable --simple /), deleting a snapshot never finishes. The subvolume itself is deleted fine, but then timeshift retries btrfs quota rescan once a second, forever. Simple quotas have no rescan, so the command always fails with Invalid argument.

For me it blocked a system upgrade: timeshift-autosnap deletes old snapshots from a pacman hook, and the upgrade hung until I killed timeshift.

To Reproduce
Steps derived from the code path and the real run below; not yet re-run on a clean system.

  1. btrfs root, timeshift in btrfs mode
  2. btrfs quota enable --simple /
  3. Create a snapshot, then timeshift --delete --snapshot <name>
  4. It hangs; the log repeats Still rescanning quotas... ERROR: quota rescan failed: Invalid argument, and the kernel logs qgroup rescan init failed, running in simple mode once a second.

Real run (delete log):

[10:31:22] Deleted subvolume: @ (Id:473)
[10:31:22] Waiting on btrfs to finish deleting...
[10:31:23] Rescanning quotas...
[10:31:23] Still rescanning quotas... ERROR: quota rescan failed: Invalid argument
... 580 identical lines ...
[10:41:04] Still rescanning quotas... ERROR: quota rescan failed: Invalid argument

Expected behavior
The delete finishes. Under simple quotas there is nothing to rescan.

Cause
src/Core/Subvolume.vala (unchanged on master at 26.09.0) loops while (btrfs quota rescan ... != 0) sleep(1000), twice ("Rescanning quotas" and "(post)"). It treats every failure as "rescan still running". Checking /sys/fs/btrfs/<fsid>/qgroups/mode for squota and skipping the rescans would fix it. Possibly related: #354. The GUI uses the same delete code, so it should hang the same way (not tried).

System

  • Manjaro (rolling), kernel 6.18.49
  • Desktop: XFCE, X11
  • Timeshift 25.12.4, btrfs mode; btrfs-progs 7.1; timeshift-autosnap-manjaro 0.10.0

Disclosure: this was diagnosed and written up by an AI assistant (Claude) working on my machine. The log excerpt is from my system and the code reference is against current master, but I have not verified the analysis myself. Happy to provide more logs, and a PR if wanted.

Activity

  1. zommuter commented on Oct 13, 2026

    @zommuter
    Author

    Reproduced on a throwaway loop-device btrfs, so the steps in the report are now confirmed rather than derived.

    Two fresh 1 GiB btrfs images, each with a subvolume @ and one snapshot laid out as timeshift-btrfs/snapshots/<name>/@ plus info.json, then on each:

    timeout 60 timeshift --delete --snapshot <name> --snapshot-device /dev/loopN --btrfs --scripted --yes --debug
    
    quota mode (/sys/fs/btrfs/<uuid>/qgroups/mode) result
    btrfs quota enable --simple squota still running when the 60 s timeout fired (exit 124); output ends in Still rescanning quotas... ERROR: quota rescan failed: Invalid argument repeated; 60 kernel qgroup rescan init failed lines
    btrfs quota enable (control) qgroup finished in under a second, exit 0, snapshot removed; its output contains Rescanning quotas..., so it went through the same code path

    In both cases the snapshot subvolume itself was deleted; the hang is only the rescan loop afterwards. Timeshift 25.12.4, btrfs-progs 7.1, kernel 6.18.49 (Manjaro).

    Disclosure: as before, the repro script and this write-up are by an AI assistant (Claude) working on my machine; I ran the script. Happy to paste the script here if that helps.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions