btrfs / btrfs-todo

An issues only repo to organize our TODO items
21 stars 2 forks source link

Weirdness with loopback devices #9

Open josefbacik opened 3 years ago

josefbacik commented 3 years ago

I've seen this in my own testing, but haven't been able to reproduce to figure out what it was (it was always unrelated to what I was doing). However mkosi hits it reliably, and they've had to add a btrfs device forget to their script for it to work. This maybe the actual answer, but I need to dig into it to make sure we're not doing something wonkey. They've provided a nice reproducer

git clone https://github.com/DaanDeMeyer/mkosi --branch without-btrfs-fix
cd mkosi
echo options loop max_loop=64 > /etc/modprobe.d/loop.conf
modprobe -r loop
modprobe loop
python -m mkosi -i -f -t gpt_btrfs
python -m mkosi -i -f -t gpt_btrfs
python -m mkosi -i -f -t gpt_btrfs
josefbacik commented 3 years ago

https://lore.kernel.org/linux-btrfs/6b1f037344cd8d24566f3d9873b820a73384242c.1598995167.git.josef@toxicpanda.com/

DaanDeMeyer commented 3 years ago

What's the status of this one? I just tried removing the workaround in mkosi on Linux 5.9.14 and still get the same error.

kdave commented 3 years ago

The patch is not merged yet and tagged as test needed in project card https://github.com/btrfs/linux/projects/1#card-44714604, with obvious meaning.

DaanDeMeyer commented 3 years ago

Ahh, I had no idea it was blocked on testing. I'll see about building a custom kernel with the patch and testing the fix.

kdave commented 3 years ago

Not just testing but writing a test case that will be added to fstests.

lorddoskias commented 3 years ago

How is this issue supposed to be reproduced? I tried creating a btrfs on a loopback device, writing a syngle file, unmounting the fs, it had generation 6. Then I re-created it with mkfs.btrfs /dev/loop0 and it had generation 5. However I was able to mount it, even without this patch ?

josefbacik commented 3 years ago

https://github.com/btrfs/fstests/commit/4a109ce8d36c5d10f81209a928cdaf60671d8469#diff-f000360ef13458c257f9ad98044c354ade91c328b609c2a0237646f9b3a856d6