summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-01-09 20:55:58 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2022-01-09 20:56:59 -0500
commit289739217ad1a7b0a51dbe6f6ee0a7c35e07974c (patch)
tree01d855848973ab8ce84bcffc6f8bfc12770c16bd
parentb154eec068f8d52969b25a30d9bbeb3e2ced8893 (diff)
bcachefs: BTREE_INSERT_LAZY_RW is only for recovery path
BTREE_INSERT_LAZY_RW shouldn't do anything after the filesystem has finished starting up - otherwise, it might interfere with going read-only as part of shutting down. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/btree_update_leaf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c
index 93c869df106e..7186457d198b 100644
--- a/fs/bcachefs/btree_update_leaf.c
+++ b/fs/bcachefs/btree_update_leaf.c
@@ -828,7 +828,8 @@ bch2_trans_commit_get_rw_cold(struct btree_trans *trans)
struct bch_fs *c = trans->c;
int ret;
- if (likely(!(trans->flags & BTREE_INSERT_LAZY_RW)))
+ if (likely(!(trans->flags & BTREE_INSERT_LAZY_RW)) ||
+ test_bit(BCH_FS_STARTED, &c->flags))
return -EROFS;
bch2_trans_unlock(trans);