BTRFS sync writes

Hi I am new to btrfs and this forum. Please forgive me if the question sounds dump to you, but I have indeed did extensive googling and could not find satisfied answer.

I would like to know how can I ensure the writes on BTRFS is always synchronized. It means the write operation returns when the filesystem has indeed committed the writes to the persistent block storage? I know in ZFS I can set the sync = always to ensure this. But on BTRFS, even though I have mounted the volume with ‘barrier’ and ‘flushoncommit’ options, the writes are still cached in the memory. I know this because the write speed is 1.9GB/s where as my block devices has a maximum throughput of 500MB/s. I found that it has something to do with delayed allocation, and on EXT4 there is option ‘nodelalloc’ to mount it without caching. However I could not find something similar for BTRFS to ensure the writes being synchronized :frowning: Any help will be appreciated!!!

When I was installing Debian with btrfs as root it gave me a mount option for sync (it was quite the performance hit). Try “sync”, you might have to go into fstab to add this mount option.