Re: 3.14.0-rc3 btrfs scrub is preventing my laptop from going to sleep

Marc MERLIN
2014-03-03T23:13:13Z

On Mon, Mar 03, 2014 at 05:18:33PM -0500, Josef Bacik wrote:
> > Maybe it will work if we cancel the scrub as opposed to pausing it,
> > but of course it's not ideal. Is that the next step?
>
> Sigh I thought the PM stuff called freeze_fs() but I think that was
> just tuxonice. I don't have a quick fix at the moment, I really will
> have to wait on this until after qgroups. Thanks,

That's ok, thanks for giving it a shot.

For now, I just stuck this in /etc/acpi/sleep.sh
awk '/btrfs/ { print $1 }' /proc/mounts | sort -u | while read fs; do btrfs scrub cancel $fs; done

Not great, but it ensures my laptop will go to sleep and not kill my
batteries with the lid closed :)

Marc