important information on btrfs getting lost in wiki & wrong vm disk defaults with btrfs storage

RolandK

Renowned Member
Mar 5, 2019
924
173
88
50
via google search for btrfs and o_direct i found this wiki page

https://pve.proxmox.com/wiki/Special:WhatLinksHere/Storage:_BTRFS

that mentions the folloging important information

"BTRFS will honor the O_DIRECT flag when opening files, meaning VMsshould not use cache mode none, otherwise there will be checksum errors."

this indeed is a known problem with btrfs, and not resolved.

https://bugzilla.redhat.com/show_bug.cgi?id=1914433

furthermore, when using compression, O_DIRECT renders compression useless ( https://marc.info/?l=linux-btrfs&m=171053186915054&w=2 )

i can confirm this problem, because i just experienced such errors and started searching for the reason.

two questions:

1. why does this important page/information seem to get lost in the wiki ?

2. why does a virtual disk of a VM created on top of btrfs still default to cache=none ?
 
  • Like
Reactions: Dunuin
meanwhile, i have found that there are quirks in action:

https://forum.proxmox.com/threads/virtual-disk-default-no-cache-settings-weirdness.143430/

https://pve.proxmox.com/wiki/Storage:_BTRFS
"BTRFS will honor the O_DIRECT flag when opening files, meaning VMs should not use cache mode none, otherwise there will be checksum errors."

I think it's not easy understandable this way.

When that page contents being relinked/trasnformed/moved - i would recommend something like this for replacement:

"BTRFS can do DirectIO, that means files can be opened with O_DIRECT flag, avoiding Linux pagecache. Unfortunately there are issues with virtual machines using this setting ( https://bugzilla.redhat.com/show_bug.cgi?id=693530 ) , so proxmox currently is applying a quirk to circumvent this (removing cache=none, which makes underlying qemu use cache=writeback)

there are even more severe issues with DirectIO and btrfs:
https://lore.kernel.org/linux-btrfs...24ae7146606c.1676684984.git.boris@bur.io/T/#u
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!