Re: [PATCH] btrfs: do not zero f_bavail if we have available space

Roman Mamedov
2020-02-21T05:45:48Z

On Thu, 20 Feb 2020 21:38:04 -0800
Marc MERLIN <marc@merlins.org> wrote:

> I had a closer look, and even with 5.4.20, my whole lv is full now:
> LV Name thinpool2
> Allocated pool data 99.99%
> Allocated metadata 59.88%

Oversubscribing thin storage should be done carefully and only with a very
good reason, and when you run out of something you didn't have in the first
place, seems hard to blame Btrfs or anyone else for it.

> Sure enough, that broken ubuntu one (that really only needs 4GB or so),
> is now taking 60% of the mapped size (i.e. everything that was left)
> LV Name ubuntu
> Mapped size 60.26%

Provide full output of lvdisplay -m, not snippets of it. As is, "omg 60%"
tells nothing to anyone, who knows maybe this LV is maybe 6 GB in size, and at
60% used, it comes out to 4GB exactly.

> I'm now running this overnight, but any command on that filesystem, just
> hangs for now:
> gargamel:/mnt/btrfs_pool2/backup/ubuntu# fstrim -v .

At this point "Data%" in `lvs` output should be decreasing steadily. (if not,
check your dmesg for some kind of a hang or deadlock).

--
With respect,
Roman