diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-01-09 20:55:58 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:22 -0400 |
commit | 6214485b6f74c098615401ae3cde74f87396a298 (patch) | |
tree | 15abbc23c74e0605058d7406a986ad2f2208315b /fs/bcachefs/btree_update_leaf.c | |
parent | 8ede99101ec354053ac755419df9da5434a13733 (diff) | |
download | lwn-6214485b6f74c098615401ae3cde74f87396a298.tar.gz lwn-6214485b6f74c098615401ae3cde74f87396a298.zip |
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>
Diffstat (limited to 'fs/bcachefs/btree_update_leaf.c')
-rw-r--r-- | fs/bcachefs/btree_update_leaf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_update_leaf.c b/fs/bcachefs/btree_update_leaf.c index 41403942133a..aa5b7960e214 100644 --- a/fs/bcachefs/btree_update_leaf.c +++ b/fs/bcachefs/btree_update_leaf.c @@ -841,7 +841,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); |