On 15/05/2020 03:37, Andrew Pam wrote: > On 15/5/20 2:18 am, Graham Cobb wrote: >> Try scrub resume restarts the scrub and backgrounds it. Maybe there is >> something strange about background processes created in the restore >> script. What happens if you specify "-B" on the resume? > > Then the resume does not occur. After the resume from suspend-to-RAM, > no "btrfs" process is running and the status still shows as "aborted". > This suggests that the "btrfs resume -B" fails when run from within the > systemd post-resume script. Maybe something special about the post-resume script. Have you tried not resuming the scrub in the systemd script but doing it by hand after everything has settled down? > >> Try adding a sleep after the cancel (or logic to see if the scrub >> process has actually exited). > > I tried adding both "killall -s0 -w btrfs" and "sleep 5" - even with > these changes, the "btrfs resume" (without -B option) once again shows > "last_physical: 0" Oh well, worth a try. Did you try running the resume using my logging patch? Was the 0 for last_physical definitely being returned from the kernel in the ioctl response? It may mean running it manually (or redirecting stderr to a file). Graham
