Creating swapfile on btrfs subvolume: chattr +C fails

What’s the risk? BTRFS code being dodgy?
Once it’s setup properly I’d consider it working?
:thinking:

Swapfile process + Hibernate process + Btrfs on LUKS process.
I am not sure if all 3 processes run properly in time order without conflict, but they depend heavily on Btrfs.

If the hibernate mode is activated manually or automatically, it would turn off or interrupt many processes (maybe including Btrfs process?) and moves them out of RAM into Btrfs LUKS on your disk. The Btrfs filesystem cannot function without Btrfs processing, e.g out-of-sync will cause the problem. That’s just my logic, but without proof.

The separate swap partition is completely independent from Btrfs and is more stabil for the hibernate mode

Do you have any documentation that explains this? All filesystem code runs in ram including the code for swap(They are both part of the kernel). The hibernation process for btrfs should be the same as any filesystem from that perspective. If it worked the way you are describing, I don’t see how hibernation would ever work.

The btrfs swapfile has CoW disabled. I don’t see why there would be additional “risk” in this situation.

That is my logic without proof, that is about the common function of hibernation, It saves all contents of processes to a disk, then PC and RAM are turned off completely.

Yes, I thought so too.

Example: A case of the similar situation, Ext4 could handle the corrupted filesystem after sleep mode. However, I am not sure if it is unlike hibernation and he uses swapfile or not.

I am pretty sure it is wrong…

Hibernation doesn’t work that way.

I am not understanding how that is related to what we are discussing here. That is just someone with a corrupt ext4 filesystem.