diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-30 03:16:32 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 17:47:07 +0100 |
commit | 0d72ab35a925d66b044cb62b709e53141c3f0143 (patch) | |
tree | a0ef3340110dac004ec3ba1d1a2d7dfb1b9e7ce0 /fs/bcachefs/xattr.c | |
parent | bcachefs: bch_sb_field_downgrade (diff) | |
download | linux-0d72ab35a925d66b044cb62b709e53141c3f0143.tar.xz linux-0d72ab35a925d66b044cb62b709e53141c3f0143.zip |
bcachefs: make RO snapshots actually RO
Add checks to all the VFS paths for "are we in a RO snapshot?".
Note - we don't check this when setting inode options via our xattr
interface, since those generally only affect data placement, not
contents of data.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Reported-by: "Carl E. Thompson" <list-bcachefs@carlthompson.net>
Diffstat (limited to 'fs/bcachefs/xattr.c')
-rw-r--r-- | fs/bcachefs/xattr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/xattr.c b/fs/bcachefs/xattr.c index 79d982674c18..5a1858fb9879 100644 --- a/fs/bcachefs/xattr.c +++ b/fs/bcachefs/xattr.c @@ -176,7 +176,8 @@ int bch2_xattr_set(struct btree_trans *trans, subvol_inum inum, struct btree_iter inode_iter = { NULL }; int ret; - ret = bch2_inode_peek(trans, &inode_iter, inode_u, inum, BTREE_ITER_INTENT); + ret = bch2_subvol_is_ro_trans(trans, inum.subvol) ?: + bch2_inode_peek(trans, &inode_iter, inode_u, inum, BTREE_ITER_INTENT); if (ret) return ret; |