diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2020-08-24 22:16:32 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:08:44 +0300 |
commit | a672fb8f5deaa577197e604ad7c6e0380f153211 (patch) | |
tree | 4aac5488823460fb7750e64bba3c13283d544aa3 /fs/bcachefs/super.h | |
parent | 7af0cec3076886d16114f4ca9794dfba3674794e (diff) | |
download | linux-a672fb8f5deaa577197e604ad7c6e0380f153211.tar.xz |
bcachefs: Make sure to go rw if lazy in fsck
The paths where we delete or truncate inodes don't pass commit flags for
BTREE_INSERT_LAZY_RW, so just go rw if necessary in the fsck code.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/super.h')
-rw-r--r-- | fs/bcachefs/super.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/bcachefs/super.h b/fs/bcachefs/super.h index b948cb0428c7..fab4bee9c90e 100644 --- a/fs/bcachefs/super.h +++ b/fs/bcachefs/super.h @@ -221,6 +221,15 @@ void bch2_fs_read_only(struct bch_fs *); int bch2_fs_read_write(struct bch_fs *); int bch2_fs_read_write_early(struct bch_fs *); +/* + * Only for use in the recovery/fsck path: + */ +static inline void bch2_fs_lazy_rw(struct bch_fs *c) +{ + if (percpu_ref_is_zero(&c->writes)) + bch2_fs_read_write_early(c); +} + void bch2_fs_stop(struct bch_fs *); int bch2_fs_start(struct bch_fs *); |