diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-24 01:50:29 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-06 07:24:19 +0300 |
commit | 62719cf33c3ad62986130a19496cd864a0ed06c3 (patch) | |
tree | f82ecd9d2029d76f9a862302d6abd0a650aa482c /fs/bcachefs/recovery.c | |
parent | 5e329145148d7e9fe5a07ecfc08682ef7334a4d1 (diff) | |
download | linux-62719cf33c3ad62986130a19496cd864a0ed06c3.tar.xz |
bcachefs: Fix nochanges/read_only interaction
nochanges means "we cannot issue writes at all"; it's possible to go
into a pseudo read-write mode where we pin dirty metadata in memory,
which is used for fsck in dry run mode and doing journal replay on a
read only mount, but we do not want to allow an actual read-write mount
in nochanges mode.
But we do always want to allow early read-write, during recovery - this
patch clarifies that.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/recovery.c')
-rw-r--r-- | fs/bcachefs/recovery.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/bcachefs/recovery.c b/fs/bcachefs/recovery.c index a792f42ab5ff..d2914e911461 100644 --- a/fs/bcachefs/recovery.c +++ b/fs/bcachefs/recovery.c @@ -1076,7 +1076,9 @@ out: bch2_journal_keys_put_initial(c); kfree(clean); - if (!ret && test_bit(BCH_FS_need_delete_dead_snapshots, &c->flags)) { + if (!ret && + test_bit(BCH_FS_need_delete_dead_snapshots, &c->flags) && + !c->opts.nochanges) { bch2_fs_read_write_early(c); bch2_delete_dead_snapshots_async(c); } |