Hello, bcachefs silently ignores the read-only option (-r) without notice or 
warning when creating snapshots. This could lead to unintentional data loss if 
snapshots are used as a source for backups or copies that are supposed to 
reflect the subvolume / filesystem at the time the snapshot was taken.

Here is an example:
---
[carl@clip test]$ bcachefs subvolume create subvol

[carl@clip test]$ echo "Test" > subvol/file

[carl@clip test]$ bcachefs subvolume snapshot -r subvol read-only_snapshot

[carl@clip test]$ cat read-only_snapshot/file 
Test

[carl@clip test]$ echo "This shouldn't work" > read-only_snapshot/file 

[carl@clip test]$ cat read-only_snapshot/file 
This shouldn't work
---

IMO, something like a read-only option should hard fail if it does not succeed 
and silently failing to read/write is a very bad idea.

Thank you,
Carl Thompson

Reply via email to